Cuda runtime error (100) : no CUDA-capable device is detected at /pytorch/aten/src/THC/THCGeneral.cpp:47

Hello! I am a beginner in pytorch and I hope to use the gpu as in my visual studio 19.
My computer is windows 10. I use conda virtual envs for python works. On my virtual env, the list is the following. In the visual studio, I can run cuda with cpp… but for pytorch, I downloaded a sample code that I know works well in my gpu but I get the error above. What is wrong with my approach? Thank you!!

Name Version Build Channel

blas 1.0 mkl
ca-certificates 2020.7.22 0
certifi 2020.6.20 py38_0
cudatoolkit 10.2.89 h74a9793_1
freetype 2.10.2 hd328e21_0
future 0.18.2 pypi_0 pypi
intel-openmp 2020.2 254
jpeg 9b hb83a4c4_2
libpng 1.6.37 h2a8f88b_0
libtiff 4.1.0 h56a325e_1
lz4-c 1.9.2 h62dcd97_1
mkl 2020.2 256
mkl-service 2.3.0 py38hb782905_0
mkl_fft 1.1.0 py38h45dec08_0
mkl_random 1.1.1 py38h47e9c7a_0
ninja 1.10.0 py38h7ef1ec2_0
numpy 1.19.1 py38h5510c5b_0
numpy-base 1.19.1 py38ha3acd2a_0
olefile 0.46 py_0
openssl 1.1.1g he774522_1
pillow 7.2.0 py38hcc1f983_0
pip 20.2.2 py38_0
python 3.8.5 he1778fa_0
pytorch 1.6.0 py3.8_cuda102_cudnn7_0
setuptools 49.6.0 py38_0
six 1.15.0 py_0
sqlite 3.33.0 h2a8f88b_0
tk 8.6.10 he774522_0
torchvision 0.7.0 py38_cu102 pytorch
vc 14.1 h0510ff6_4
vs2015_runtime 14.16.27012 hf0eaf9b_3
wheel 0.35.1 py_0
wincertstore 0.2 py38_0
xz 5.2.5 h62dcd97_0
zlib 1.2.11 h62dcd97_4
zstd 1.4.5 h04227a9_0

I think i get the above error since I designated my gpu0 to be used for the code via
torch.cuda.set_device(0)
If I run the code on CPU it works fine.

torch.cuda.is_available() is false

print(torch.version) is 1.5.0.

Please let me know anything!

Sorry. This issue has been solved by re-installing my torch from pytorch.

1 Like