sudo apt update && sudo apt upgradesudo apt autoremove nvidia* --purgeubuntu-drivers devicesYou will install the NVIDIA driver whose version is tagged with recommended
sudo ubuntu-drivers autoinstallMy recommended version is 525, adapt to yours
sudo apt install nvidia-driver-525rebootafter restart verify that the following command works
nvidia-smisudo apt update && sudo apt upgradesudo apt install nvidia-cuda-toolkitnvcc --versionYou can download cuDNN file here. You will need an Nvidia account. Select the cuDNN version for the appropriate CUDA version, which is the version that appears when you run:
nvcc --versionsudo apt install ./<filename.deb>
sudo cp /var/cudnn-<something>.gpg /usr/share/keyrings/My cuDNN version is 8, adapt the following to your version:
sudo apt update
sudo apt install libcudnn8
sudo apt install libcudnn8-dev
sudo apt install libcudnn8-samplessudo apt-get install python3-pip
sudo pip3 install virtualenv
virtualenv -p py3.10 venv
source venv/bin/activatepip3 install torch torchvision torchaudioimport torch
print(torch.cuda.is_available()) # should be True
t = torch.rand(10, 10).cuda()
print(t.device) # should be CUDAGo to Nvidia webiste here. Select latest TensorRT version that matches your CUDA version and download the DEB file.
sudo apt install ./<filename.deb>
sudo apt update
sudo apt install tensorrtVerify that the trtexec utility is present.
whereis trtexec # should be trtexec: /usr/src/tensorrt/bin/trtexec
/usr/src/tensorrt/bin/trtexec
I used ...
sudo apt install nvidia-driver-470
However when I install the cuda toolkit later in the process the 470 ( recommended ) drivers are uninstalled ?????
The following packages will be REMOVED:
libnvidia-compute-470 libnvidia-compute-470:i386 libnvidia-decode-470
libnvidia-decode-470:i386 libnvidia-encode-470 libnvidia-encode-470:i386
nvidia-compute-utils-470 nvidia-driver-470 nvidia-utils-470
The following NEW packages will be installed:
libcuinj64-11.5 libnvidia-compute-495 libnvidia-compute-510
libnvidia-compute-525 libnvidia-ml-dev nsight-systems nsight-systems-target
nvidia-cuda-dev nvidia-cuda-toolkit nvidia-profiler nvidia-visual-profiler
This breaks my hardware support at runtime ( unsupported HW errors ).
Any clues ?