GPU Pytorch Jupiter notebook

Hi Guys,
I tried to use my GPU (NVIDIA Geforce Rtx 3060) but my Jupiter notebook did not recognize it.

import torch
print("Using torch", torch.__version__)

Using torch 1.12.1+cu102

gpu_avail = torch.cuda.is_available()
print(f"Is the GPU available? {gpu_avail}")

Is the GPU available? False

Do you have please an idea for solving that?
Thank you for your help
Best
Nazim

Your 3090 needs CUDA 11.x while you’ve installed the PyTorch binaries with CUDA 10.2.
Update PyTorch to the latest stable or nightly release with CUDA 11.7 or 11.8 as described here.

@ptrblck, thank you for your help. Strangely It could update it to my terminal:

(base) one@asus:~$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Thu_Nov_18_09:45:30_PST_2021
Cuda compilation tools, release 11.5, V11.5.119
Build cuda_11.5.r11.5/compiler.30672275_0

But when I tried to work on my jupiter, the version of cuda was 10.2.

I did not understand. May be do you have another solution for that?
Thank you
Best
Nazim

nvcc --version reports the version of the CUDA compiler installed in your local CUDA toolkit and is not related to the CUDA runtime and libraries used in the PyTorch binaries.
The binaries ship with their own CUDA dependencies and your local CUDA toolkit will be used to build PyTorch from source or any custom CUDA extension, so you would still need to install the updated PyTorch binaries as described in my previous post.

@ptrblck, thank you. I updated PyTorch binaries and it worked very well, but the output of the script still the same:

import torch
print("Using torch", torch.__version__)

Using torch 1.13.1+cu117

print(torch.version.cuda) 

11.7

gpu_avail = torch.cuda.is_available()
print(f"Is the GPU available? {gpu_avail}")

Is the GPU available? False

What do you think about it?
Best
Nazim

If PyTorch is still unable to detect and use your GPU it would point towards a driver issue and you might need to reinstall the NVIDIA driver if needed.

@ptrblck, thank you. I tried to install a lof of time GPU driver, but I don’t know what it is the best method to do it properly. Could you please give me some advices, or process to do it for NVIDIA Get Force Rtx 3060 in Ubuntu 22.0?

Thank you
Best
Nazim

@ptrblck, sorry for bothering you about this issue. I reinstall my driver for GPU (530), and my cuda (11.7), in my laptop with NVIDIA geForce RTX 3060. But my GPU is still staying unvailable. Do you have any idea of the issue?

Best
Nazim

No, I don’t know what might be causing the issue but would also recommend checking if any other application is able to use your GPU.
In the past a few users were running into issues on their laptop as they didn’t realize the laptop disabled the GPU to save power and falls back to a weak on-board video output.