Files
gromacs_docker/README.md
2024-09-09 20:36:26 +08:00

45 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# gromacs_docker
在容器中使用gpu需要安装[nvidia-container-toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html)
运行命令:
```shell
docker run -it --net=host --gpus all --name 容器名 -e NVIDIA_DRIVER_CAPABILITIES=compute,utility -e NVIDIA_VISIBLE_DEVICES=all 镜像名
```
首次使用报错:
```shell
docker: Error response from daemon: could not select device driver “” with capabilities: [[gpu]].
```
解决办法:
```shell
sudo curl -s -L https://nvidia.github.io/nvidia-container-runtime/gpgkey | \
sudo apt-key add -
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
sudo curl -s -L https://nvidia.github.io/nvidia-container-runtime/$distribution/nvidia-container-runtime.list | \
sudo tee /etc/apt/sources.list.d/nvidia-container-runtime.list
sudo apt-get update
sudo apt-get install nvidia-container-runtime
```
02 验证执行下列命令:
```shell
which nvidia-container-runtime
```
输出 /usr/bin/nvidia-container-runtime表示安装成功。
03 docker 使用:
```shell
docker run -it --gpus all **
```
此时,设置使用设备上全部的显卡。
目前尚不支持debian12