Windows 11 with Nvidia RTX 4090

roberto_bruzzese: <p>Hi!<br>
Can you please tell me how to use a 4090 RTX GPU for deep learning on Windows 11?<br>
Should I install jupyter notebook ? Or something else in order to run a pythorch code ?<br>
Thank you<br>
Bye</p>

ptrblck: <p>You can install the pip wheels or conda binaries from <a href="https://pytorch.org/get-started/locally/">here</a> and could use any IDE or notebooks as you wish. Jupyter notebooks are not a requirement to use PyTorch.</p>

roberto_bruzzese: <p>I followed those instructions and , since I choose Pythorch Build → Stable, OS → windows, Package → Pip, language → Python , Compute Platform → 11.7 then I run the command → pip3 install torch torchvision torchaudio --extra-index-url <a href="https://download.pytorch.org/whl/cu117" rel="noopener nofollow ugc">https://download.pytorch.org/whl/cu117</a> .<br>
Here it says that Pytorch is not supported for windows 11 .<br>
Anyway I entered python command and typed the commands : ```<br>
import torch<br>
torch.cuda.is_available()</p>
<p>but the answer is FALSE.<br>
Why ? Can you please help me to solve this issue ?<br>
Thank<br>
Bye</p>

ptrblck: <p>I don’t know if Windows 11 is supported and based in the prerequisites:</p>
<pre><code class="lang-auto">Prerequisites
Supported Windows Distributions

PyTorch is supported on the following Windows distributions:

    Windows 7 and greater; Windows 10 or greater recommended.
    Windows Server 2008 r2 and greater
</code></pre>
<p>I would assume it should be supported (I’m not using Windows 11, so cannot test it).</p>
<p>Could you check what the install log showed and what <code>python -m torch.utils.collect_env</code> returns?</p>

roberto_bruzzese: <p>Here is the result of the command you suggested</p>
<p>PyTorch version: 1.13.1+cpu<br>
Is debug build: False<br>
CUDA used to build PyTorch: Could not collect<br>
ROCM used to build PyTorch: N/A</p>
<p>OS: Microsoft Windows 11 Pro<br>
GCC version: Could not collect<br>
Clang version: Could not collect<br>
CMake version: Could not collect<br>
Libc version: N/A</p>
<p>Python version: 3.10.9 (tags/v3.10.9:1dd9be6, Dec  6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)] (64-bit runtime)<br>
Python platform: Windows-10-10.0.22000-SP0<br>
Is CUDA available: False<br>
CUDA runtime version: 12.0.76<br>
CUDA_MODULE_LOADING set to: N/A<br>
GPU models and configuration: GPU 0: NVIDIA GeForce RTX 4090<br>
Nvidia driver version: 528.02<br>
cuDNN version: Could not collect<br>
HIP runtime version: N/A<br>
MIOpen runtime version: N/A<br>
Is XNNPACK available: True</p>
<p>Versions of relevant libraries:<br>
[pip3] numpy==1.24.1<br>
[pip3] torch==1.13.1<br>
[pip3] torch-summary==1.4.5<br>
[pip3] torchaudio==0.13.1+cu117<br>
[pip3] torchvision==0.14.1<br>
[conda] Could not collect</p>

ptrblck: <p>Thanks for the output.<br>
It seems you are installing the CPU-only binary for PyTorch and <code>torchvision</code> while <code>torchaudio</code> uses the binary with the CUDA 11.7 runtime.<br>
Did you see any warnings during the installation where <code>pip</code> was complaining that it couldn’t find the desired package?</p>

roberto_bruzzese: <p>It seem no warning. If it is interesting for you, when I give the command echo $CUDA_PATH the answer is blank is empty. Can this be an error?</p>

ptrblck: <p>No, this should not be related since the binaries ship with their own CUDA runtime.<br>
Your local CUDA toolkit will only be used if you build PyTorch from source or any custom CUDA extension.<br>
The issue is caused by:</p>
<pre><code class="lang-auto">PyTorch version: 1.13.1+cpu
</code></pre>
<p>which shows that the CPU-only version was installed instead of the desired one with <code>+cu117</code>.</p>

roberto_bruzzese: <p>If I do this command from the prompt :–&gt;<br>
pip install torch -f <a href="https://download.pytorch.org/whl/torch_stable.html" rel="noopener nofollow ugc">https://download.pytorch.org/whl/torch_stable.html</a></p>
<p>It starts the following command :–&gt;</p>
<p>Downloading <a href="https://download.pytorch.org/whl/cu117/torch-1.13.1%2Bcu117-cp310-cp310-win_amd64.whl" rel="noopener nofollow ugc">https://download.pytorch.org/whl/cu117/torch-1.13.1%2Bcu117-cp310-cp310-win_amd64.whl</a> (2255.4 MB)</p>
<p>But I supppose that it is not correct . Right?</p>

ptrblck: <p>I’m unsure where you got this command from as the <a href="https://pytorch.org/get-started/locally/">install instructions</a> shows:</p>
<pre><code class="lang-auto">pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu117
</code></pre>
<p>for Windows.<br>
In any case, the wheel name looks correct as it contains the <code>cu117</code> tag in it.<br>
Could you check if you have multiple PyTorch versions installed and uninstall every other before downloading the new one?<br>
Alternatively, create a new virtual environment and install PyTorch there.</p>

roberto_bruzzese: <p>How to check multiple pytorch environments? OK. I found the command (pip3 show torch). And nothing was installed.</p>

roberto_bruzzese: <p>I have given the command you given me and now torch is installed (version 11.1.0).<br>
Is it right?<br>
I think no.<br>
In fact if I give the command</p>
<p>python -m torch.utils.collect_env</p>
<p>it answers that pytorch PyTorch version: 1.11.0+cpu</p>
<p>Why ?</p>
<p>And also I noticed that CUDA runtime version: 12.0.76.</p>
<p>Is this compatible with my pytorch ?</p>
<p>SOLVED by installing CUDA 17 and pytorch 1.13</p>