GPU compute capability support for each pytorch version

username: JamesOwers
cooked: <p>I’m looking for the minimal <a href="https://developer.nvidia.com/cuda-gpus#compute" rel="nofollow noopener">compute capability</a> which each pytorch version supports.</p>
<p>This question has arisen from when I raised <a href="https://github.com/pytorch/pytorch/issues/30532" rel="nofollow noopener">this issue</a> and was told my GPU was no longer supported. All I know so far is that my gpu has a compute capability of 3.5, and pytorch 1.3.1 does not support that (i.e. include the relevant binaries with the install), but pytorch 1.2 does.</p>
<p>Any pointers to existing documentation well received. Have searched for “compute capability” to no avial.</p>

username: KFrank
cooked: <p>Hi James!</p>
<aside class="quote no-group" data-username="JamesOwers" data-post="1" data-topic="62434" data-full="true">
<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/jamesowers/48/11356_2.png" class="avatar"> JamesOwers:</div>
<blockquote>
<p>I’m looking for the minimal <a href="https://developer.nvidia.com/cuda-gpus#compute" rel="noopener nofollow ugc">compute capability</a> which each pytorch version supports.</p>
</blockquote>
</aside>
<p>Speaking from memory …</p>
<p>I went through a similar issue.  Based on what I was told, my<br>
understanding is:</p>
<p>There is no table or clean record of which versions of pytorch<br>
support which compute capabilities.  Even if a version of pytorch<br>
uses a “cuda version” that supports a certain compute capability,<br>
that pytorch might not support that compute capability.</p>
<p>The installation packages (wheels, etc.) don’t have the supported<br>
compute capabilities encoded in there file names.</p>
<p>Pytorch has a supported-compute-capability check explicit in its<br>
code.  (I’m not sure where.)  If you can figure out what version<br>
of the source a given installation package was built from you<br>
can check the code.</p>
<p>Short of that, I think you have to run pytorch and see whether<br>
it likes your gpu.  (I’m not aware of a way to query pytorch for<br>
its supported compute capability without running it against<br>
the gpu of interest, but there might be one.)</p>
<p>Best.</p>
<p>K. Frank</p>

username: tom
cooked: <p>If you have the whl’s, you can inspect the libtorch.so (or other so’s) in the torch/lib directory: <code>cuobjdump build/lib.linux-x86_64-3.7/torch/lib/libtorch.so  | grep arch | sort | uniq</code>.</p>
<p>Best regards</p>
<p>Thomas</p>

username: stas
cooked: <p>This no longer works (or perhaps the object is stripped), <a class="mention" href="/u/tom">@tom</a> shared the latest approach on slack and it’s:</p>
<pre><code class="lang-auto">$ python -c "import torch; print(torch.cuda.get_arch_list())" 
['sm_37', 'sm_50', 'sm_60', 'sm_70', 'sm_75', 'sm_80']
</code></pre>
<p>Thank you, <a class="mention" href="/u/tom">@tom</a>.</p>

username: Farid_Alijani
cooked: <pre><code class="lang-auto">$ python -c "import torch; print(torch.cuda.get_arch_list())"
</code></pre>
<p>Returns this error:</p>
<pre><code class="lang-auto">Traceback (most recent call last):
  File "&lt;string&gt;", line 1, in &lt;module&gt;
AttributeError: module 'torch.cuda' has no attribute 'get_arch_list'
</code></pre>
<p>Env:</p>
<pre><code class="lang-auto">Python 3.7.9 (default, Aug 31 2020, 12:42:55) 
[GCC 7.3.0] :: Anaconda, Inc. on linux

torch: 1.4.0     torchvision: 0.5.0

Cuda compilation tools, release 11.2, V11.2.142
Build cuda_11.2.r11.2/compiler.29558016_0
</code></pre>

username: ptrblck
cooked: <p>Your PyTorch version is too old and you would need to update it or use <a class="mention" href="/u/tom">@tom</a>’s suggestion using <code>cuobjdump</code>.</p>

