Install Options
A couple of ways to install CUDA:
- get everything from NVIDIA CUDA site
- apt-get
- docker
For the latest CUDA version, do method #1. For easier way, #2. I chose to do #2. But after went through it, I'm not sure if it's really easier.
And #2 method, the CUDA version is 10.1. I haven't tried docker method.
Install
Checking driver version:
$ nvidia-smi
Fri Aug 7 18:35:38 2020
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.100 Driver Version: 440.100 CUDA Version: 10.2 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 Quadro P2000 Off | 00000000:09:00.0 On | N/A |
| 53% 47C P8 7W / 75W | 663MiB / 5057MiB | 17% Default |
+-------------------------------+----------------------+----------------------+
...
Install packages using apt-get
$ sudo apt-get install build-essentials nvidia-cuda-toolkit
Check nvcc version:
$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Sun_Jul_28_19:07:16_PDT_2019
Cuda compilation tools, release 10.1, V10.1.243
Install cudnn
- Download cudnn, https://developer.nvidia.com/cudnn
- uncompress
- sudo cp cuda/include/cudnn.h /usr/lib/cuda/include/
sudo cp cuda/lib64/libcudnn* /usr/lib/cuda/lib64/
sudo chmod a+r /usr/lib/cuda/include/cudnn.h /usr/lib/cuda/lib64/libcudnn*
Install sample codes
Using apt-get, it doesn't come with sample codes. For installing Kinect2 (will be on another posting), the sample is needed. Install only if you need it.
Download from github, https://github.com/NVIDIA/cuda-samples/tree/10.1.2
And store it anywhere you want. Note that some other dependent code may look for it in a certain path, such as /usr/local/cuda-X-Y...
A couple more things to do:
[1]
nvcc is installed in /usr/bin/ -- examples and some programs I use (sorry didn't write it down and forgot what it was) looks for it in /usr/local/cuda/bin. Create a sym link there.
[2] vi .vashrc
export LD_LIBRARY_PATH=/usr/lib/cuda/lib64:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/usr/lib/cuda/include:$LD_LIBRARY_PATH
Reference
- https://www.pugetsystems.com/labs/hpc/How-To-Install-CUDA-10-together-with-9-2-on-Ubuntu-18-04-with-support-for-NVIDIA-20XX-Turing-GPUs-1236/
- https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#recommended-post
- https://www.pugetsystems.com/labs/hpc/How-To-Install-CUDA-10-1-on-Ubuntu-19-04-1405/
- https://medium.com/@patrickorcl/install-cuda-10-and-cudnn-on-ubuntu-18-b28b59bae279
- https://askubuntu.com/questions/1230645/when-is-cuda-gonna-be-released-for-ubuntu-20-04
- https://askubuntu.com/questions/1230645/when-is-cuda-gonna-be-released-for-ubuntu-20-04
- https://medium.com/@patrickorcl/install-cuda-10-and-cudnn-on-ubuntu-18-b28b59bae279
CUDA Samples
- https://docs.nvidia.com/cuda/cuda-samples/index.html
- https://github.com/NVIDIA/cuda-samples/tree/10.1.2
- https://www.pugetsystems.com/labs/hpc/How-To-Install-CUDA-10-together-with-9-2-on-Ubuntu-18-04-with-support-for-NVIDIA-20XX-Turing-GPUs-1236/#step-6-test-cuda-by-building-the-samples-from-source-for-both-cuda-92-and-cuda-100
Nvidia Docker
- https://github.com/NVIDIA/nvidia-docker#quick-start
- https://developer.nvidia.com/blog/nvidia-docker-gpu-server-application-deployment-made-easy/
- https://github.com/NVIDIA/nvidia-docker
No comments:
Post a Comment