How do you install cuda-12-2 on Ubuntu?

How do you install a specific cuda package version on Ubuntu 22?

The recommended nvidia driver for my graphics card is nvidia-driver-535.

After installing that, nvidia-smi says it supports up to Cuda 12.2.

However if I install cuda via:

wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt-get update
sudo apt-get install cuda

that installs cuda 12.6, which removes the 535 driver, breaking everything and resulting in a non-working Cuda install.

Unfortunately, there doesn’t appear to be any versioned cuda packages, like “cuda-12-2”. Only “cuda”. So it seems Cuda is completely unsupported for my hardware if I go the package route. This is very frustrating, because this package correctly installed cuda 12.2 just four months ago.

1 Like

sudo apt-get install cuda-toolkit-12-2

see here.

I don’t know if this is your cross posting, or not, but at any rate a very similar posting seems to suggest that the cuda-12-2 package is available. As I indicated in the comments there, I had no trouble installing cuda-toolkit-12-2 on a system that has no GPU and no GPU driver.