Minimum CUDA compute compatibility for PyTorch 1.3

zhaopku: <p>I am using K40c GPUs with CUDA compute compatibility 3.5. I installed PyTorch via</p>
<blockquote>
<p>conda install pytorch torchvision cudatoolkit=10.1 -c pytorch</p>
</blockquote>
<p>However, when I run the following program:</p>
<pre><code class="lang-auto">import torch

print(torch.cuda.is_available())
print(torch.version.cuda)
x = torch.tensor(1.0).cuda()
y = torch.tensor(2.0).cuda()

print(x+y)
</code></pre>
<p>I have error message:</p>
<pre><code class="lang-auto">True
10.1.243
Traceback (most recent call last):
  File "example.py", line 8, in &lt;module&gt;
    print(x+y)
RuntimeError: CUDA error: no kernel image is available for execution on the device
</code></pre>
<p>I am pretty sure that GPU driver and cuda toolkit are properly installed. Output of <code>nvidia-smi</code>:</p>
<pre><code class="lang-auto">+-----------------------------------------------------------------------------+
| NVIDIA-SMI 418.74       Driver Version: 418.74       CUDA Version: 10.1     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  Tesla K40c          On   | 00000000:04:00.0 Off |                    0 |
| 23%   39C    P8    23W / 235W |      0MiB / 11441MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
</code></pre>
<p>I do not have problems when I use PyTorch 1.1 with CUDA 9.0.176. My guess is PyTorch no longer supports K40c as its CUDA compute compatibility is too low (3.5). Or are there any other problems to this? And is there a solution so that I can use PyTorch 1.3 with K40c?</p>

ptrblck: <p>CUDA10.1 should support GPUs with compute capability 3.0 to 7.5.<br>
Are you using Windows? If so, the minimal driver seems to be a bit higher than for Linux systems, i.e. <code>418.96</code>.</p>

zhaopku: <p>No, I am using Linux, and according to nvidia, the minimum driver for Linux is 418.39. And ideas of why I am having the above problem?</p>

zhaopku: <p>Please see my below comments. I don’t think I am using a too low version of gpu driver.</p>

ptrblck: <p>Yes, that’s why I asked about Windows. <img src="https://discuss.pytorch.org/images/emoji/apple/wink.png?v=9" title=":wink:" class="emoji" alt=":wink:"><br>
The driver should be new enough for Linux.</p>
<p>It seems the minimal compute capability is now 3.7 based on <a href="https://github.com/pytorch/builder/commit/2aac90bd723dfbb3dc7728152bf0e6877ec4da16#diff-65bdb50b3eee4c380f3b65973141e454" rel="nofollow noopener">this commit</a> for the binaries, so you might need to build from source.</p>

ntomita: <p><a class="mention" href="/u/ptrblck">@ptrblck</a> Why the stable 1.3 is also affected by this change? I observed exactly the same issue <a class="mention" href="/u/zhaopku">@zhaopku</a> mentioned on my K40c gpus with PyTorch 1.3 installed via conda and drivers both 418 and 440. Shouldn’t this only affect for PyTorch 1.4+?</p>

ntomita: <p>So apparently the support was dropped at pytorch 1.3.1. I believe merging such change in minor revision is not nice or at least it should be clearly written and announced somewhere.</p>

ptrblck: <p>It might have been updated in <code>1.3.1</code> and I agree with you regarding mentioning it in the release notes.</p>

surya00060: <p>It would be great if the minimum CUDA compute compatibility is mentioned at the downloads page.</p>

Brando_Miranda: <p>Can you link the page please?</p>
<hr>
<p>related:</p>
<ul>
<li><a href="https://github.com/pytorch/pytorch/issues/31285" rel="nofollow noopener">https://github.com/pytorch/pytorch/issues/31285</a></li>
<li><a href="https://discuss.pytorch.org/t/minimum-cuda-compute-compatibility-for-pytorch-1-3/60794/10" class="inline-onebox">Minimum CUDA compute compatibility for PyTorch 1.3</a></li>
</ul>

jondo: <p>This would have helped here (but is still open):</p><aside class="onebox githubissue" data-onebox-src="https://github.com/pytorch/pytorch/issues/36066">
  <header class="source">

      <a href="https://github.com/pytorch/pytorch/issues/36066" target="_blank" rel="noopener nofollow ugc">github.com/pytorch/pytorch</a>
  </header>

  <article class="onebox-body">
    <div class="github-row">
  <div class="github-icon-container" title="Issue">
	  <svg width="60" height="60" class="github-icon" viewbox="0 0 14 16" aria-hidden="true"><path d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg>
  </div>

  <div class="github-info-container">
    <h4>
      <a href="https://github.com/pytorch/pytorch/issues/36066" target="_blank" rel="noopener nofollow ugc">Add Specific Warning/Error For Unsupported GPU or Systems</a>
    </h4>

    <div class="github-info">
      <div class="date">
        opened <span class="discourse-local-date" data-format="ll" data-date="2020-04-06" data-time="14:48:56" data-timezone="UTC">02:48PM - 06 Apr 20 UTC</span>
      </div>


      <div class="user">
        <a href="https://github.com/legoritma" target="_blank" rel="noopener nofollow ugc">
          <img alt="legoritma" src="https://avatars.githubusercontent.com/u/1074812?v=4" class="onebox-avatar-inline" width="20" height="20">
          legoritma
        </a>
      </div>
    </div>

    <div class="labels">
        <span style="display:inline-block;margin-top:2px;background-color: #B8B8B8;padding: 2px;border-radius: 4px;color: #fff;margin-left: 3px;">
          module: cuda
        </span>
        <span style="display:inline-block;margin-top:2px;background-color: #B8B8B8;padding: 2px;border-radius: 4px;color: #fff;margin-left: 3px;">
          triaged
        </span>
        <span style="display:inline-block;margin-top:2px;background-color: #B8B8B8;padding: 2px;border-radius: 4px;color: #fff;margin-left: 3px;">
          enhancement
        </span>
    </div>
  </div>
</div>

  <div class="github-row">
    <p class="github-body-container">## 🚀 Feature
Add specific Warning/Error message for unsupported GPU or Systems <span class="show-more-container"><a href="" rel="noopener" class="show-more">…</a></span><span class="excerpt hidden">

## Motivation

Currently prebuilt binaries only support specific cuda versions and systems. When an unsupported device install pytorch and try to use cuda, it gets generic error "RuntimeError: CUDA error: no kernel image is available for execution on the device" This error is very confusing for beginners and easy to miss original reason.

## Pitch

Instead of getting generic error. More specific error would be nice. Briefly explaining current binary is not supports GPU or system. Maybe it can also include some FAQ link for further details or solutions

## Alternatives


## Additional context

Original bug report [#31285](https://github.com/pytorch/pytorch/issues/31285)


cc @ngimel</span></p>
  </div>

  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>