Get CUDA 11.x?

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
pendrifter
Level 3
Level 3
Posts: 148
Joined: Sun Apr 20, 2014 12:58 pm

Get CUDA 11.x?

Post by pendrifter »

I want to install CUDA version 11-something for the purpose of engaging my lappy's 3070 in some AI art, but I am confused (and a little scared). For one thing, nvidia-smi reports that I have 11.4 already:

Code: Select all

Fri May 20 12:26:16 2022       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.129.06   Driver Version: 470.129.06   CUDA Version: 11.4     |
|-------------------------------+----------------------+----------------------+
| 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 Off |                  N/A |
| N/A   53C    P0    38W /  N/A |   1028MiB /  7982MiB |     27%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      1729      G   /usr/lib/xorg/Xorg                362MiB |
|    0   N/A  N/A      2249      G   xfwm4                               3MiB |
|    0   N/A  N/A    239290      G   /usr/lib/firefox/firefox           90MiB |
|    0   N/A  N/A    239592      G   /usr/lib/firefox/firefox-bin      111MiB |
|    0   N/A  N/A    242431      G   ...AAAAAAAAA= --shared-files       22MiB |
|    0   N/A  N/A    243344      G   /usr/lib/firefox/firefox-bin      153MiB |
|    0   N/A  N/A    244102      G   /usr/lib/firefox/firefox-bin      149MiB |
|    0   N/A  N/A    292160      G   /usr/lib/firefox/firefox-bin      128MiB |
+-----------------------------------------------------------------------------+

...however, dpkg -l |grep cuda reports:

Code: Select all

ii  libcudart10.1:amd64                           10.1.243-3                           amd64        NVIDIA CUDA Runtime Library
ii  nvidia-cuda-dev                               10.1.243-3                           amd64        NVIDIA CUDA development files
ii  nvidia-cuda-doc                               10.1.243-3                           all          NVIDIA CUDA and OpenCL documentation
ii  nvidia-cuda-gdb                               10.1.243-3                           amd64        NVIDIA CUDA Debugger (GDB)
ii  nvidia-cuda-toolkit                           10.1.243-3                           amd64        NVIDIA CUDA development toolkit

...sooooooo not sure what to think here. I'm pretty certain I need CUDA 11.x all around to engage the 3070, but I realize I'm in deep waters, and I have hosed system before f-ing around with graphic drivers, so I would like somebody who's experienced with this to please please advise me.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
OS: Linux Mint 21.2 x86_64
Host: 82TD Legion 7 16IAX7
Kernel: 6.2.0-34-generic
User avatar
spamegg
Level 13
Level 13
Posts: 4861
Joined: Mon Oct 28, 2019 2:34 am
Contact:

Re: Get CUDA 11.x?

Post by spamegg »

I would trust the driver report, not the package manager's numbers. The apt package version numbers do not necessarily correspond to NVIDIA's CUDA versioning number scheme. The number 10.1.243-3 does not necessarily measure the same thing as 11.4. It could have some other meaning, or simply it could be inaccurate.

Try running your AI art stuff and see if you run into any issues.
User avatar
SMG
Level 25
Level 25
Posts: 31333
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: Get CUDA 11.x?

Post by SMG »

pendrifter wrote: Fri May 20, 2022 12:42 pm I want to install CUDA version 11-something for the purpose of engaging my lappy's 3070 in some AI art, but I am confused (and a little scared). For one thing, nvidia-smi reports that I have 11.4 already:
How did you install the Nvidia driver?

If one installs the CUDA package (or CUDA tools package), the current version in the repos is 10.1 (which is what you have showing as installed). If you need something newer, the last I checked one needs to get files from the Nvidia website. Additionally, there have been some issues in doing that in the recent past and some workarounds were needed.

We need to know more information about how you installed the Nvidia driver and CUDA packages showing in your output in order to be able to give you appropriate advice.
Image
A woman typing on a laptop with LM20.3 Cinnamon.
User avatar
SMG
Level 25
Level 25
Posts: 31333
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: Get CUDA 11.x?

Post by SMG »

spamegg wrote: Fri May 20, 2022 5:40 pm The apt package version numbers do not necessarily correspond to NVIDIA's CUDA versioning number scheme.
Yes, the package version number does correspond to the CUDA version number.
spamegg wrote: Fri May 20, 2022 5:40 pm The number 10.1.243-3 does not necessarily measure the same thing as 11.4.
That is correct. The 10.1 version is older than the 11.4 version.

However, if one installs both package version and versions from the Nvidia website, there could be more than one version installed.

pendrifter: Nvidia has specific requirements regarding which CUDA version should be used with which driver version. You can not mix and match any driver version with any CUDA version if you want the system to work properly.
Image
A woman typing on a laptop with LM20.3 Cinnamon.
User avatar
spamegg
Level 13
Level 13
Posts: 4861
Joined: Mon Oct 28, 2019 2:34 am
Contact:

Re: Get CUDA 11.x?

Post by spamegg »

It does? Well I'm surprised. Good to know, thanks SMG. Disregard what I said earlier, it was wrong. It's because I ran into many other packages in the past that did not correspond to the vendor's version numbers.

So I guess the OP must have installed a higher version through some other means? Does the Driver Manager install CUDA for you, so you get multiple versions installed? Then nvidia-smi reports the higher version?
User avatar
SMG
Level 25
Level 25
Posts: 31333
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: Get CUDA 11.x?

Post by SMG »

