简体   繁体   中英

nvidia driver support on ubuntu in docker from host windows - 'Found no NVIDIA driver on your system' error

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>

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      |
+-----------------------------------------------------------------------------+

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.

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

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

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

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

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

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM