How to determine the highest pytorch-cuda version that my VM supports

pylearn: <p>I am using miniconda on a virtual machine. I installed pytorch with cuda=11.8. It works fine. Recently, I found out the cuda version on my VM is only 11.6.</p>
<p>Running <code>nvidia-smi</code> in terminal returns a table containg <code>NVIDIA-SMI 510.73.08    Driver Version: 510.73.08    CUDA Version: 11.6</code>.</p>
<p>Since the pytorch I installed is working fine. I guess the pytorch cuda is independent of the cuda on my VM referred by <code>nvidia-smi</code>. <strong>Please correct me if this is wrong and I should lower my pytorch cuda version.</strong></p>
<p>In general, <strong>how to determine the highest pytorch-cuda version that my VM support?</strong> Is it determined by the driver version in the table returned by <code>nvidia-smi</code>?</p>
<p>From <a href="https://docs.nvidia.com/deploy/cuda-compatibility/" rel="noopener nofollow ugc">CUDA compatibility</a>, CUDA 12.x needs driver version &gt;=525.60.13. So in my case, I cannot install the preview version of pytorch, pytorch-cuda=12.1?</p>

ptrblck: <aside class="quote no-group" data-username="pylearn" data-post="1" data-topic="188450">
<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/pylearn/48/54463_2.png" class="avatar"> pylearn:</div>
<blockquote>
<p>Since the pytorch I installed is working fine. I guess the pytorch cuda is independent of the cuda on my VM referred by <code>nvidia-smi</code>. <strong>Please correct me if this is wrong and I should lower my pytorch cuda version.</strong></p>
</blockquote>
</aside>
<p>That’s correct since PyTorch binaries ship with their own CUDA dependencies and only need a properly installed NVIDIA driver to run workloads on your GPU.</p>
<aside class="quote no-group" data-username="pylearn" data-post="1" data-topic="188450">
<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/pylearn/48/54463_2.png" class="avatar"> pylearn:</div>
<blockquote>
<p>In general, <strong>how to determine the highest pytorch-cuda version that my VM support?</strong> Is it determined by the driver version in the table returned by <code>nvidia-smi</code>?</p>
</blockquote>
</aside>
<p>Yes, you would need to install the right driver, but also note that CUDA supports <em>minor</em> version compatibility, allowing you to stick to the same driver for a CUDA major release.<br>
E.g. you could have used 470.xx for all PyTorch binaries shipping with any CUDA 11.x version without updating the driver, and you could use e.g. 525.xx for all PyTorch binaries shipping with any CUDA 12.x or older CUDA toolkit without updating the driver.<br>
Note however, that you must update the NVIDIA driver when jumping from CUDA 11 to CUDA 12 as this is a major version update.</p>
<aside class="quote no-group" data-username="pylearn" data-post="1" data-topic="188450">
<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/pylearn/48/54463_2.png" class="avatar"> pylearn:</div>
<blockquote>
<p>CUDA 12.x needs driver version &gt;=525.60.13. So in my case, I cannot install the preview version of pytorch, pytorch-cuda=12.1?</p>
</blockquote>
</aside>
<p>Yes, this should be the case unless you are using datacenter GPUs and apply forward compatibility.</p>