3 ms·
There is an nvidia dev apt repo that is great for installing and setting CUDA up because apt does all the heavy lifting for you. I've never had any problems wi
by proverbialbunny 7y ago
There is an nvidia dev apt repo that is great for installing and setting CUDA up because apt does all the heavy lifting for you. I've never had any problems with it.
First an optional prerequisite, for updated video drivers:
```
sudo apt-get install -y software-properties-common &&
sudo add-apt-repository -y ppa:graphics-drivers/ppa && sudo apt-get update &&
sudo apt-get install -y nvidia-driver-NNN
```
(Eg, nvidia-driver-435)
This is sometimes a required prerequisite, because these drivers have 32bit and 64bit binaries in them where the ones from nvidia's website or normal apt packages only have the 64bit drivers. (Eg, it's a requirement for Steam and many video games, which will suddenly stop working when CUDA is installed.)
Then there is CUDA itself:
```
sudo apt-get install -y gnupg2 curl ca-certificates &&
curl -fsSL https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub https://developer.download.nvidia.com/compute/cuda/repos/ubu... | sudo apt-key add - &&
sudo echo "deb https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64 https://developer.download.nvidia.com/compute/machine-learni... /" > /etc/apt/sources.list.d/nvidia-ml.list &&
sudo apt-get update &&
sudo apt-get install -y nvidia-cuda-toolkit libcudnn7 libcudnn7-dev
```
(If also using cudnn.)
Also note: NVIDIA currently doesn't officially support Ubuntu 19, but their 18.04 repo works perfectly for 19. In the future you can always try grabbing from https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1904/x86_64/ https://developer.download.nvidia.com/compute/cuda/repos/ubu... instead.