gpt4 book ai didi

docker - 无法通过 Docker 驱动程序在 Minikube 上使用 GPU

转载 作者:行者123 更新时间:2023-12-02 19:17:45 25 4
gpt4 key购买 nike

目标:

我正在尝试在使用默认 Docker 驱动程序的 Minikube 集群上使用 Nvidia GPU 功能。

问题:

我可以使用 nvidia-docker与默认 docker上下文,但是当切换到 minikube docker-env 时我收到以下错误:

$ docker run --gpus all nvidia/cuda:10.0-base nvidia-smi
docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]].
ERRO[0000] error waiting for container: context canceled

环境:
  • Ubuntu 18.04
  • Minikube v1.10.0
  • Docker 版本:

  • $ docker version
    Client: Docker Engine - Community
    Version: 19.03.10
    API version: 1.40
    Go version: go1.13.10
    Git commit: 9424aeaee9
    Built: Thu May 28 22:16:49 2020
    OS/Arch: linux/amd64
    Experimental: false

    Server:
    Engine:
    Version: 19.03.2
    API version: 1.40 (minimum version 1.12)
    Go version: go1.12.9
    Git commit: 6a30dfca03
    Built: Wed Sep 11 22:45:55 2019
    OS/Arch: linux/amd64
    Experimental: false
    containerd:
    Version: v1.3.3-14-g449e9269
    GitCommit: 449e926990f8539fd00844b26c07e2f1e306c760
    runc:
    Version: 1.0.0-rc10
    GitCommit:
    docker-init:
    Version: 0.18.0
    GitCommit:
  • Nvidia 容器运行时版本:

  • $ nvidia-container-runtime --version
    runc version 1.0.0-rc10
    commit: dc9208a3303feef5b3839f4323d9beb36df0a9dd
    spec: 1.0.1-dev

    附加信息:

    集群是通过以下方式创建的:

    minikube start --cpus 3 --memory 8G

    以下 minikube插件目前已启用:

    $ minikube addons list
    |-----------------------------|----------|--------------|
    | ADDON NAME | PROFILE | STATUS |
    |-----------------------------|----------|--------------|
    | dashboard | minikube | disabled |
    | default-storageclass | minikube | enabled ✅ |
    | efk | minikube | disabled |
    | freshpod | minikube | disabled |
    | gvisor | minikube | disabled |
    | helm-tiller | minikube | disabled |
    | ingress | minikube | disabled |
    | ingress-dns | minikube | disabled |
    | istio | minikube | disabled |
    | istio-provisioner | minikube | disabled |
    | logviewer | minikube | disabled |
    | metallb | minikube | disabled |
    | metrics-server | minikube | disabled |
    | nvidia-driver-installer | minikube | enabled ✅ |
    | nvidia-gpu-device-plugin | minikube | enabled ✅ |
    | registry | minikube | disabled |
    | registry-aliases | minikube | disabled |
    | registry-creds | minikube | disabled |
    | storage-provisioner | minikube | enabled ✅ |
    | storage-provisioner-gluster | minikube | disabled |
    |-----------------------------|----------|--------------|

    这是 minikube 之外的一个工作示例语境:

    $ docker run --gpus all nvidia/cuda:10.0-base nvidia-smi
    Fri Jun 5 09:23:49 2020
    +-----------------------------------------------------------------------------+
    | NVIDIA-SMI 440.59 Driver Version: 440.59 CUDA Version: 10.2 |
    |-------------------------------+----------------------+----------------------+
    | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
    | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
    |===============================+======================+======================|
    | 0 GeForce GTX 106... Off | 00000000:01:00.0 On | N/A |
    | 0% 51C P8 6W / 120W | 1293MiB / 6077MiB | 0% Default |
    +-------------------------------+----------------------+----------------------+

    +-----------------------------------------------------------------------------+
    | Processes: GPU Memory |
    | GPU PID Type Process name Usage |
    |=============================================================================|
    +-----------------------------------------------------------------------------+

    最佳答案

    这是一个社区维基答案。如果需要,请随意编辑和扩展它。

    Minikube 的 docker 驱动程序不正式支持 Nvidia GPU。这为您提供了两种可能的选择:

  • 尝试使用 NVIDIA Container ToolkitNVIDIA device plugin .这是一种解决方法,在您的用例中可能不是最佳解决方案。
  • 使用 KVM2 driverNone driver .这两个得到官方支持和记录。

  • 我希望它有帮助。

    关于docker - 无法通过 Docker 驱动程序在 Minikube 上使用 GPU,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62212168/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com