Nvidia GTX 1080 - RuntimeError: CUDA error: no kernel image is available for execution on the device

Hi!
I am trying to run some code within the pytorch/pytorch:nightly-devel-cuda9.2-cudnn7 image container.
If I try to run torch.cuda.is_available() it returns true

But when I run result = model(return_loss=False, rescale=not show, **data) it throws : RuntimeError: CUDA error: no kernel image is available for execution on the device (launch_kernel at /opt/conda/conda-bld/pytorch_1579022071458/work/aten/src/ATen/native/cuda/Loops.cuh:103)

output of nvidia-smi:

output of nvcc --version:

output of conda list | grep torch
pytorch 1.4.0 py3.7_cuda9.2.148_cudnn7.6.3_0 pytorch
torchvision 0.5.0 py37_cu92 pytorch

My Ubuntu version is 16.04
Please help!

Could you update to the latest PyTorch release (1.8.0) or the nightly binary?
1.4.0 is quite old by now and I don’t know what might have caused these issues back then.

Unfortunately, I am trying to run some code that depends on Cuda 9.2 and torch==1.4.0
Is there any workaround for this?

This error is usually raised, if the application wasn’t compiled for your GPU architecture.
I don’t know how PyTorch was built in your setup, but you might need to rebuild it either locally on the node with the desired GPU (which should detect the compute capability) or by specifying it manually via TORCH_CUDA_ARCH_LIST=6.1.

I installed pytorch using

conda install pytorch==1.4.0 torchvision==0.5.0 cudatoolkit=9.2 -c pytorch

From here Previous PyTorch Versions | PyTorch

I will try reinstalling!

Unfortunately, reinstalling does not seem to help.

I don’t think that reinstalling would help and you can check the built-in GPU architectures using this method.
I guess that sm_61 might not have been shipped in this binary.