The latest version of ubuntu cuda/cudnn installation and inspection method (pro-test effective, 2021-06-25)

  1. First nvidia-smi to see if there is nvidai driver. Install one if you don't have one.

  2. If normal, there is a driver. At this time, the cuda version will also appear (upper right corner), ignore it;

  3. nvcc -V to see if there is cuda (nvidia-smi's cuda and nvcc's cuda are not the same, see reference)

  4. Install cuda, find the required cuda version here ;

  5. Use the run.sh format to install, this kind of installation can only install cuda tool without installing nvidia driver. This instruction comes from here ;

  6. Follow this tutorial to install the tool

  7. Since the driver already exists, an error will be reported , continue to follow, and be careful not to install the driver (do not put an X in front of it)

  8. Summary will appear after success, where Driver is not selected

  9. Set the path path (there is an installed path in the summary, modify the following code according to it)
    export PATH=/usr/local/cuda-11.1/bin${PATH:+:${PATH}} export LD_LIBRARY_PATH=/usr/local/cuda-11.1/lib64{LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

  10. Successful installation: nvcc -V check

  11. Download the cudnn address , pay attention to register an account, pay attention to the corresponding downloaded version, remember to download cuDNN Library for Linux;

  12. Note that wget cannot be used to download here, because an account is required. Refer to this article to download, just change the corresponding version number, which can be obtained in step 11.

  13. Just follow the tutorial to decompress and copy (note that you copy to the 11.1 path installed above), and note that the instructions of the new version have changed, see this comment areasudo cp cuda/include/cudnn*.h /usr/local/cuda-11.1/include sudo cp cuda/lib64/libcudnn* /usr/local/cuda-11.1/lib64 sudo chmod a+r /usr/local/cuda-11.1/include/cudnn*.h /usr/local/cuda-11.1/lib64/libcudnn*

  14. Use the method of detecting cuda/cudnn comment area to view the installation results:
    cat /usr/local/cuda-11.1/include/cudnn_version.h | grep CUDNN_MAJOR -A 2

Guess you like

Origin blog.csdn.net/qq_40491305/article/details/118216669