# I have an old cuda card, which is detected but unsupported. What do I do?

**URL:** <https://discuss.pytorch.org/t/i-have-an-old-cuda-card-which-is-detected-but-unsupported-what-do-i-do/39182>\
**Category:** Uncategorized\
**Created:** [March 7, 2019, 9:16am UTC](https://discuss.pytorch.org/t/i-have-an-old-cuda-card-which-is-detected-but-unsupported-what-do-i-do/39182 "2019-03-07T09:16:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pmplant](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/pmplant/32/9752_2.png) [@pmplant](https://discuss.pytorch.org/u/pmplant)\
**Post date:** [March 7, 2019, 9:16am UTC](https://discuss.pytorch.org/t/i-have-an-old-cuda-card-which-is-detected-but-unsupported-what-do-i-do/39182/1 "2019-03-07T09:16:14Z")

</div>

I have a GeForce GTX 670 which has cuda capability 3.0. torch.cuda.is\_available() returns True, however the card is unsupported in current versions, and returns a runtime error when I use the model after it has been moved to cuda: “RuntimeError: CUDA error: no kernel image is available for execution on the device”.

I do not want to remove the cuda support from the project code just to run it on my machine, and I also need to use a modern version of PyTorch. Is there any way to work around this error without substantial code modifications?

---

<div class="post-metadata">

**Author:** ![AFanthomme](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/afanthomme/32/7807_2.png) [@AFanthomme](https://discuss.pytorch.org/u/AFanthomme)\
**Post date:** [March 7, 2019, 10:00am UTC](https://discuss.pytorch.org/t/i-have-an-old-cuda-card-which-is-detected-but-unsupported-what-do-i-do/39182/2 "2019-03-07T10:00:23Z")

</div>

Maybe something in the spirit of a use\_cuda flag somewhere in the project (e.g. a gpu\_utils.py file) and defines tensors directly on the right device could be useful:

```
FloatTensor = torch.cuda.FloatTensor if use_cuda else torch.FloatTensor
LongTensor = torch.cuda.LongTensor if use_cuda else torch.LongTensor
ByteTensor = torch.cuda.ByteTensor if use_cuda else torch.ByteTensor

```

Or just enclose all “.cuda()” calls with a condition on use\_cuda.  
(you will also need to take extra care if you need to load models trained on GPU from CPU…)

Hope that helps !

---

<div class="post-metadata">

**Author:** ![ptrblck](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/ptrblck/32/1823_2.png) [@ptrblck](https://discuss.pytorch.org/u/ptrblck)\
**Post date:** [March 7, 2019, 11:11am UTC](https://discuss.pytorch.org/t/i-have-an-old-cuda-card-which-is-detected-but-unsupported-what-do-i-do/39182/3 "2019-03-07T11:11:33Z")

</div>

Another approach would be to use the `.to(device)` method and specify the `device` at the beginning.  
This would avoid repeated if conditions.
