Commit 3f9e28c9 authored by songlinfeng's avatar songlinfeng 💬
Browse files

Update README.md

parent 12ff5a7d
......@@ -10,7 +10,7 @@ DCU Container Toolkit 使用户能够构建和运行使用DCU设备的容器,该
## 使用
- --gpus需要Docker version 19+
- cdi 需要Docker version 25+
首先确保已经安装好DTK
首先确保已经安装好驱动
### 安装
......@@ -38,9 +38,9 @@ $ docker run -it --gpus '"device=0,2"' ubuntu:18.04 #添加第0号和第2号GPU
#### 通过环境变量 `DCU_VISIBLE_DEVICES`
可以通过 docker run 添加环境变量 -e DCU_VISIBLE_DEVICES 给容器添加HCU设备。
```sh
docker run -it -e DCU_VISIBLE_DEVICES=all ubuntu:18.04 # 添加所有HCU设备
docker run -it -e DCU_VISIBLE_DEVICES=0 ubuntu:18.04 # 添加HCU设备0
docker run -it -e DCU_VISIBLE_DEVICES=0,1 ubuntu:18.04 # 添加HCU设备0、1
$ docker run -it -e DCU_VISIBLE_DEVICES=all ubuntu:18.04 # 添加所有HCU设备
$ docker run -it -e DCU_VISIBLE_DEVICES=0 ubuntu:18.04 # 添加HCU设备0
$ docker run -it -e DCU_VISIBLE_DEVICES=0,1 ubuntu:18.04 # 添加HCU设备0、1
```
#### 通过CDI方式
- 首先,生成CDI spec文件
......@@ -82,7 +82,7 @@ c-3000.com/hcu=hcu-73873c7a6eb02041
c-3000.com/hcu=hcu-73873c7a6eb040a1
```
### docker rootless下对文件读写权限的限制
非root用户在使用-v挂载目录时,保留原有权限,无法对ro目录添加w权限,执行该命令需要root权限
非root用户在使用-v挂载目录时可以赋予目录w权限,为了防止非root用户在容器内删除非用户目录下的文件,可以在挂载非用户目录时添加ro权限
```sh
$ dcu-ctk rootless --runtime=docker
```
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment