could not select device driver “” with capabilities: [[gpu]]

蹲街弑〆低调 提交于 2020-08-08 05:31:06

问题


I am trying install Cuda on WSL 2. I am following instructions such as this.

After executing every step, I try to check if gpu is available in the Linux environment by executing docker run --gpus all nvcr.io/nvidia/k8s/cuda-sample:nbody nbody -gpu -benchmark (as suggested by the aforementioned instructions).

But I get the following error: docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]]. ERRO[0000] error waiting for container: context canceled.

Any ideas what might be the cause of this?


回答1:


I was having the same issue. Are you using Docker Desktop for Windows? Because I was, and I found out that WSL2 + CUDA does not work with Docker Desktop for Windows:

https://forums.developer.nvidia.com/t/hiccups-setting-up-wsl2-cuda/128641

Instead, install Docker manually in WSL2 (as is suggested in the tutorial you linked):

sudo apt update && sudo apt install -y nvidia-docker2

Then make sure you start the docker service:

sudo service docker start

After that, you can verify the CUDA/Docker/WSL2 setup with this:

 docker run --gpus all nvcr.io/nvidia/k8s/cuda-sample:nbody nbody -gpu -benchmark

Where you should see some output like this:

NOTE: The CUDA Samples are not meant for performance measurements. Results may vary when GPU Boost is enabled.

Windowed mode Simulation data stored in video memory Single precision floating point simulation 1 Devices used for simulation MapSMtoCores for SM 7.5 is undefined. Default to use 64 Cores/SM GPU Device 0: "GeForce RTX 2060" with compute capability 7.5

Compute 7.5 CUDA device: [GeForce RTX 2060] 30720 bodies, total time for 10 iterations: 52.181 ms = 180.854 billion interactions per second = 3617.077 single-precision GFLOP/s at 20 flops per interaction




回答2:


This issue of "could not select device driver with capabilities: [[gpu]] happened to me for a silly reason: NVIDIA driver keeps getting updated with new Insider builds.

I've gotten in the habit of running ./deviceQuery from the NVIDIA_CUDA-11.0_Samples to make sure all is well with CUDA on WSL and then checking my NVIDIA driver version if it returns that no devices are found (and then reinstalling the correct driver).

This may not be the best answer, but maybe it will save some time if you run into this.



来源:https://stackoverflow.com/questions/62477330/could-not-select-device-driver-with-capabilities-gpu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!