Lar*_*son 5 nvidia microsoft windows-10 windows-subsystem-for-linux 20.04
我启动了 Ubuntu 并尝试运行 NVIDIA-SMI。它告诉我它不在那里,但我可以使用以下选项之一安装它:
Command 'nvidia-smi' not found, but can be installed with:
sudo apt install nvidia-340 # version 340.108-0ubuntu2, or
sudo apt install nvidia-utils-390 # version 390.132-0ubuntu2
sudo apt install nvidia-utils-435 # version 435.21-0ubuntu7
sudo apt install nvidia-utils-440 # version 440.82+really.440.64-0ubuntu6
Run Code Online (Sandbox Code Playgroud)
请注意,没有nvidia-utils-450与我的 455.51 相对应的选项,上面的 NVidia 线程说需要在某个地方才能使事情顺利进行。然后我跑了
sudo apt install nvidia-utils-440
nvidia-smi
Run Code Online (Sandbox Code Playgroud)
它说“未找到设备”。
然后我找到了这个指南。我卸载了 Ubunto 20.04,然后按照指南进行操作。导游要求我
该指南的“安装 docker”部分似乎有问题。我无法启动 docker 服务。所以我卸载了 Ubuntu 并重复了到目前为止的步骤,没有接触 Docker。然后(我的版本),从 Docker 点开始的步骤是(对于 docker 部分,我按照这些说明获取 Docker):
sudo apt-get update
sudo apt-get upgrade
sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
sudo apt update
apt-cache policy docker-ce
sudo apt install docker-ce
sudo systemctl status docker
Run Code Online (Sandbox Code Playgroud)
最后一步失败了。我收到这条消息:
$ sudo systemctl status docker
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
Run Code Online (Sandbox Code Playgroud)
这导致我来到这里,第四个几乎得分最低的答案似乎有效,只是它需要在后台模式下运行:
sudo dockerd &
sudo usermod -aG docker your-user
Run Code Online (Sandbox Code Playgroud)
然后我返回到Docker 安装后指南步骤并继续
docker run --gpus all nvcr.io/nvidia/k8s/cuda-sample:nbody nbody -gpu -benchmark
Run Code Online (Sandbox Code Playgroud)
这失败了
ERRO[2020-06-23T07:28:28.582848400-04:00] 5cd9b9d7011ba20f72971dd27900b23b2c0f6be656b0bd53b9e178944fe4eba6 cleanup: failed to delete container from containerd: no such container
ERRO[2020-06-23T07:28:28.582946600-04:00] Handler for POST /v1.40/containers/5cd9b9d7011ba20f72971dd27900b23b2c0f6be656b0bd53b9e178944fe4eba6/start returned error: could not select device driver "" with capabilities: [[gpu]]
docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]].
ERRO[0018] error waiting for container: context canceled
Run Code Online (Sandbox Code Playgroud)
最后我回到NVidia 公告并执行了以下步骤:
sudo apt-get update
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
curl -s -L https://nvidia.github.io/libnvidia-container/experimental/$distribution/libnvidia-container-experimental.list | sudo tee /etc/apt/sources.list.d/libnvidia-container-experimental.list
sudo apt-get update
sudo apt-get install -y nvidia-docker2
sudo dockerd &
docker run --gpus all nvcr.io/nvidia/k8s/cuda-sample:nbody nbody -gpu -benchmark
Run Code Online (Sandbox Code Playgroud)
成功:我得到了一个满意的结果:
> Windowed mode
> Simulation data stored in video memory
> Single precision floating point simulation
> 1 Devices used for simulation
GPU Device 0: "Quadro M500M" with compute capability 5.0
> Compute 5.0 CUDA device: [Quadro M500M]
3072 bodies, total time for 10 iterations: 3.817 ms
= 24.724 billion interactions per second
= 494.487 single-precision GFLOP/s at 20 flops per interaction
Run Code Online (Sandbox Code Playgroud)
然而,根据下面的答案,根据已知的 NVIDIA 限制,不存在 NVIDIA-SMI 。
进一步说明:上面的 docker 容器测试适用于 Ubuntu shell。它不适用于带有 Ubuntu 选项卡的 Windows Powershell Preview。
小智 5
如果 nbody 工作正常,那么你就已经配置好了一切。问题是 NVIDIA 驱动程序的限制。 https://docs.nvidia.com/cuda/wsl-user-guide/index.html#known-limitations
NVIDIA Management Library (NVML) APIs are not supported.
nvidia-smi 基于 NVIDIA 管理库 (NVML) 之上。
| 归档时间: |
|
| 查看次数: |
24408 次 |
| 最近记录: |