No kernel image is available for execution

Trying to set up a new Windows 11 machine with a 5080 GPU using the Nvidia Studio Driver version 580.97. I have installed Spyder 6.0.7 standalone which uses Python 3.11.12. Have also installed PyTorch.

All this works fine using: device = torch.device(“cpu”) BUT when I try device = torch.device(“cuda:0”) I get the dreaded CUDA error: no kernel image is available for execution on the device

Info reported by my little test program:
CUDA Available: True
GPU Name: NVIDIA GeForce RTX 5080
Number of GPUs available: 1
Torch Ver: 12.6
Arch List: [‘sm_61’, ‘sm_70’, ‘sm_75’, ‘sm_80’, ‘sm_86’, ‘sm_90’]

I see many comments saying use: nvcc --version to find cuda version. However Windows 11 cmd window does not recognize nvcc. Is this a clue that something is missing??

I have scoured the web & this site for any solutions but have been unable to find anything which guides me to a resolution. As I am totally new to the world of GPU’s, I will very much appreciate any guidance. TIA, Joe

If this is refering to the Cuda version used to build it, it’s too old to run on 50XX GPU’s. You need the 12.8 version.

This is confirmed by the Arch list you just added, yours is sm_120.

Thanks for the reply - the version I listed (12.6) came from the statement:
print("Torch ver: " + torch.version.cuda)

So does this mean I need to update cuda to version 12.8 or torch to version 12.8?

Sorry for such a basic question, but I am obviously just getting started with GPU stuff.

I know nothing about this but, “torch.version.cuda”, is showing the cuda version used to build with, 12.6.

You don’t need to install cuda unless you’re compiling it and looking at this page, under the “Install Pytorch”, you select the options you wish, choose Cuda 12.8 and use the command string shown.

I just tried the following cmd: pip install torch torchvision --index-url https://download.pytorch.org/whl/cu128

and got these responses:

Looking in indexes: https://download.pytorch.org/whl/cu128
Requirement already satisfied: torch in c:\users\jmontgomery\appdata\roaming\python\python311\site-packages (2.8.0+cu126)
Requirement already satisfied: torchvision in c:\users\jmontgomery\appdata\roaming\python\python311\site-packages (0.23.0+cu126)
Requirement already satisfied: filelock in c:\users\jmontgomery\appdata\roaming\python\python311\site-packages (from torch) (3.19.1)
Requirement already satisfied: typing-extensions>=4.10.0 in c:\programdata\spyder-6\envs\spyder-runtime\lib\site-packages (from torch) (4.13.2)
Requirement already satisfied: sympy>=1.13.3 in c:\programdata\spyder-6\envs\spyder-runtime\lib\site-packages (from torch) (1.14.0)
Requirement already satisfied: networkx in c:\users\jmontgomery\appdata\roaming\python\python311\site-packages (from torch) (3.5)
Requirement already satisfied: jinja2 in c:\programdata\spyder-6\envs\spyder-runtime\lib\site-packages (from torch) (3.1.6)
Requirement already satisfied: fsspec in c:\users\jmontgomery\appdata\roaming\python\python311\site-packages (from torch) (2025.7.0)
Requirement already satisfied: numpy in c:\programdata\spyder-6\envs\spyder-runtime\lib\site-packages (from torchvision) (2.2.6)
Requirement already satisfied: pillow!=8.3.,>=5.3.0 in c:\programdata\spyder-6\envs\spyder-runtime\lib\site-packages (from torchvision) (11.2.1)*
Requirement already satisfied: mpmath<1.4,>=1.1.0 in c:\programdata\spyder-6\envs\spyder-runtime\lib\site-packages (from sympy>=1.13.3->torch) (1.3.0)
Requirement already satisfied: MarkupSafe>=2.0 in c:\programdata\spyder-6\envs\spyder-runtime\lib\site-packages (from jinja2->torch) (3.0.2)

I don’t understand the first two lines, ending “cu126”, as I would have thought you were requesting cu128.

Maybe try uninstalling the version you have first.

Yes, I was puzzled by 126 since I specified 128. Will try uninstall

I tried both: pip uninstall torch torchvision and pip uninstall torch Both caused the Spyder IPython console to hang - no response.

I then tried: pip install torch torchvision --index-url https://download.pytorch.org/whl/cu128

Got this response:
Looking in indexes: https://download.pytorch.org/whl/cu128
Requirement already satisfied: torch in c:\users\jmontgomery\appdata\roaming\python\python311\site-packages (2.8.0+cu126)
Requirement already satisfied: torchvision in c:\users\jmontgomery\appdata\roaming\python\python311\site-packages (0.23.0+cu126)
Requirement already satisfied: filelock in c:\users\jmontgomery\appdata\roaming\python\python311\site-packages (from torch) (3.19.1)
Requirement already satisfied: typing-extensions>=4.10.0 in c:\programdata\spyder-6\envs\spyder-runtime\lib\site-packages (from torch) (4.13.2)
Requirement already satisfied: sympy>=1.13.3 in c:\programdata\spyder-6\envs\spyder-runtime\lib\site-packages (from torch) (1.14.0)
Requirement already satisfied: networkx in c:\users\jmontgomery\appdata\roaming\python\python311\site-packages (from torch) (3.5)
Requirement already satisfied: jinja2 in c:\programdata\spyder-6\envs\spyder-runtime\lib\site-packages (from torch) (3.1.6)
Requirement already satisfied: fsspec in c:\users\jmontgomery\appdata\roaming\python\python311\site-packages (from torch) (2025.7.0)
Requirement already satisfied: numpy in c:\programdata\spyder-6\envs\spyder-runtime\lib\site-packages (from torchvision) (2.2.6)
Requirement already satisfied: pillow!=8.3.,>=5.3.0 in c:\programdata\spyder-6\envs\spyder-runtime\lib\site-packages (from torchvision) (11.2.1)*
Requirement already satisfied: mpmath<1.4,>=1.1.0 in c:\programdata\spyder-6\envs\spyder-runtime\lib\site-packages (from sympy>=1.13.3->torch) (1.3.0)
Requirement already satisfied: MarkupSafe>=2.0 in c:\programdata\spyder-6\envs\spyder-runtime\lib\site-packages (from jinja2->torch) (3.0.2)

I’m out of ideas at this stage, but it certainly looks like you are using the cuda 12.6 version, which will definitely not work with your card.

Thank you taking the time to look & suggest ideas. Maybe someone else will chime in with some insight.

Before anyone else wastes time on this, I uninstalled Spyder and then downloaded Anaconda. Installed PyTorch 12.8 and everything is working fine. Thank you rs277 for your help