Installing Cuda on Ubuntu 22.04 with RTX 4090

I just got a new desktop containing RTX 4090 running Ubuntu 22.04 LTS. The display driver I was able to install and run without any issues is 520.56.06. When I run nvidia-smi I see CUDA version as 11.8 but I don’t know how to install it. The only toolkit option I see at nVIDIA’s download site appears to be for driver 520.61.05. So, I find myself stuck with incompatibility between the driver and Cuda. Thanks for any pointer to resolve this.
PS: Here is what I get when invoke nvidia-smi
| NVIDIA-SMI 520.56.06 Driver Version: 520.56.06 CUDA Version: 11.8 |
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
| 0 NVIDIA GeForce … Off | 00000000:01:00.0 On | Off |
| 0% 40C P8 32W / 450W | 647MiB / 24564MiB | 5% Default |
| | | N/A |

| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
| 0 N/A N/A 1842 G /usr/lib/xorg/Xorg 399MiB |
| 0 N/A N/A 2101 G /usr/bin/gnome-shell 73MiB |
| 0 N/A N/A 4065 G …7/usr/lib/firefox/firefox 171MiB |

check of there are any nvidia drivers installed in the system

sudo apt-cache search nvidia

it here are any uninstall them (“.” at the end is important, just packages)

sudo apt-get purge nvidia.

Install nvidia-cuda-toolkit

sudo apt-get update
sudo apt-get -y install nvidia-cuda-toolkit

It helped me too to have the same driver as NVIDIAToolkit for my NVIDIA GeForce GTX 960M card on KALI Linux.

Hi, I encountered exactly the same problem with my RTX 3060 ti.

I was able to solve the problem by leaving the driver 520.56.06 and install only cuda-toolkit by typing
“sudo apt-get -y install cuda-toolkit-11-8”
instead of
" sudo apt-get -y install cuda"

Hope this helps!

Hello @yasunaok thanks for the sharing your experience but invoking that command (sudo apt-get -y install cuda-11-8) results in the response Unable to locate package cuda-toolkit-11-8

I was able to download CUDA toolkit 11.8 meta-package with the command. Should use ‘-11-8’ instead of ‘-11.8’

Alternatively, you may download a specific one from their repository