WSL: RuntimeError: CUDA error: all CUDA-capable devices are busy or unavailable
I just follow the installation step by step here https://docs.nvidia.com/cuda/wsl-user-guide/index.html
I’m not trying to use docker I’m trying to use pytorch directly from python This is the code `` (base) gegg00@DESKTOP-KS0OLS9:~$ python Python 3.7.6 (default, Jan 8 2020, 19:59:22) [GCC 7.3.0] :: Anaconda, Inc. on linux Type “help”, “copyright”, “credits” or “license” for more information.
import torch torch.cuda.is_available() True torch.randn(5) tensor([-2.6408, -1.0831, -1.6984, 0.4742, -0.5909]) torch.randn(5).to(2) Traceback (most recent call last): File “<stdin>”, line 1, in <module> RuntimeError: CUDA error: all CUDA-capable devices are busy or unavailable ``
Environment
Platform ServicePack Version VersionString
Win32NT 10.0.20170.0 Microsoft Windows NT 10.0.20170.0
Ubuntu Release: 18.04
WSL 2: Linux version 4.19.121-microsoft-standard (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP Fri Jun 19 21:06:10 UTC 2020
Steps to reproduce
I follow the steps https://docs.nvidia.com/cuda/wsl-user-guide/index.html Installed Anaconda Anaconda3-2020.02-Linux-x86_64.sh Installed pytorch conda install pytorch torchvision cudatoolkit=10.2 -c pytorch try the code `` (base) gegg00@DESKTOP-KS0OLS9:~$ python Python 3.7.6 (default, Jan 8 2020, 19:59:22) [GCC 7.3.0] :: Anaconda, Inc. on linux Type “help”, “copyright”, “credits” or “license” for more information.
import torch torch.cuda.is_available() True torch.randn(5) tensor([-2.6408, -1.0831, -1.6984, 0.4742, -0.5909]) torch.randn(5).to(2) Traceback (most recent call last): File “<stdin>”, line 1, in <module> RuntimeError: CUDA error: all CUDA-capable devices are busy or unavailable `` Getting this error: RuntimeError: CUDA error: all CUDA-capable devices are busy or unavailable
Expected behavior
Actual behavior
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 8
- Comments: 16 (1 by maintainers)
I have the same problem and have the same kernel version but nvidia driver 460.20 torch.cuda.is_available() returns true but cannot perform any operation on cuda
I am having the same problem, with NVIDIA driver 460.20, and WSL 2 kernel version 4.19.128.
It may work. But there was an unfixed issue in version 20221 that caused the following error when running some Linux distros: “The remote procedure call failed”
I guess we just have to wait until Windows gets fixed again.
Thanks @rohitsingh02! Rolling back to 20221.1000 (while staying at WSL 2 4.19.128, NVIDIA 460.15) resolved the issue for me
FYI, this worked for me on build 20236! Both the minimal example (
torch.randn(1).to(0)) and training a full torch model. Thanks for your help, everyone 😃Unfortunately I was trying to use the fastai lib which specifically really doesn’t support Windows.
Build 20236 seems to work:
Thanks guys! Now to just get fastai working…heh