[Question] no kernel image available

payrim: <p>hello<br>
i have issue with using cuda on pytorch and i get the following error:</p>
<blockquote>
<p>print(torch.randn(1).cuda()) / print(torch.rand(5, 3, device=torch.device(‘cuda’)))</p>
</blockquote>
<blockquote>
<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.<br>
Compile with <code>TORCH_USE_CUDA_DSA</code> to enable device-side assertions.</p>
</blockquote>
<ul>
<li>installed packages:</li>
</ul>
<blockquote>
<p>python-cuda-12.1.0-2 (*i wondered the issue might be this but i did downgrade cuda to 12.1 as well)<br>
python-pytorch-cuda-2.1.0-1<br>
torchvision-cuda-0.15.2-1</p>
</blockquote>
<p>*this build does work on another user’s GPU</p>
<ul>
<li>logs:</li>
</ul>
<blockquote>
<p>torch.cuda.is_available()<br>
True<br>
print(torch.cuda.get_arch_list())<br>
[‘sm_52’, ‘sm_53’, ‘sm_60’, ‘sm_61’, ‘sm_62’, ‘sm_70’, ‘sm_72’, ‘sm_75’, ‘sm_80’, ‘sm_86’, ‘sm_89’, ‘sm_90’, ‘compute_90’]</p>
</blockquote>
<ul>
<li>specifications:</li>
</ul>
<blockquote>
<p>NVIDIA-SMI 545.29.02<br>
Driver Version: 545.29.02<br>
CUDA Version: 12.3<br>
Linux version: 6.6.1-arch1-1, not using conda<br>
GPU: Nvidia GTX960M, maxwell architecture (sm_50 OR sm_52 OR sm_53, but i think the 900 series are sm_52 <a href="https://arnon.dk/matching-sm-architectures-arch-and-gencode-for-various-nvidia-cards/#maxwell-cards-cuda-6-until-cuda-11" rel="noopener nofollow ugc">according to here</a>)</p>
</blockquote>
<p>~ attempts</p>
<p>i downgraded cuda to 12.1 but as issued here*1, seems like cuda 12.3 is compatible and the python-cuda compatibility didn’t change anything.</p>
<p>*1 https:// discuss.pytorch .org /t/question-i-have-a-question-about-installing-pytorch/191829/6</p>
<p>i wanted to build from source but it got a bit confusing on whether i should add arguments and if so, what arguments.</p>
<p>i tried installing via pip but i kept getting cache error or something. may be able to use wget and install locally.</p>
<p>though i have no issue when running on device=torch.device(‘cpu’)</p>

ptrblck: <aside class="quote no-group" data-username="payrim" data-post="1" data-topic="192138">
<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/payrim/48/65593_2.png" class="avatar"> payrim:</div>
<blockquote>
<p>i downgraded cuda to 12.1 but as issued here*1, seems like cuda 12.3 is compatible and the python-cuda compatibility didn’t change anything.</p>
<p>*1 https:// discuss.pytorch .org /t/question-i-have-a-question-about-installing-pytorch/191829/6</p>
</blockquote>
</aside>
<p>Your locally installed CUDA toolkit won’t be used if you install PyTorch binaries, since they ship with their own CUDA runtime dependencies as also explained in the linked post. You would only need a properly installed NVIDIA driver.<br>
If your GPU is too old, try installing the PyTorch binaries shipping with CUDA 11.8 as they support down to sm_37.</p>