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

created at 08-30-2022 views: 47

Problem

When using the Linux server to train your own model, the following error may appear:

【ERROR】RuntimeError: CUDA error: no kernel image is available for execution on the device

CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.

solution

Activate according to your installed conda environment

In my case, I need to use the following command to activate

conda activate pytorch_3.8

Run again and start training successfully~~~

created at:08-30-2022
edited at: 08-30-2022: