【问题标题】:CUDA Version mismatch in Docker with WSL2 backend带有 WSL2 后端的 Docker 中的 CUDA 版本不匹配
【发布时间】:2022-07-21 20:19:29
【问题描述】:

我正在尝试将 docker(适用于 Windows 10 Pro 的 Docker 桌面)与 WSL2 后端 (WINDOWS SUBSHELL LINUX (WSL) (Ubuntu 20.04.4 LTS)) 一起使用。

这部分似乎工作正常,除了我想将我的 GPU (Nvidia RTX A5000) 传递给我的 docker 容器。

在我走到那一步之前,我仍在尝试进行设置。 I found a very good tutorial 瞄准 18.04,但发现所有步骤都与 20.04 相同,只是版本号有些凸起。

最后,我可以看到我的 Cuda 版本不匹配。你可以在这里看到,。

真正的问题是当我尝试运行测试命令as shown on the docker website:

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

我收到此错误:

 --> docker run --rm -it --gpus=all nvcr.io/nvidia/k8s/cuda-sample:nbody nbody -gpu -benchmark
docker: Error response from daemon: OCI runtime create failed: container_linux.go:380:
starting container process caused: process_linux.go:545: container init caused: Running
hook #0:: error running hook: exit status 1, stdout: , stderr: nvidia-container-cli:
requirement error: unsatisfied condition: cuda>=11.6, please update your driver to a
newer version, or use an earlier cuda container: unknown.

...我只是不知道该怎么做,或者我该如何解决这个问题。

有人能解释一下如何让 GPU 成功传递到 docker 容器吗?

【问题讨论】:

  • please update your driver to a newer version 在使用 WSL 时,您的 WSL 设置中的驱动程序不是您在 WSL 中安装的,它是由 windows 端的驱动程序提供的。您的 WSL 驱动程序是 472.84,它太旧了,无法与 CUDA 11.6 一起使用(它仅支持 CUDA 11.4)。因此,如果您想运行 CUDA 11.6 测试用例,您需要将您的 Windows 端驱动程序更新到您的 GPU 可能的最新版本。关于 CUDA 版本的“不匹配”,this 提供了一般的背景材料进行解释。
  • @RobertCrovella 就是这样。我的驱动版本现在是511.79,我的CUDA版本是11.6,谢谢!
  • 如果不清楚,please update your driver to a newer version 是您在问题中引用的错误消息的直接引用。

标签: docker cuda windows-subsystem-for-linux nvidia-docker


【解决方案1】:

The comment from @RobertCrovella resolved this:

请在使用 WSL 时将您的驱动程序更新到较新的版本,WSL 设置中的驱动程序不是您在 WSL 中安装的,它是由 windows 端的驱动程序提供的。您的 WSL 驱动程序是 472.84,它太旧了,无法与 CUDA 11.6 一起使用(它仅支持 CUDA 11.4)。因此,如果您想运行 CUDA 11.6 测试用例,您需要将您的 Windows 端驱动程序更新到您的 GPU 可能的最新版本。关于 CUDA 版本的“不匹配”,这提供了一般的背景材料进行解释。

下载最新的 Nvidia 驱动程序:

Version:             R510 U3 (511.79)  WHQL
Release Date:        2022.2.14
Operating System:    Windows 10 64-bit, Windows 11
Language:            English (US)
File Size:           640.19 MB

现在我可以支持 CUDA 11.6,并且 docker 文档中的测试现在可以正常工作了:

--> docker run --rm -it --gpus=all nvcr.io/nvidia/k8s/cuda-sample:nbody nbody -gpu -benchmark
Run "nbody -benchmark [-numbodies=<numBodies>]" to measure performance.
        -fullscreen       (run n-body simulation in fullscreen mode)
        -fp64             (use double precision floating point values for simulation)
        -hostmem          (stores simulation data in host memory)
        -benchmark        (run benchmark to measure performance)
        -numbodies=<N>    (number of bodies (>= 1) to run in simulation)
        -device=<d>       (where d=0,1,2.... for the CUDA device to use)
        -numdevices=<i>   (where i=(number of CUDA devices > 0) to use for simulation)
        -compare          (compares simulation results running once on the default GPU and once on the CPU)
        -cpu              (run n-body simulation on the CPU)
        -tipsy=<file.bin> (load a tipsy model file for simulation)

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
GPU Device 0: "Ampere" with compute capability 8.6

> Compute 8.6 CUDA device: [NVIDIA RTX A5000]
65536 bodies, total time for 10 iterations: 58.655 ms
= 732.246 billion interactions per second
= 14644.916 single-precision GFLOP/s at 20 flops per interaction

感谢您的快速回复!

【讨论】:

    【解决方案2】:

    当我尝试运行容器时,我在 Ubuntu 上遇到了同样的问题:

    s.evloev@some-pc:~$ docker run --gpus all --rm nvidia/cuda:11.7.0-base-ubuntu18.04
    docker: Error response from daemon: failed to create shim: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error running hook #0: error running hook: exit status 1, stdout: , stderr: Auto-detected mode as 'legacy'
    nvidia-container-cli: requirement error: unsatisfied condition: cuda>=11.7, please update your driver to a newer version, or use an earlier cuda container: unknown.
    

    在我的情况下,当我尝试启动具有高于我主机上安装的 nvidia cuda 版本的 docker 映像时发生这种情况。

    当我检查主机上安装的 cuda 版本时,我发现它是 11.3 版。

    s.evloev@some-pc:~$ nvidia-smi
    Thu Jul 21 15:06:33 2022       
    +-----------------------------------------------------------------------------+
    | NVIDIA-SMI 465.19.01    Driver Version: 465.19.01    CUDA Version: 11.3     |
    |-------------------------------+----------------------+----------------------+
    | GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC | 
    |...                                                                          |
    +-----------------------------------------------------------------------------+
    
    

    因此,当我尝试运行相同的 cuda 版本 (11.3) 时,它运行良好:

    s.evloev@some-pc:~$ docker run -it --gpus all --rm nvidia/cuda:11.3.0-base-ubuntu18.04 nvidia-smi
    Thu Jul 21 12:13:46 2022       
    +-----------------------------------------------------------------------------+
    | NVIDIA-SMI 465.19.01    Driver Version: 465.19.01    CUDA Version: 11.3     |
    |-------------------------------+----------------------+----------------------+
    | GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
    | Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
    |                               |                      |               MIG M. |
    |===============================+======================+======================|
    |   0  NVIDIA GeForce ...  On   | 00000000:65:00.0 Off |                  N/A |
    |  0%   44C    P8     7W / 180W |   1404MiB /  8110MiB |      0%      Default |
    |                               |                      |                  N/A |
    +-------------------------------+----------------------+----------------------+
    
    

    【讨论】:

      猜你喜欢
      • 2019-08-18
      • 1970-01-01
      • 1970-01-01
      • 2021-11-28
      • 1970-01-01
      • 2012-10-15
      • 2020-12-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多