Skip to main content

Installing Nvidia Driver and CUDA Ubuntu Victus

 



Get corresponding CUDA for your TF Version: https://www.tensorflow.org/install/source#gpu
https://developer.nvidia.com/cuda-11-8-0-download-archive?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=22.04&target_type=runfile_local
Example: wget https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run

sudo sh cuda_11.2.2_460.32.03_linux.run --override
--override to override gcc version check

[Existing package manage installation of driver found] : Continue
Update: I only installed Toolkit no driver/samples/demo suite/doc - note driver version is 520



export PATH=/usr/local/cuda-11.8/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
export CUDA_HOME=/usr/local/cuda

Now install CUDNN:
https://developer.nvidia.com/rdp/cudnn-archive
For my case: Download cuDNN v8.6.0 (October 3rd, 2022), for CUDA 11.x
Download tar: [doesn't work anymore without login]
https://developer.nvidia.com/compute/cudnn/secure/8.6.0/local_installers/11.8/cudnn-linux-x86_64-8.6.0.163_cuda11-archive.tar.xz
tar xf cudnn-linux-x86_64-8.6.0.163_cuda11-archive.tar.xz

sudo cp include/cudnn.h /usr/local/cuda-11.8/include
sudo cp lib/libcudnn* /usr/local/cuda-11.8/lib64
sudo chmod a+r /usr/local/cuda-11.8/include/cudnn.h /usr/local/cuda-11.8/lib64/libcudnn*

For driver, Additional Drivers > 




Do not install driver

sudo vi ~/.bashrc

add the following

export PATH=/usr/local/cuda-11.2/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-11.2/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
export CUDA_HOME=/usr/local/cuda

https://ubuntuhandbook.org/index.php/2022/10/nvidia-driver-520-install-ubuntu/#:~:text=In%20case%20you%20don't,and%20re%2Dopen%20the%20utility.

In case you don’t see the 520 driver in the list, navigate to the first ‘Ubuntu Software’ tab, and make sure the 4 repositories (main, universe, restricted, multiverse) are enabled. Finally, close and Reload, and re-open the utility.


If 520 not found 510 worked - for tensorflow gpu

525 probably didn't work but test later to be sure


510 also fixed the dual display issue for ubuntu