spamegg wrote: Sat May 21, 2022 7:24 amSo I guess the OP must have installed a higher version through some other means?
We'll have to wait to hear from OP to know. I'm not sure what might have happened.
spamegg wrote: Sat May 21, 2022 7:24 amDoes the Driver Manager install CUDA for you, so you get multiple versions installed?
Driver Manager only installs the driver. It does not install CUDA or CUDA tools. Those are separate packages which must be installed manually.
Image
A woman typing on a laptop with LM20.3 Cinnamon.
pendrifter
Level 3
Level 3
Posts: 148
Joined: Sun Apr 20, 2014 12:58 pm

Re: Get CUDA 11.x?

Post by pendrifter »

thbth nm...
Last edited by pendrifter on Sat May 21, 2022 3:38 pm, edited 1 time in total.
OS: Linux Mint 21.2 x86_64
Host: 82TD Legion 7 16IAX7
Kernel: 6.2.0-34-generic
pendrifter
Level 3
Level 3
Posts: 148
Joined: Sun Apr 20, 2014 12:58 pm

Re: Get CUDA 11.x?

Post by pendrifter »

spamegg wrote: Fri May 20, 2022 5:40 pm Try running your AI art stuff and see if you run into any issues.
I have. Here is the (latest) error I am receiving:

Code: Select all

Warning: 
NVIDIA GeForce RTX 3070 Laptop GPU with CUDA capability sm_86 is not compatible with the current PyTorch installation.
The current PyTorch install supports CUDA capabilities sm_37 sm_50 sm_60 sm_70.
If you want to use the NVIDIA GeForce RTX 3070 Laptop GPU GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/

  warnings.warn(incompatible_device_warn.format(device_name, capability, " ".join(arch_list), device_name))
Setting up [LPIPS] perceptual loss: trunk [vgg], v[0.1], spatial [off]
Loading model from: /home/krovas/.local/lib/python3.8/site-packages/lpips/weights/v0.1/vgg.pth
filepath ./content/images_out/DiscoTime exists.
filepath ./content/images_out/DiscoTime/partials exists.
Prepping model...
Traceback (most recent call last):
  File "main.py", line 1270, in <module>
    model.convert_to_fp16()
  File "/home/krovas/Downloads/main/./guided-diffusion/guided_diffusion/unet.py", line 622, in convert_to_fp16
    self.input_blocks.apply(convert_module_to_f16)
  File "/home/krovas/.local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 667, in apply
    module.apply(fn)
  File "/home/krovas/.local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 667, in apply
    module.apply(fn)
  File "/home/krovas/.local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 668, in apply
    fn(self)
  File "/home/krovas/Downloads/main/./guided-diffusion/guided_diffusion/fp16_util.py", line 20, in convert_module_to_f16
    l.weight.data = l.weight.data.half()
RuntimeError: CUDA error: no kernel image is available for execution on the device
CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.
Thing is, I've followed the instructions at the link above, I've tried both versions of PyTorch listed above (1.11 and 1.8.4), and I'm still getting the same failure.

According to this matrix, you need CUDA 11.x for Ampere architecture cards:

https://docs.nvidia.com/deeplearning/cu ... ions-linux

So I am again leaning toward CUDA tools update.
OS: Linux Mint 21.2 x86_64
Host: 82TD Legion 7 16IAX7
Kernel: 6.2.0-34-generic
pendrifter
Level 3
Level 3
Posts: 148
Joined: Sun Apr 20, 2014 12:58 pm

Re: Get CUDA 11.x?

Post by pendrifter »

SMG wrote: Sat May 21, 2022 8:23 am
spamegg wrote: Sat May 21, 2022 7:24 amSo I guess the OP must have installed a higher version through some other means?
We'll have to wait to hear from OP to know. I'm not sure what might have happened.
spamegg wrote: Sat May 21, 2022 7:24 amDoes the Driver Manager install CUDA for you, so you get multiple versions installed?
Driver Manager only installs the driver. It does not install CUDA or CUDA tools. Those are separate packages which must be installed manually.
I update the NVIDIA drivers whenever the Update Manager prompts me to. As far as the CUDA tools, they are pre-installed AFAIK, and indeed appear to be the latest (only) version available in Synaptic. I didn't install them manually; Compute Unified Device Architecture is a pretty new concept to me.
OS: Linux Mint 21.2 x86_64
Host: 82TD Legion 7 16IAX7
Kernel: 6.2.0-34-generic
User avatar
SMG
Level 25
Level 25
Posts: 31333
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: Get CUDA 11.x?

Post by SMG »

pendrifter wrote: Sat May 21, 2022 3:35 pm
SMG wrote: Sat May 21, 2022 8:23 am
spamegg wrote: Sat May 21, 2022 7:24 amDoes the Driver Manager install CUDA for you, so you get multiple versions installed?
Driver Manager only installs the driver. It does not install CUDA or CUDA tools. Those are separate packages which must be installed manually.
I update the NVIDIA drivers whenever the Update Manager prompts me to. As far as the CUDA tools, they are pre-installed AFAIK, and indeed appear to be the latest (only) version available in Synaptic. I didn't install them manually; Compute Unified Device Architecture is a pretty new concept to me.
Perhaps you are confusing Driver Manager and Synaptic.

As I have already stated, CUDA tools are NOT installed when one installs the Nvidia driver from Driver Manager. If you are installing drivers from Synaptic then you may be installing something different.

You posted a topic about getting CUDA 11.x. You have since indicated you are having a problem with PyTorch. If you look at the message you posted,

Code: Select all

If you want to use the NVIDIA GeForce RTX 3070 Laptop GPU GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/
it indicates to go to this link. On that webpage, it indicates the PyTorch 1.11 use CUDA version 10.2.

Please provide the output of dpkg -l | grep -i nvidia and inxi -Fxxxrz
Image
A woman typing on a laptop with LM20.3 Cinnamon.
Locked

Return to “Software & Applications”