无法选择设备驱动程序“"具有以下功能:[[gpu]] [英] could not select device driver "" with capabilities: [[gpu]]
问题描述
I am trying install Cuda on WSL 2. I am following instructions such as this.
执行完每个步骤后,我尝试通过执行docker run --gpus all nvcr.io/nvidia/k8s/cuda-sample:nbody nbody -gpu -benchmark
(如上述说明所建议的)来检查gpu是否在Linux环境中可用.
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).
但是出现以下错误:
docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]].
ERRO[0000] error waiting for container: context canceled
.
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?
推荐答案
我遇到了同样的问题.您是否正在使用Windows的Docker Desktop?因为我是,所以我发现WSL2 + CUDA不适用于Windows的Docker桌面:
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
相反,请在WSL2中手动安装Docker(如您所链接的教程中所建议):
Instead, install Docker manually in WSL2 (as is suggested in the tutorial you linked):
sudo apt update && sudo apt install -y nvidia-docker2
然后确保您启动了docker服务:
Then make sure you start the docker service:
sudo service docker start
之后,您可以使用以下命令验证CUDA/Docker/WSL2的设置:
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:
注意:CUDA样本并非用于性能测量.启用GPU Boost后,结果可能会有所不同.
NOTE: The CUDA Samples are not meant for performance measurements. Results may vary when GPU Boost is enabled.
窗口模式 模拟数据存储在视频存储器中 单精度浮点模拟 1用于仿真的设备 未定义用于SM 7.5的MapSMtoCores.默认使用64核/SM GPU设备0:"GeForce RTX 2060&"具有7.5的计算能力
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
计算7.5 CUDA设备:[GeForce RTX 2060] 30720个实体,10次迭代的总时间:52.181 ms =每秒1808.54亿次互动 =每互动20次触发时单精度GFLOP/s为3617.077
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
这篇关于无法选择设备驱动程序“"具有以下功能:[[gpu]]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!