1. 程式人生 > >原始碼安裝cuDNN v7.3.0 for CUDA 10.0,並測試cuDNN是否安裝成功

原始碼安裝cuDNN v7.3.0 for CUDA 10.0,並測試cuDNN是否安裝成功

參考:

前提:CUDA 10.0 已經安裝完成!!

1、下載cuDNN:

選擇其他版本:

下載後,解壓,直接將對應標頭檔案和庫拷貝到CUDA的安裝目錄即可,記得修改庫檔案的檔案許可權

  1. Unzip the cuDNN package.

    $ tar -xzvf cudnn-9.0-linux-x64-v7.tgz

  2. Copy the following files into the CUDA Toolkit directory, and change the file permissions.

    $ sudo cp cuda/include/cudnn.h /usr/local/cuda/include

    $ sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64

    $ sudo chmod 777 /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*

3、測試cuDNN

  1. Copy the cuDNN sample to a writable path.

    $sudo cp -r /usr/src/cudnn_samples_v7/ ~/

  2. Go to the writable path.

    $ cd ~/cudnn_samples_v7/mnistCUDNN

  3. Compile the mnistCUDNN sample.

    $sudo make clean && make

  4. Run the mnistCUDNN sample.

    $ ./mnistCUDNN

    If cuDNN is properly installed and running on your Linux system, you will see a message similar to the following:如果安裝成功 測試完成後顯示:

    Test passed!