Distingush between cuda of system and cuda of virtual environment

tina1: <p>I should run a ready project that it has some requirement of special version of python and Pytorch so I run a virtual environment  and install  python 3.6 and pythorch with code</p>
<pre><code>conda install pytorch torchvision cudatoolkit=10.0 -c pytorch
</code></pre>
<p>I have to run this project with gpu rtx 3090 (24 gig ram)[when I run command nvidia-smi it need and compatible with cuda up to 11]<br>
on the other hand When I run that venv with special python and pytorch that is installed on it, running project can’t detect gpu.<br>
I noticed that venv can’t distinguish between the system cuda and venv cuda and it is affected by the system cuda(11). On the other hand, I cannot install Cuda above 10 for Python 3.6.<br>
How could I solve this problem?</p>

ptrblck: <aside class="quote no-group" data-username="tina1" data-post="1" data-topic="183923">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/t/bcef8e/48.png" class="avatar"> tina1:</div>
<blockquote>
<p>I noticed that venv can’t distinguish between the system cuda and venv cuda and it is affected by the system cuda(11).</p>
</blockquote>
</aside>
<p>Could you explain this in more details, please?<br>
The PyTorch binaries ship with their own CUDA dependencies and will only need a properly installed NVIDIA driver. Your system CUDA toolkit will be used if you build PyTorch from source or a custom CUDA extension.</p>
<aside class="quote no-group" data-username="tina1" data-post="1" data-topic="183923">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/t/bcef8e/48.png" class="avatar"> tina1:</div>
<blockquote>
<p>On the other hand, I cannot install Cuda above 10 for Python 3.6.</p>
</blockquote>
</aside>
<p>I also don’t understand this claim as the CUDA toolkit doesn’t depend on Python.</p>

tina1: <p>Hi again, Thanks for your reply. Actually, if I want to explain in more details, I have an ubuntu system with GPU rtx3090 and after installing different dependable driver, that minimum driver that could be installed, it was 11 version and driver with version 10 couldn’t be installed so Cuda of my system became 11.<br>
On the other hand, author of one project mentioned if I want to run his project, I should install python 3.6 and  pytorch with command.<br>
<code>conda install pytorch torchvision cudatoolkit=10.0 -c pytorch</code><br>
I did both of them and both of them installed successfully in one virtual environment(venv) but when I run following code,</p>
<pre><code class="lang-auto">torch.cuda.is_available()
</code></pre>
<p>it returned <code>false</code> and while running project that project couldn’t detect and use GPU.<br>
It worth mention I try to install upper version of  Pytorch for this version of python in this VENV but I couldn’t install.<br>
This project for running, needs GPU very much and I don’t know how can solve this problem.</p>

ptrblck: <p>As already mentioned, the PyTorch binaries ship with their own CUDA dependencies and for your 3090 you would need to install any PyTorch binary with CUDA 11.x or 12.x from <a href="https://pytorch.org/get-started/locally/">here</a>. Note that the currently released binaries also don’t ship with CUDA 10.2 anymore so you can install any new release.</p>

tina1: <p>I use this website and try all of version of Pytorch but for python 3.6 I couldn’t install any version of pytorch with cuda 11.x or 12.x and when I want to install it give me errors.</p>

ptrblck: <p>This is expected since Python 3.6 is at its EOL since Dec 2021 as described <a href="https://discuss.pytorch.org/t/cuda-and-torch-installation-in-python-venv/183952/4">here</a> which is why we are not building our binaries for it anymore.</p>