Installing nvidia-cuda-toolkit

Hello,

I just freshly installed the Nvidia drivers and CUDA on my Linux computer. After adding the required keyrings,

sudo apt autoremove nvidia* --purge
sudo apt install nvidia-driver-535-server
sudo apt install cuda

After rebooting, nvidia-smi returns the following

+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.104.05             Driver Version: 535.104.05   CUDA Version: 12.2     |
|-----------------------------------------+----------------------+----------------------+
| 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 RTX 3090        On  | 00000000:01:00.0 Off |                  N/A |
|  0%   38C    P8              14W / 350W |      3MiB / 24576MiB |      0%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+
                                                                                         
+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|  No running processes found                                                           |
+---------------------------------------------------------------------------------------+

Since I want to use nvcc, I tried installing it with sudo apt install nvidia-cuda-toolkit. But this returns the following

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libcuinj64-11.5 : Depends: libnvidia-compute-495 (>= 495) but it is not going to be installed or
                            libnvidia-compute-495-server (>= 495) but it is not installable or
                            libcuda.so.1 (>= 495) or
                            libcuda-11.5-1
 libnvidia-ml-dev : Depends: libnvidia-compute-495 (>= 495) but it is not going to be installed or
                             libnvidia-compute-495-server (>= 495) but it is not installable or
                             libnvidia-ml.so.1 (>= 495)
 nvidia-cuda-dev : Depends: libnvidia-compute-495 (>= 495) but it is not going to be installed or
                            libnvidia-compute-495-server (>= 495) but it is not installable or
                            libcuda.so.1 (>= 495) or
                            libcuda-11.5-1
                   Recommends: libnvcuvid1 but it is not installable
E: Unable to correct problems, you have held broken packages.

What am I doing wrong :'). Any help will be very much appreciated

1 Like

I have fixed it with

conda install -c "nvidia/label/cuda-11.7.0" cuda-toolkit

Cheers

1 Like

@pereramat2000 I also have the same error on my freshly installed Nvidia drivers and CUDA. Could you solve the issue?

+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.104.12             Driver Version: 535.104.12   CUDA Version: 12.2     |
|-----------------------------------------+----------------------+----------------------+
| 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 RTX 2060        On  | 00000000:01:00.0 Off |                  N/A |
|  0%   31C    P8              12W / 172W |   4901MiB /  6144MiB |      0%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+
|   1  NVIDIA GeForce RTX 3090        On  | 00000000:03:00.0 Off |                  N/A |
|  0%   29C    P8              19W / 370W |  22754MiB / 24576MiB |      0%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+
|   2  NVIDIA GeForce RTX 2060        On  | 00000000:05:00.0 Off |                  N/A |
|  0%   30C    P8               8W / 172W |   4901MiB /  6144MiB |      0%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+
|   3  NVIDIA GeForce RTX 2060        On  | 00000000:06:00.0 Off |                  N/A |
|  0%   29C    P8              11W / 172W |   4901MiB /  6144MiB |      0%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+
                                                                                         
+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|    0   N/A  N/A      3715      C   /usr/ai/layoutlmv3/.venv/bin/python        4898MiB |
|    1   N/A  N/A      3715      C   /usr/ai/layoutlmv3/.venv/bin/python       22746MiB |
|    2   N/A  N/A      3715      C   /usr/ai/layoutlmv3/.venv/bin/python        4898MiB |
|    3   N/A  N/A      3715      C   /usr/ai/layoutlmv3/.venv/bin/python        4898MiB |
+---------------------------------------------------------------------------------------+
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libcuinj64-11.5 : Depends: libnvidia-compute-495 (>= 495) but it is not going to be installed or
                            libnvidia-compute-495-server (>= 495) but it is not installable or
                            libcuda.so.1 (>= 495) or
                            libcuda-11.5-1
E: Unable to correct problems, you have held broken packages.
1 Like

I see the same issue with 535 driver.

I had to remove old installation and make full installation from cuda website and it works now.

Worked for me !Thanks

In fact, nvcc has been integrated into cuda-12.. And you can use nvcc by just adding /usr/local/cuda-.*/bin to your PATH by export, .bashrc or any way you prefer.

1 Like