0

I want to install nvidia driver and cuda and cuDNN. I am using ubuntu 18.04.6 LTS. I'd like to run deep learning algorithms. I am a little confused with the ways of installation. Could you help me with that to make sure I do the right thing.

  1. First way is to follow the steps provided here for installing cuda 11.2 on Ubuntu 20.04. As follows:
sudo apt-get update
sudo apt-get upgrade

# install other import packages
sudo apt-get install g++ freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libglu1-mesa libglu1-mesa-dev

# first get the PPA repository driver
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update

# install nvidia driver with dependencies
sudo apt install libnvidia-common-470
sudo apt install libnvidia-gl-470
sudo apt install nvidia-driver-470
  1. But If I want to install cuda toolkit in this link, as far as I know, this itself can install drivers too.

My questions are:

A) I'd like to know what the difference is between these two methods? and which one is more preferable?

B) Can I run sudo ubuntu-drivers autoinstall instead of the three last commands? If it's the latest driver is 470, are both the same?

C) In what way can I avoid reinstalling driver after every kernel update?

I'd appreciate it if someone clarify these for me.

Shingol
  • 39
  • 4
  • After installing the correct driver version (from the repositories) you can install cuda also from the repositories, it's this simple. – ChanganAuto Nov 30 '21 at 14:53
  • Does this answer your question? [Are PPAs safe to add to my system and what are some "red flags" to watch out for?](https://askubuntu.com/questions/35629/are-ppas-safe-to-add-to-my-system-and-what-are-some-red-flags-to-watch-out-for) This 3-in-1 question is also possibly too broad. – karel Nov 30 '21 at 14:58
  • @ChanganAuto Could you help me how? – Shingol Nov 30 '21 at 15:02
  • @karel I think it is about adding PPA, not installing cuda. – Shingol Nov 30 '21 at 15:05
  • No, the PPA only has newer drivers versions and often not necessary to add it. It may be for 18.04 if you're using a brand new Nvidia card but other than that no, it isn't. Installing cuda should be as simple as `sudo apt install nvidia-cuda-toolkit` – ChanganAuto Nov 30 '21 at 15:12
  • @ChanganAuto But what are these commands [link](https://gist.github.com/Mahedi-61/2a2f1579d4271717d421065168ce6a73#:~:text=sudo%20apt%2Dkey,install%20cuda%2D11%2D2) for? – Shingol Nov 30 '21 at 15:19
  • Commands seem correct, your idea with the "autoinstall" works too in the same way. No, you don't need to reinstall the driver, that only happens when installing the driver from the Nvidia binaries, when installing from the repositories the driver is rebuilt for newer kernels. – ChanganAuto Nov 30 '21 at 15:25

0 Answers0