51 lines
1.3 KiB
Markdown
51 lines
1.3 KiB
Markdown
# 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
|
||
|
||
## Dockerfile.lower
|
||
|
||
为一些老旧的cpu一些加速指令集用
|
||
|
||
Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz |