cuobjdump -sass <your.exe>
Make sure there is no nvidia related repo in source list. Comment out if existed.
sudo vim /etc/apt/sources.list
sudo apt-get update
Remove all the nvidia related packages to do a fresh reintallation. Reboot.
sudo apt-get --purge remove "*nvidia*"
sudo dpkg -r cuda
sudo dpkg -r $(dpkg -l | grep '^ii cudnn' | awk '{print $2}')
Download cuda toolkit run file and install the driver and toolkit.
sudo sh cuda_*_linux.run
Check the GPU info.
nvidia-smi
Install cudnn (for cuda toolkit v12)
wget https://developer.download.nvidia.com/compute/cudnn/9.0.0/local_installers/cudnn-local-repo-ubuntu2004-9.0.0_1.0-1_amd64.deb
sudo dpkg -i cudnn-local-repo-ubuntu2004-9.0.0_1.0-1_amd64.deb
sudo cp /var/cudnn-local-repo-ubuntu2004-9.0.0/cudnn-*-keyring.gpg /usr/share/keyrings/
sudo apt-get update
sudo apt-get -y install cudnn-cuda-12