Skip to content

Instantly share code, notes, and snippets.

@leimingyu
Last active March 18, 2024 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leimingyu/f7a5c030a1eb0d1a680b42b7345ba7fe to your computer and use it in GitHub Desktop.
Save leimingyu/f7a5c030a1eb0d1a680b42b7345ba7fe to your computer and use it in GitHub Desktop.
cuda related notes

dump sass

cuobjdump -sass <your.exe>

Install/Remove CUDA Driver/Toolkit in Ubuntu

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment