从主机窗口在Docker中的ubuntu上获得nvidia驱动程序支持-'在系统上未找到NVIDIA驱动程序'错误 [英] nvidia driver support on ubuntu in docker from host windows - 'Found no NVIDIA driver on your system' error

查看:295
本文介绍了从主机窗口在Docker中的ubuntu上获得nvidia驱动程序支持-'在系统上未找到NVIDIA驱动程序'错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我建立了一个docker映像:ubuntu20.04 + py38 +火炬,各种库(llvmlite,cuda,pyyaml等)+我的flask应用程序。该应用使用炬管,并且需要在容器内安装nvidia驱动程序。主机是win10 x64。

I have built a docker image: ubuntu20.04 + py38 + torch, various libs(llvmlite, cuda, pyyaml etc) + my flask app. The app uses torch and it needs nvidia driver inside the container. The host machine is win10 x64.

运行容器并用邮递员对其进行测试时,会出现错误:

when running container and testing it with postman, the error appeared:

<head>
    <title>AssertionError:
        Found no NVIDIA driver on your system. Please check that you
        have an NVIDIA GPU and installed a driver from
        http://www.nvidia.com/Download/index.aspx // Werkzeug Debugger</title>

在我的计算机上,nvidia-smi是:

On my machine nvidia-smi is:

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 442.92       Driver Version: 442.92       CUDA Version: 10.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name            TCC/WDDM | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 166... WDDM  | 00000000:01:00.0 Off |                  N/A |
| N/A   40C    P8     3W /  N/A |    382MiB /  6144MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      6212    C+G   ...ta\Local\Postman\app-7.31.0\Postman.exe N/A      |
|    0      6752    C+G   ...are\Brave-Browser\Application\brave.exe N/A      |
+-----------------------------------------------------------------------------+

在SO上已经被问了很多遍了,传统答案是nvidia不支持从Linux docker容器上的Windows进行gpu加速。

It has been asked many times on SO, and the traditional answers are that nvidia can't support gpu acceleration from windows on linux docker container.

我找到了类似的答案。我已阅读问题此问题的答案。但是这些解决方案涉及内部带有ubuntu的主机ubuntu + docker映像。

I found similar answers. I have read question and answers to this question. But these solutions involve host ubuntu + docker image with ubuntu inside.

此链接指示如何使用nvidia-docker2,但根据此答案

this link instructs how to use nvidia-docker2, but nvidia-docker2 is deprecated according to this answer

官方nvidia-docker 存储库中有说明-但仅适用于Linux主机。

The official nvidia-docker repo has instructions - but for linux host only.

但是在docker(后端linux)软件上也安装了此WSL-可以使用吗?

But there is also this WSL on docker(backend linux) software installed - can it be used?

是否仍然有办法使ubuntu容器使用nvidia gpu从主机Windows机器?

Is there still way to make ubuntu container use nvidia gpu from host windows machine?

推荐答案

看起来您现在可以使用Windows子系统(适用于Linux)(WSL 2)在Ubuntu中运行Docker,并且通过GPU。

It looks like you can now run Docker in Ubuntu with the Windows Subsystem for Linux (WSL 2) and do GPU-through.

此链接通过i安装,设置和运行具有GPU支持的TensorFlow Jupyter笔记本:
https://ubuntu.com/blog/getting-started-with-cuda-on-ubuntu-on-wsl-2

This link goes through installation, setup and running a TensorFlow Jupyter notebook with GPU support: https://ubuntu.com/blog/getting-started-with-cuda-on-ubuntu-on-wsl-2

注意-我还没有自己做。

Note - I haven't done this myself yet.

这篇关于从主机窗口在Docker中的ubuntu上获得nvidia驱动程序支持-'在系统上未找到NVIDIA驱动程序'错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