If in case you have simply upgraded Ubuntu in your AWS g4dn occasion and want to put in/reinstall Cuda drivers on your Nvidia chipset, then you possibly can run the next:
Set up Cuda drivers for Nvidia on Ubuntu
wget https://developer.obtain.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin
sudo mv cuda-ubuntu1804.pin /and so forth/apt/preferences.d/cuda-repository-pin-600
sudo apt-key adv --fetch-keys https://developer.obtain.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub
sudo add-apt-repository "deb https://developer.obtain.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ /"
sudo apt-get replace
sudo apt-get -y set up cuda
Easy methods to get the variations on your personal setup
Or comply with the wizard right here to generate the proper model numbers on your particular surroundings/platform:
CUDA Toolkit 11.5 Replace 1 Downloads | NVIDIA Developer
Easy methods to test the set up was profitable
You possibly can test that the set up was profitable by operating the Nvidia SMI device:
nvidia-smi