I was using GTX3060, CUDA11.2, DRIVER 460.80, UBUNTU18.04, PyTorch 1.9.0+cu102, python3.8(i also tried python3.9, but it gives me the same error message)
When I run the following code, I got the RuntimeError.
device = torch.device(“cuda:0” if torch.cuda.is_available() else “cpu”)
print(‘device’, device)
a = torch.Tensor(5,3)
a = a.cuda()
The code prints" device cuda:0" which means at least the code access to the GPU. However, it also gives me the RuntimeError.
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.
On my computer, I can run TensorFlow with GPU, but It seems like I have some trouble with PyTorch. My CUDA version, driver version seem all right for me. What did I do wrong?
Thank you