Fix CUDA error: no kernel image is available for execution on the device

By | April 18, 2023

When we are running a pytorch mode, we may get this error: CUDA error: no kernel image is available for execution on the device. In this tutorial, we will introduce you how to fix.

This error may look like:

Fix CUDA error no kernel image is available for execution on the device

Why does this error occur?

If you run code below, you may get more information.

why cuda error no kernel image is available

Because your cuda version is not suitable your gpu, you need to reintall cuda and pytorch.

In order to what cuda version you should install, you can refer this tutorial.

Check Your GPU is Suitable for TensorFlow or not: A Step Guide – TensorFlow Tutorial

or check what cuda version has been installed, you can check:

Fix PyTorch RuntimeError: The NVIDIA driver on your system is too old (found version 10000) – PyTorch Tutorial