自己总结的:

nvidia-docker, 不支持windows,
2019.10, nvidia-docker过时了,从docker 1903开始,安装一个nvidia-container-runtime就行了, --gpus
2020.12, docker 好像可以直接在wsl2里面跑了, 需要windows inside版本
win 10 2021版本直接包含了对GPU的支持,不再需要inside版本

copy from SO:

2021 updated answer

If you need to access NVIDIA CUDA from a Linux container on Windows 10, there is an easy way to do so, if you are fine with the (current) requirement of being on an Insider build. I was successful with training models on GPU in TensorFlow 2 using this method.

  1. Update Windows 10 to build 20149 or higher. At the time of writing, only Insider Dev branch will work -- you can check the build numbers on the Windows Insider webpage.
  2. Install the NVIDIA CUDA WSL driver (free registration is required)
  3. Install Docker Desktop
    • It will guide you through enabling WSL2 if you haven't already.
    • If you already have it installed, update it to the latest version and enable Settings - General - Use the WSL2 backed engine.
    • To be able to use the docker CLI from inside WSL2 (not just from PowerShell/cmd), enable the integration in Settings - Resources - WSL INTEGRATION.
  4. Test using the command docker run --rm -it --gpus=all nvcr.io/nvidia/k8s/cuda-sample:nbody

You need to pass --gpus=all to docker run to enable the container to access GPU. (If you use VSCode Remote Containers, add "runArgs": ["--gpus=all"], to devcontainer.json.)

You may come across mentions of --runtime=nvidia in descriptions of images meant for nvidia-docker (like the official TensorFlow images). Simply replace --runtime=nvidia by --gpus=all in the provided commands.

Ref:

https://stackoverflow.com/questions/49589229/is-gpu-pass-through-possible-with-docker-for-windows (https://www.docker.com/blog/wsl-2-gpu-support-is-here/)

https://stackoverflow.com/questions/25185405/using-gpu-from-a-docker-container

https://collabnix.com/introducing-new-docker-cli-api-support-for-nvidia-gpus-under-docker-engine-19-03-0-beta-release/

Is GPU pass-through possible with docker for Windows?

安装detectron2的docker环境

docker with GPU support的更多相关文章

  1. Ubuntu 16.04 + CUDA 8.0 + cuDNN v5.1 + TensorFlow(GPU support)安装配置详解

    随着图像识别和深度学习领域的迅猛发展,GPU时代即将来临.由于GPU处理深度学习算法的高效性,使得配置一台搭载有GPU的服务器变得尤为必要. 本文主要介绍在Ubuntu 16.04环境下如何配置Ten ...

  2. 谈谈TensorFlow with CPU support or TensorFlow with GPU support(图文详解)

    不多说,直接上干货! You must choose one of the following types of TensorFlow to install: TensorFlow with CPU ...

  3. detectron2安装出现Kernel not compiled with GPU support 报错信息

    在安装使用detectron2的时候碰到Kernel not compiled with GPU support 问题,前后拖了好久都没解决,现总结一下以备以后查阅. 不想看心路历程的可以直接跳到最后 ...

  4. PatentTips - GPU Support for Blending

    Graphics processing units (GPUs) are specialized hardware units used to render 2-dimensional (2-D) a ...

  5. docker使用GPU

    1.物理机安装显卡驱动 2.安装nvidia-docker wget -P /tmp https://github.com/NVIDIA/nvidia-docker/releases/download ...

  6. tensorflow 资源汇总-docker 运行 tensorflow-gpu on nvidia support

    tensorflow 容器运行过程中使用到的命令记录: 使用image启动容器命令: docker run --name=: tensorflow/tensorflow:latest-gpu-py3- ...

  7. 巧用 Docker 快速部署 GPU 环境

    公众号关注 「开源Linux」 回复「学习」,有我为您特别筛选的学习资料~ 在 Linux 服务器上使用 GPU 跑深度学习的模型很正常不过.如果我们想用 Docker 实现同样的需求,就需要做些额外 ...

  8. 【Docker】使用Docker Client和Docker Go SDK为容器分配GPU资源

    目录 背景 使用 Docker Client 调用 GPU 依赖安装 安装 Docker 安装 NVIDIA Container Toolkit¶ --gpus 用法 使用 Docker Go SDK ...

  9. caffe 无GPU 环境搭建

    root@k-Lenovo:/home/k# sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-d ...

  10. docker[caffe&&pycaffe]

    0 引言 今天花了一天,完成了整个caffe的dockerfile编写,其支持python3.6.6,这里主要的注意点是protobuf的版本(在3.6.0之后,只支持c11),还有在制作镜像的时候注 ...

随机推荐

  1. BS架构和CS架构应用

    概述     B/S结构即浏览器和服务器结构.它是随着Internet技术的兴起,对C/S结构的一种变化或者改进的结构.在这种结构下,用户工作界面是通过WWW浏览器来实现,极少部分事务逻辑在前端(Br ...

  2. el-config-provider

    el-config-provider是Element Plus库中的一个组件,用于提供全局的配置.它是Element Plus在2.0版本中引入的新组件. el-config-provider组件的作 ...

  3. 使用Nginx Proxy Manager配置Halo的反向代理和申请 SSL 证书

    本文介绍Nginx Proxy Manager配置Halo的反向代理和申请 SSL 证书,如需要了解Halo 2的安装,参考如何在Linux云服务器上通过Docker Compose部署安装Halo, ...

  4. Spring AOP概念及原理

    Spring AOP(面向切面编程) 以下内容由ChatGPT生成 AOP(Aspect-Oriented Programming,面向切面编程)是一种编程范式,旨在通过分离关注点来提高程序的模块化. ...

  5. 【Java-GUI】10 Swing04

    面板容器: package cn.dzz.swing; import javax.swing.*; import javax.swing.event.ChangeEvent; import javax ...

  6. NVIDIA机器人仿真环境 —— NVIDIA Isaac Sim 的headless模式/无头模式 —— 非桌面模式、非可视化模式

    相关: https://developer.nvidia.com/isaac-sim 可视化模式,也就是在桌面系统上直接安装软件,具体地址: https://developer.nvidia.com/ ...

  7. win10系统wifi不会自动连接怎么解决

    参考: https://jingyan.baidu.com/article/d621e8da743bab2865913f99.html ================================ ...

  8. AQS源码解读之ReentrantLock-图解

    1.背景 1.AQS简介AQS全称为AbstractQueuedSynchronizer(抽象队列同步器).AQS是一个用来构建锁和其他同步组件的基础框架,使用AQS可以简单且高效地构造出应用广泛的同 ...

  9. 链接池偶尔报错:HikariPool-1 - Connection is not available, request timed out after 39985ms.

    1.背景 线上服务器偶尔报错如下: org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.e ...

  10. Error in v-on handler: "TypeError: Cannot read property 'value' of undefined"

    Error in v-on handler: "TypeError: Cannot read property 'value' of undefined" 报错如下所示,即 在运行 ...