PyTorch and Cuda strange behaviour

David_Mkrtchyan: <p>Hi. I’m using Cuda 11.1 installed from here</p><aside class="onebox allowlistedgeneric" data-onebox-src="https://developer.nvidia.com/cuda-11.1.0-download-archive?target_os=Linux&amp;target_arch=x86_64&amp;target_distro=Ubuntu&amp;target_version=2004&amp;target_type=deblocal">
  <header class="source">
      <img src="https://developer.nvidia.com/sites/all/themes/devzone_base/favicon.ico" class="site-icon" width="48" height="48">

      <a href="https://developer.nvidia.com/cuda-11.1.0-download-archive?target_os=Linux&amp;target_arch=x86_64&amp;target_distro=Ubuntu&amp;target_version=2004&amp;target_type=deblocal" target="_blank" rel="noopener nofollow ugc" title="08:14PM - 27 October 2020">NVIDIA Developer – 27 Oct 20</a>
  </header>

  <article class="onebox-body">
    

<h3><a href="https://developer.nvidia.com/cuda-11.1.0-download-archive?target_os=Linux&amp;target_arch=x86_64&amp;target_distro=Ubuntu&amp;target_version=2004&amp;target_type=deblocal" target="_blank" rel="noopener nofollow ugc">CUDA Toolkit 11.1.0</a></h3>

  <p>Please Note: Due to an incompatibility issue, we advise users to defer updating to Linux Kernel 5.9+ until mid-November when an NVIDIA Linux GPU driver update with Kernel 5.9+ support is expected to be available. Select Target Platform Click on the...</p>


  </article>

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

  <div style="clear: both"></div>
</aside>
<p>
Then installed PyTorch from here</p><aside class="onebox allowlistedgeneric" data-onebox-src="https://pytorch.org/">
  <header class="source">
      <img src="https://pytorch.org/favicon.ico?" class="site-icon" width="32" height="32">

      <a href="https://pytorch.org/" target="_blank" rel="noopener nofollow ugc">pytorch.org</a>
  </header>

  <article class="onebox-body">
    <img src="https://pytorch.org/assets/images/pytorch-logo.png" class="thumbnail onebox-avatar" width="500" height="500">

<h3><a href="https://pytorch.org/" target="_blank" rel="noopener nofollow ugc">PyTorch</a></h3>

  <p>An open source machine learning framework that accelerates the path from research prototyping to production deployment.</p>


  </article>

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

  <div style="clear: both"></div>
</aside>
<p>
PyTorch Build: Stable (1.9.0)<br>
Your OS: Linux<br>
Language: Python<br>
Compute Platform: CUDA 11.1</p>
<p>Then I ran generated command</p>
<p>My Python version is 3.9<br>
My gpu is NVIDIA GeForce RTX 3070 Ti</p>
<p>So on running the python script (ipynb) I’m getting error</p>
<p>RuntimeError: CUDA error: no kernel image is available for execution on the device<br>
CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect.<br>
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.</p>
<p>Can someone help me please?</p>

gphilip: <p>Did you reboot after installing CUDA?</p>

ptrblck: <p>Besides <a class="mention" href="/u/gphilip">@gphilip</a>’s advice, did you verify that the PyTorch pip wheel or conda binary with CUDA11.1 was installed? Your 3070 has a compute capability of 8.6 and thus needs CUDA&gt;=11 and will fail with the posted error message in CUDA&lt;=10.</p>