Skip to content

Instantly share code, notes, and snippets.

@AmgadHasan
Last active August 31, 2023 22:21
Show Gist options
  • Save AmgadHasan/b23ff200fbfdca6250ba9276408ee610 to your computer and use it in GitHub Desktop.
Save AmgadHasan/b23ff200fbfdca6250ba9276408ee610 to your computer and use it in GitHub Desktop.
install nvidia drivers + cuda

How to install nvidia drivers + nvidia cuda on new vms

https://developer.nvidia.com/cuda-11-7-1-download-archive?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=22.04&target_type=runfile_local

1. Download runfile:

from the command line, run:

wget https://developer.download.nvidia.com/compute/cuda/11.7.1/local_installers/cuda_11.7.1_515.65.01_linux.run

2. Install runfile from command line:

from the command line, run:

sudo sh cuda_11.7.1_515.65.01_linux.run

3. Add cuda to path:

Add the following to the .profile or .bashrc file (nano ~/.profile)

export PATH=/usr/local/cuda-11.7/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-11.7/lib64

4. Test

1. Check the driver is properly installed

Run

nvidia-smi

You should get output like this: nvidia-smi

2. Check cuda is installed

Run

nvcc -V

nvcc-v

@newbie-lad
Copy link

Well detailed 👏

@AmgadHasan
Copy link
Author

Well detailed 👏

Thanks. I hope it helped you out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment