GPU Pytorch Jupiter notebook

username: Nazim_Ben
cooked: <p>Hi Guys,<br>
I tried to use my GPU (NVIDIA Geforce Rtx 3060) but my Jupiter notebook did not recognize it.</p>
<pre><code class="lang-auto">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
</code></pre>
<p>Do you have please an idea for solving that?<br>
Thank you for your help<br>
Best<br>
Nazim</p>

username: ptrblck
cooked: <p>Your 3090 needs CUDA 11.x while you’ve installed the PyTorch binaries with CUDA 10.2.<br>
Update PyTorch to the latest stable or nightly release with CUDA 11.7 or 11.8 as described <a href="https://pytorch.org/get-started/locally/">here</a>.</p>

username: Nazim_Ben
cooked: <p><a class="mention" href="/u/ptrblck">@ptrblck</a>, thank you for your help. Strangely It could update it to my terminal:</p>
<pre><code class="lang-auto">(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

</code></pre>
<p>But when I tried to work on my jupiter, the version of cuda was 10.2.</p>
<p>I did not understand. May be do you have another solution for that?<br>
Thank you<br>
Best<br>
Nazim</p>

username: ptrblck
cooked: <p><code>nvcc --version</code> 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.<br>
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.</p>

username: Nazim_Ben
cooked: <aside class="quote no-group" data-username="ptrblck" data-post="4" data-topic="173218">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/ptrblck/48/1823_2.png" class="avatar"> ptrblck:</div>
<blockquote>
<p>you would still need to install the updated PyTorch binaries</p>
</blockquote>
</aside>
<p><a class="mention" href="/u/ptrblck">@ptrblck</a>, thank you. I updated PyTorch binaries and it worked very well, but the output of the script still the same:</p>
<pre><code class="lang-auto">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
</code></pre>
<p>What do you think about it?<br>
Best<br>
Nazim</p>

username: ptrblck
cooked: <p>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.</p>

username: Nazim_Ben
cooked: <p><a class="mention" href="/u/ptrblck">@ptrblck</a>, 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?</p>
<p>Thank you<br>
Best<br>
Nazim</p>

username: Nazim_Ben
cooked: <p><a class="mention" href="/u/ptrblck">@ptrblck</a>, 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?</p>
<p>Best<br>
Nazim</p>

username: ptrblck
cooked: <p>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.<br>
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.</p>