username: moi90
cooked: <p>I extracted the compute capabilities for which each pytorch package on conda is compiled:</p>
<div class="md-table">
<table>
<thead>
<tr>
<th>package</th>
<th>architectures</th>
</tr>
</thead>
<tbody>
<tr>
<td>pytorch-1.0.0-py3.7_cuda10.0.130_cudnn7.4.1_1</td>
<td>sm_30, sm_35, sm_50, sm_60, sm_61, sm_70, sm_75</td>
</tr>
<tr>
<td>pytorch-1.0.0-py3.7_cuda8.0.61_cudnn7.1.2_1</td>
<td>sm_20, sm_35, sm_37, sm_50, sm_52, sm_53, sm_60, sm_61</td>
</tr>
<tr>
<td>pytorch-1.0.0-py3.7_cuda9.0.176_cudnn7.4.1_1</td>
<td>sm_35, sm_37, sm_50, sm_52, sm_53, sm_60, sm_61, sm_70</td>
</tr>
<tr>
<td>pytorch-1.0.1-py3.7_cuda10.0.130_cudnn7.4.2_0</td>
<td>sm_35, sm_50, sm_60, sm_61, sm_70, sm_75</td>
</tr>
<tr>
<td>pytorch-1.0.1-py3.7_cuda10.0.130_cudnn7.4.2_2</td>
<td>sm_35, sm_50, sm_60, sm_61, sm_70, sm_75</td>
</tr>
<tr>
<td>pytorch-1.0.1-py3.7_cuda8.0.61_cudnn7.1.2_0</td>
<td>sm_35, sm_37, sm_50, sm_52, sm_53, sm_60, sm_61</td>
</tr>
<tr>
<td>pytorch-1.0.1-py3.7_cuda8.0.61_cudnn7.1.2_2</td>
<td>sm_35, sm_37, sm_50, sm_52, sm_53, sm_60, sm_61</td>
</tr>
<tr>
<td>pytorch-1.0.1-py3.7_cuda9.0.176_cudnn7.4.2_0</td>
<td>sm_35, sm_50, sm_60, sm_61, sm_70</td>
</tr>
<tr>
<td>pytorch-1.0.1-py3.7_cuda9.0.176_cudnn7.4.2_2</td>
<td>sm_35, sm_50, sm_60, sm_70</td>
</tr>
<tr>
<td>pytorch-1.1.0-py3.7_cuda10.0.130_cudnn7.5.1_0</td>
<td>sm_35, sm_50, sm_60, sm_61, sm_70, sm_75</td>
</tr>
<tr>
<td>pytorch-1.1.0-py3.7_cuda9.0.176_cudnn7.5.1_0</td>
<td>sm_35, sm_50, sm_60, sm_61, sm_70</td>
</tr>
<tr>
<td>pytorch-1.2.0+cu92-py3.7_cuda9.2.148_cudnn7.6.2_0</td>
<td>sm_35, sm_50, sm_60, sm_61, sm_70</td>
</tr>
<tr>
<td>pytorch-1.2.0-py3.7_cuda10.0.130_cudnn7.6.2_0</td>
<td>sm_35, sm_50, sm_60, sm_61, sm_70, sm_75</td>
</tr>
<tr>
<td>pytorch-1.2.0-py3.7_cuda9.2.148_cudnn7.6.2_0</td>
<td>sm_35, sm_50, sm_60, sm_61, sm_70</td>
</tr>
<tr>
<td>pytorch-1.3.0-py3.7_cuda10.0.130_cudnn7.6.3_0</td>
<td>sm_30, sm_35, sm_50, sm_60, sm_61, sm_70, sm_75</td>
</tr>
<tr>
<td>pytorch-1.3.0-py3.7_cuda10.1.243_cudnn7.6.3_0</td>
<td>sm_30, sm_35, sm_50, sm_60, sm_61, sm_70, sm_75</td>
</tr>
<tr>
<td>pytorch-1.3.0-py3.7_cuda9.2.148_cudnn7.6.3_0</td>
<td>sm_35, sm_50, sm_60, sm_61, sm_70</td>
</tr>
<tr>
<td>pytorch-1.3.1-py3.7_cuda10.0.130_cudnn7.6.3_0</td>
<td>sm_35, sm_37, sm_50, sm_60, sm_61, sm_70, sm_75</td>
</tr>
<tr>
<td>pytorch-1.3.1-py3.7_cuda10.1.243_cudnn7.6.3_0</td>
<td>sm_35, sm_37, sm_50, sm_60, sm_61, sm_70, sm_75</td>
</tr>
<tr>
<td>pytorch-1.3.1-py3.7_cuda9.2.148_cudnn7.6.3_0</td>
<td>sm_35, sm_37, sm_50, sm_60, sm_61, sm_70</td>
</tr>
<tr>
<td>pytorch-1.4.0-py3.7_cuda10.0.130_cudnn7.6.3_0</td>
<td>sm_35, sm_37, sm_50, sm_60, sm_61, sm_70, sm_75</td>
</tr>
<tr>
<td>pytorch-1.4.0-py3.7_cuda10.1.243_cudnn7.6.3_0</td>
<td>sm_35, sm_37, sm_50, sm_60, sm_61, sm_70, sm_75</td>
</tr>
<tr>
<td>pytorch-1.4.0-py3.7_cuda9.2.148_cudnn7.6.3_0</td>
<td>sm_35, sm_37, sm_50, sm_60, sm_61, sm_70</td>
</tr>
<tr>
<td>pytorch-1.5.0-py3.7_cuda10.1.243_cudnn7.6.3_0</td>
<td>sm_35, sm_37, sm_50, sm_60, sm_61, sm_70, sm_75</td>
</tr>
<tr>
<td>pytorch-1.5.0-py3.7_cuda10.2.89_cudnn7.6.5_0</td>
<td>sm_35, sm_37, sm_50, sm_60, sm_61, sm_70, sm_75</td>
</tr>
<tr>
<td>pytorch-1.5.0-py3.7_cuda9.2.148_cudnn7.6.3_0</td>
<td>sm_35, sm_37, sm_50, sm_60, sm_61, sm_70</td>
</tr>
<tr>
<td>pytorch-1.5.1-py3.7_cuda10.1.243_cudnn7.6.3_0</td>
<td>sm_35, sm_37, sm_50, sm_60, sm_61, sm_70, sm_75</td>
</tr>
<tr>
<td>pytorch-1.5.1-py3.7_cuda10.2.89_cudnn7.6.5_0</td>
<td>sm_35, sm_37, sm_50, sm_60, sm_61, sm_70, sm_75</td>
</tr>
<tr>
<td>pytorch-1.5.1-py3.7_cuda9.2.148_cudnn7.6.3_0</td>
<td>sm_35, sm_37, sm_50, sm_60, sm_61, sm_70</td>
</tr>
<tr>
<td>pytorch-1.6.0-py3.7_cuda10.1.243_cudnn7.6.3_0</td>
<td>sm_35, sm_37, sm_50, sm_60, sm_61, sm_70, sm_75</td>
</tr>
<tr>
<td>pytorch-1.6.0-py3.7_cuda10.2.89_cudnn7.6.5_0</td>
<td>sm_35, sm_37, sm_50, sm_60, sm_61, sm_70, sm_75</td>
</tr>
<tr>
<td>pytorch-1.6.0-py3.7_cuda9.2.148_cudnn7.6.3_0</td>
<td>sm_35, sm_37, sm_50, sm_60, sm_61, sm_70</td>
</tr>
<tr>
<td>pytorch-1.7.0-py3.7_cuda10.1.243_cudnn7.6.3_0</td>
<td>sm_35, sm_37, sm_50, sm_60, sm_61, sm_70, sm_75</td>
</tr>
<tr>
<td>pytorch-1.7.0-py3.7_cuda10.2.89_cudnn7.6.5_0</td>
<td>sm_35, sm_37, sm_50, sm_60, sm_61, sm_70, sm_75</td>
</tr>
<tr>
<td>pytorch-1.7.0-py3.7_cuda11.0.221_cudnn8.0.3_0</td>
<td>sm_37, sm_50, sm_60, sm_61, sm_70, sm_75, sm_80</td>
</tr>
<tr>
<td>pytorch-1.7.0-py3.7_cuda9.2.148_cudnn7.6.3_0</td>
<td>sm_35, sm_37, sm_50, sm_60, sm_61, sm_70</td>
</tr>
<tr>
<td>pytorch-1.7.1-py3.7_cuda10.1.243_cudnn7.6.3_0</td>
<td>sm_35, sm_37, sm_50, sm_60, sm_61, sm_70, sm_75</td>
</tr>
<tr>
<td>pytorch-1.7.1-py3.7_cuda10.2.89_cudnn7.6.5_0</td>
<td>sm_35, sm_37, sm_50, sm_60, sm_61, sm_70, sm_75</td>
</tr>
<tr>
<td>pytorch-1.7.1-py3.7_cuda11.0.221_cudnn8.0.5_0</td>
<td>sm_35, sm_37, sm_50, sm_60, sm_61, sm_70, sm_75, sm_80</td>
</tr>
<tr>
<td>pytorch-1.7.1-py3.7_cuda9.2.148_cudnn7.6.3_0</td>
<td>sm_37, sm_50, sm_60, sm_61, sm_70</td>
</tr>
<tr>
<td>pytorch-1.8.0-py3.7_cuda10.1_cudnn7.6.3_0</td>
<td>sm_35, sm_37, sm_50, sm_60, sm_61, sm_70, sm_75</td>
</tr>
<tr>
<td>pytorch-1.8.0-py3.7_cuda10.2_cudnn7.6.5_0</td>
<td>sm_35, sm_37, sm_50, sm_60, sm_61, sm_70, sm_75</td>
</tr>
<tr>
<td>pytorch-1.8.0-py3.7_cuda11.1_cudnn8.0.5_0</td>
<td>sm_35, sm_37, sm_50, sm_60, sm_61, sm_70, sm_75, sm_80, sm_86</td>
</tr>
<tr>
<td>pytorch-1.8.1-py3.7_cuda10.1_cudnn7.6.3_0</td>
<td>sm_35, sm_37, sm_50, sm_60, sm_61, sm_70, sm_75</td>
</tr>
<tr>
<td>pytorch-1.8.1-py3.7_cuda10.2_cudnn7.6.5_0</td>
<td>sm_35, sm_37, sm_50, sm_60, sm_61, sm_70, sm_75</td>
</tr>
<tr>
<td>pytorch-1.8.1-py3.7_cuda11.1_cudnn8.0.5_0</td>
<td>sm_35, sm_37, sm_50, sm_60, sm_61, sm_70, sm_75, sm_80, sm_86</td>
</tr>
</tbody>
</table>
</div><aside class="onebox githubfolder">
  <header class="source">
      <img src="https://github.githubassets.com/favicons/favicon.svg" class="site-icon" width="32" height="32">
      <a href="https://github.com/moi90/pytorch_compute_capabilities" target="_blank" rel="noopener nofollow ugc">github.com</a>
  </header>
  <article class="onebox-body">
    <div class="aspect-image" style="--aspect-ratio:400/400;"><img src="https://avatars.githubusercontent.com/u/332746?s=400&amp;amp;v=4" class="thumbnail" width="400" height="400"></div>

<h3><a href="https://github.com/moi90/pytorch_compute_capabilities" target="_blank" rel="noopener nofollow ugc">moi90/pytorch_compute_capabilities</a></h3>


  <p><span class="label1">Contribute to moi90/pytorch_compute_capabilities development by creating an account on GitHub.</span></p>

  </article>
  <div class="onebox-metadata">
    
    
  </div>
  <div style="clear: both"></div>
</aside>


username: moi90
cooked: <p>One question though: If my card (GeForce RTX 3090) has compute capability 8.6, does that mean that PyTorch 1.8 with CUDA 11 is the first version to support it?</p>

username: ptrblck
cooked: <p>No, all <code>1.7</code> releases with CUDA11 + <code>sm_80</code> will also support it.</p>