Pytorch 1.12.1 doesn't detect CUDA 10.2 on GTX 960M

carlo_gemelli: <p>Hi! I’m on Windows 10, and I’m trying to use Pytorch to do the inference of an object detection model from a ZED2 camera live feed.</p>
<p>Since my dedicated GPU is an Nvidia GTX 960M, to use the ZED sdk I must have CUDA 10.2 (<a href="https://www.stereolabs.com/developers/release/" rel="noopener nofollow ugc">from their documentation</a>)</p>
<p>Then I looked into the <a href="https://pytorch.org/get-started/previous-versions/#wheel" rel="noopener nofollow ugc">Pytorch documentation</a> and pip installed the 1.12.1 version, since it appears to be the one compatible with CUDA 10.2 .</p>
<p>The problem is that when I run the following python code I get these outputs:</p>
<pre><code class="lang-auto">&gt;&gt;&gt;print(torch.rand(3, 5))
tensor([[0.4762, 0.6145, 0.5041, 0.3896, 0.4517],
        [0.5318, 0.8051, 0.6773, 0.7620, 0.4723],
        [0.7000, 0.3737, 0.6725, 0.4347, 0.7750]])
&gt;&gt;&gt;print(torch.cuda.is_available())
False
&gt;&gt;&gt;print(torch.version.cuda)
None
&gt;&gt;&gt;print(torch.cuda.device_count())
0
&gt;&gt;&gt;print(torch.backends.cudnn.enabled )
True
</code></pre>
<p>So, to my understading, Pytorch is correctly instaled but it can’t detect CUDA, and i can’t find how to slve this. Any help? I attach below some outputs from cmd that could help, thanks to anyone who will take a look</p>
<pre><code class="lang-auto">&gt;&gt;&gt;pip show torch
Name: torch
Version: 1.12.1
Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration
Home-page: https://pytorch.org/
Author: PyTorch Team
Author-email: packages@pytorch.org
License: BSD-3
Location: c:\users\gemel\appdata\local\programs\python\python38\lib\site-packages
Requires: typing-extensions
Required-by: torchvision, torchaudio, thop

&gt;&gt;&gt;nvidia-smi
Fri Mar 10 18:54:04 2023
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 528.33       Driver Version: 528.33       CUDA Version: 12.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name            TCC/WDDM | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ... WDDM  | 00000000:01:00.0  On |                  N/A |
| N/A    0C    P5    N/A /  N/A |    123MiB /  4096MiB |     32%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A     11004    C+G   C:\Windows\System32\dwm.exe     N/A      |
|    0   N/A  N/A     17984    C+G   ...are Update\DellUpTray.exe    N/A      |
+-----------------------------------------------------------------------------+
</code></pre>
<pre><code class="lang-auto">&gt;&gt;&gt;nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Wed_Oct_23_19:32:27_Pacific_Daylight_Time_2019
Cuda compilation tools, release 10.2, V10.2.89
</code></pre>

ptrblck: <aside class="quote no-group" data-username="carlo_gemelli" data-post="1" data-topic="174530">
<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/carlo_gemelli/48/58207_2.png" class="avatar"> carlo_gemelli:</div>
<blockquote>
<p>So, to my understading, Pytorch is correctly instaled but it can’t detect CUDA</p>
</blockquote>
</aside>
<p>No, that’s not the case as your PyTorch binary doesn’t seem to ship with a CUDA runtime:</p>
<aside class="quote no-group" data-username="carlo_gemelli" data-post="1" data-topic="174530">
<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/carlo_gemelli/48/58207_2.png" class="avatar"> carlo_gemelli:</div>
<blockquote>
<pre><code class="lang-auto">&gt;&gt;&gt;print(torch.version.cuda)
None
</code></pre>
</blockquote>
</aside>
<p>Try to create a new virtual environment, install the desired pip wheels or conda binaries, and make sure the install log shows the wanted CUDA runtime.</p>