Commit 4929d1c1 authored by songlinfeng's avatar songlinfeng 💬
Browse files
parents 1a0cbe54 959d45c0
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
DCU Container Toolkit 使用户能够构建和运行使用DCU设备的容器,该toolkit包括以下工具包。 DCU Container Toolkit 使用户能够构建和运行使用DCU设备的容器,该toolkit包括以下工具包。
- ```dcu-container-toolkit``` - DCU容器运行时 - ```dcu-container-runtime``` - DCU容器运行时
- ```dcu-ctk``` - DCU容器工具集命令行 - ```dcu-ctk``` - DCU容器工具集命令行
## 使用 ## 使用
...@@ -12,6 +12,18 @@ DCU Container Toolkit 使用户能够构建和运行使用DCU设备的容器,该 ...@@ -12,6 +12,18 @@ DCU Container Toolkit 使用户能够构建和运行使用DCU设备的容器,该
- cdi 需要Docker version 25+ - cdi 需要Docker version 25+
首先确保已经安装好驱动。 首先确保已经安装好驱动。
### 编译
若联网编译则可以使用如下命令编译,会启动一个docker容器进行编译
```sh
make rocky8
make ubuntu22.04
```
若要离线编译则执行如下命令,当前只支持rpm包
```sh
build.sh
```
### 安装 ### 安装
使用 dpkg/rpm -i 进行安装。安装后会自动执行以下命令 使用 dpkg/rpm -i 进行安装。安装后会自动执行以下命令
...@@ -291,9 +303,7 @@ docker stack deploy -c docker-compose.yml rocm-stack ...@@ -291,9 +303,7 @@ docker stack deploy -c docker-compose.yml rocm-stack
$ dcu-ctk runtime configure --runtime=containerd --set-as-default --cdi.enabled $ dcu-ctk runtime configure --runtime=containerd --set-as-default --cdi.enabled
$ systemctl restart containerd $ systemctl restart containerd
``` ```
若用于kubernetes,则需要配合dcu-device-plugin使用 若用于kubernetes,则需要配合[dcu-device-plugin](https://download.sourcefind.cn:65024/5/main/Kubernetes%E6%8F%92%E4%BB%B6)使用,若使用nerdctl命令行工具,则需要使用--runtime
https://download.sourcefind.cn:65024/5/main/Kubernetes%E6%8F%92%E4%BB%B6
若使用nerdctl命令行工具,则需要使用--runtime
```shell ```shell
$ nerdctl run --rm --runtime dcu -e DCU_VISIBLE_DEVICES=0,1 ubuntu:18.04 bash $ nerdctl run --rm --runtime dcu -e DCU_VISIBLE_DEVICES=0,1 ubuntu:18.04 bash
``` ```
...@@ -309,3 +319,32 @@ DCU Id UUID ...@@ -309,3 +319,32 @@ DCU Id UUID
------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------
``` ```
### 支持vDCU挂载docker
支持vDCU挂载docker容器,在启动时使用 -e VDCU_VISIBLE_DEVICES环境变量来启动容器,vDCU的约束条件请查看[DCU虚拟化用户指南](https://download.sourcefind.cn:65024/directlink/5/Kubernetes%E6%8F%92%E4%BB%B6/DCU%E8%99%9A%E6%8B%9F%E5%8C%96%E7%94%A8%E6%88%B7%E6%8C%87%E5%8D%97.pdf)
```
#对第0块DCU分成4块vDCU,每个vDCU显存8G,每个vDCU计算单元30
$ hy-smi virtual -d 0 -create-vdevices 4 -vdevice-compute-units 30,30,30,30 -vdevice-memory-size 8192,8192,8192,8192
#查看分配好的vDCU
$ hy-smi virtual --show-vdevice-info
Virtual Device 0:
Physical Device: 0
Compute units: 30
Global memory: 8589934592 bytes
Virtual Device 1:
Physical Device: 0
Compute units: 30
Global memory: 8589934592 bytes
Virtual Device 2:
Physical Device: 0
Compute units: 30
Global memory: 8589934592 bytes
Virtual Device 3:
Physical Device: 0
Compute units: 30
Global memory: 8589934592 bytes
#使用docker run启动容器
$ docker run --rm -e VDCU_VISIBLE_DEVICES=1,2 -it a4dd5be0ca23 /bin/bash
```
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