|
|
| (26 intermediate revisions by the same user not shown) |
| Line 1: |
Line 1: |
|
| |
|
| ==Installation== | | ==Installation== |
| ===Linux===
| | I suggest using conda to install cuda for version control your project. |
| [https://www.pugetsystems.com/labs/hpc/How-To-Install-CUDA-10-1-on-Ubuntu-19-04-1405/#Step3)InstallCUDA\ Reference]
| |
|
| |
|
| * Install the latest nvidia drivers from the standard repo, e.g. <code>nvidia-drivers-465</code><br>
| | Note that <code>nvidia-smi</code> lists the maximum CUDA version supported by the GPU driver, not the installed version of CUDA.<br> |
| * Install [https://developer.nvidia.com/cuda-toolkit Cuda Toolkit] separately without the drivers.<br>
| | You can have a different version of CUDA installed in each conda environment, independently of the version supported by the GPU driver. |
| ** Use one of the deb install options.
| |
| * For machine learning, you may also want to install the following:
| |
| ** [https://developer.nvidia.com/rdp/cudnn-download cuDNN]
| |
| ** [https://docs.nvidia.com/deeplearning/tensorrt/install-guide/index.html#installing TensorRT]
| |
|
| |
|
| See [https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#ubuntu-installation CUDA Ubuntu Installation] | | ===Conda=== |
| | See [https://anaconda.org/nvidia/cuda-toolkit nvidia/cuda-toolkit] and [https://anaconda.org/nvidia/cuda-libraries-dev nvidia/cuda-libraries-dev] |
| | |
| | For example: |
| <syntaxhighlight lang="bash"> | | <syntaxhighlight lang="bash"> |
| # Add NVIDIA package repositories | | # Install the runtime only |
| wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin
| | conda install -c "nvidia/label/cuda-11.8.0" cuda-toolkit |
| sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
| | # Install the runtime and the development tools |
| sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/7fa2af80.pub
| | conda install -c "nvidia/label/cuda-11.8.0" cuda-toolkit cuda-libraries-dev cuda-nvcc |
| sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /"
| | </syntaxhighlight> |
|
| |
|
| wget https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu2004/x86_64/nvidia-machine-learning-repo-ubuntu2004_1.0.0-1_amd64.deb
| | ===Ubuntu=== |
| sudo apt install ./nvidia-machine-learning-repo-ubuntu2004_1.0.0-1_amd64.deb
| | [https://developer.nvidia.com/cuda-toolkit CUDA Toolkit] |
| sudo apt update
| |
|
| |
|
| # Install NVIDIA driver | | <syntaxhighlight lang="bash"> |
| sudo apt install nvidia-driver-465 | | # Install drivers |
| # Reboot
| | sudo apt install nvidia-driver-565-open |
| # Check that GPUs are visible using nvidia-smi
| |
| sudo apt install cuda
| |
| | |
| # Install development and runtime libraries
| |
| sudo apt install libcudnn8 libcudnn8-dev
| |
| #sudo apt-get install -y libnvinfer6 libnvinfer-dev libnvinfer-plugin6
| |
| </syntaxhighlight> | | </syntaxhighlight> |
|
| |
|
| For TensorFlow and PyTorch, you may need to add <code>LD_LIBRARY_PATH=/usr/local/cuda/lib64</code> to your environment variables.<br>
| | ===GCC Versions=== |
| You can also do this in PyCharm.<br>
| |
| [[File:Pycharm LD LIBRARY PATH config.png| 200x200px]]
| |
| [[File:Pycharm LD LIBRARY PATH console config.png| 200x200px]]
| |
| | |
| ==GCC Versions== | |
| <code>nvcc</code> sometimes only supports older gcc/g++ versions. | | <code>nvcc</code> sometimes only supports older gcc/g++ versions. |
| To make it use those by default, create the following symlinks: | | To make it use those by default, create the following symlinks: |
| Line 53: |
Line 39: |
| ==References== | | ==References== |
| * [https://devblogs.nvidia.com/even-easier-introduction-cuda/ An Even Easier Introduction To Cuda] | | * [https://devblogs.nvidia.com/even-easier-introduction-cuda/ An Even Easier Introduction To Cuda] |
| | |
| | [[Category:Programming languages]] |
| | [[Category:GPU Programming languages]] |