环境依赖
https://amir-yazdani.github.io/post/openpose/
dockerfile
docker run
docker run -d -p 8080:80 -m 4g --name CONTAINER_NAME --hostname CONTAINER_INNER_HOSTNAME -v /home/user/data:/data -e VAR=1 --rm my_image
-d
: 后台运行
-v
: 挂载host的目录到guest目录
-e
: 环境变量
--rm
: 退出后自动删除,一次性容器
-m
: 内存限制
在容器中使用gpu:https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html
rootless无根模式下,容器使用gpu:https://github.com/NVIDIA/nvidia-docker/issues/1155
We encountered the same error. To summarize, we had to edit /etc/nvidia-container-runtime/config.toml as follows, in order to disable the use of cgroups by the NVIDIA container runtime, as noted above.
我们遇到了同样的错误。总而言之,我们必须按如下方式编辑 /etc/nvidia-container-runtime/config.toml ,以便禁用 NVIDIA 容器运行时对 cgroup 的使用,如上所述。
[nvidia-container-cli]
no-cgroups = true
标签:container,Easymocap,--,NVIDIA,nvidia,run,docker,运行 From: https://www.cnblogs.com/nolca/p/18240466Thank you! I can use --gpus '"device=3"' for docker run after this change.
谢谢你!在此更改后,我可以将 --gpus '"device=3"' 用于 docker run 。