Running older code, but newer CUDA version

Arthur_Wolf: <p>I’m trying to get this project running: <a href="https://github.com/hanish3464/WORD-pytorch" class="inline-onebox" rel="noopener nofollow ugc">GitHub - hanish3464/WORD-pytorch: Webtoon Object Recognition and Detection(WORD)</a></p>
<p>It has these requirements:</p>
<blockquote>
<p>torch==1.0.0<br>
torchvision==0.2.1</p>
</blockquote>
<p>Which if I understand correctly is quite old. But I don’t know torch/python well enough to upgrade the code of the project to the latest versions. So I’m stuck with trying to get them to work.</p>
<p>I initially was able to get this to work by running things on the CPU, with a few lines of codes changed.</p>
<p>But recently I installed (upgraded?) the latest CUDA version (12-3). And even though I’m using the CPU, it just stopped working.</p>
<p>So I switched to trying to get it to work on the GPU. And that doesn’t work either, apparently because my CUDA version is much more recent than torch 1.0.0.</p>
<p>I get this error (even trying to run on the CPU):</p>
<blockquote>
<p>╰─⠠⠵ python3 demo.py --cls 0.90 --type white --demo_folder /ram/panel-detect/bwzjgrproyg//data/  --cpu                 on master|✚42<br>
Loading weights from checkpoint : (./weights/Speech-Bubble-Detector.pth)<br>
Loading weights from checkpoint : (./weights/Line-Text-Detector.pth)<br>
TEST IMAGE (1/1): INPUT PATH:[/ram/panel-detect/bwzjgrproyg//data/page.jpg]<br>
THCudaCheck FAIL file=/pytorch/aten/src/THC/THCGeneral.cpp line=405 error=8 : invalid device function<br>
Traceback (most recent call last):<br>
File “demo.py”, line 113, in <br>
params=f_RCNN_param, cls=args.cls, bg=args.type)<br>
File “/home/arthur/dev/ai/WORD-pytorch/object_detection/bubble.py”, line 39, in test_net<br>
rois_label = model(im_data, im_info, gt_boxes, num_boxes)  # predict<br>
File “/home/arthur/.anaconda3/envs/WORD/lib/python3.6/site-packages/torch/nn/modules/module.py”, line 489, in <strong>call</strong><br>
result = self.forward(*input, **kwargs)<br>
File “/home/arthur/dev/ai/WORD-pytorch/object_detection/lib/model/faster_rcnn/faster_rcnn.py”, line 52, in forward<br>
base_feat = self.RCNN_base(im_data)<br>
File “/home/arthur/.anaconda3/envs/WORD/lib/python3.6/site-packages/torch/nn/modules/module.py”, line 489, in <strong>call</strong><br>
result = self.forward(*input, **kwargs)<br>
File “/home/arthur/.anaconda3/envs/WORD/lib/python3.6/site-packages/torch/nn/modules/container.py”, line 92, in forward<br>
input = module(input)<br>
File “/home/arthur/.anaconda3/envs/WORD/lib/python3.6/site-packages/torch/nn/modules/module.py”, line 489, in <strong>call</strong><br>
result = self.forward(*input, **kwargs)<br>
File “/home/arthur/.anaconda3/envs/WORD/lib/python3.6/site-packages/torch/nn/modules/activation.py”, line 50, in forward<br>
return F.threshold(input, self.threshold, self.value, self.inplace)<br>
File “/home/arthur/.anaconda3/envs/WORD/lib/python3.6/site-packages/torch/nn/functional.py”, line 838, in threshold<br>
result = <em>VF.threshold</em>(input, threshold, value)<br>
RuntimeError: CUDA error: no kernel image is available for execution on the device</p>
</blockquote>
<p>How could I possibly work around this?</p>
<p>I can’t downgrade CUDA, I need CUDA 12 for the 4 other projects that require it.<br>
But this project / torch 1.0.0 won’t work with CUDA 12.<br>
So I’m stuck, what can I do?</p>
<p>Is there some way to have multiple versions of CUDA around?<br>
Could I upgrade the project to the latest version of torch ( I tried for a few hours, and just hit my head on issues I have zero understanding of, and for which there isn’t really much help on Google. Even chatgpt was of little help…)</p>
<p>Is there something I’m missing / have not considered?</p>
<p>Thanks for any possible help.</p>

ptrblck: <aside class="quote no-group" data-username="Arthur_Wolf" data-post="1" data-topic="194917">
<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/arthur_wolf/48/66744_2.png" class="avatar"> Arthur_Wolf:</div>
<blockquote>
<p>recently I installed (upgraded?) the latest CUDA version (12-3). And even though I’m using the CPU, it just stopped working.</p>
</blockquote>
</aside>
<p>This doesn’t make sense as the locally installed CUDA toolkit won’t even be used if you’ve installed PyTorch binaries with CUDA support, besides the obvious point that CUDA does not influence pure CPU execution.</p>
<aside class="quote no-group" data-username="Arthur_Wolf" data-post="1" data-topic="194917">
<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/arthur_wolf/48/66744_2.png" class="avatar"> Arthur_Wolf:</div>
<blockquote>
<p>And that doesn’t work either, apparently because my CUDA version is much more recent than torch 1.0.0.</p>
</blockquote>
</aside>
<p>Based on the error:</p>
<aside class="quote no-group" data-username="Arthur_Wolf" data-post="1" data-topic="194917">
<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/arthur_wolf/48/66744_2.png" class="avatar"> Arthur_Wolf:</div>
<blockquote>
<p>RuntimeError: CUDA error: no kernel image is available for execution on the device</p>
</blockquote>
</aside>
<p>Your installed PyTorch binary does not ship code for your GPU. This could be the case if you are using any Ampere+ device, as these were released after PyTorch 1.0 came out.</p>