Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
songlinfeng
container-toolkit
Commits
4929d1c1
Commit
4929d1c1
authored
Dec 11, 2025
by
songlinfeng
💬
Browse files
Merge branch 'main' of
http://developer.sourcefind.cn/codes/songlinfeng/container-toolkit
parents
1a0cbe54
959d45c0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
4 deletions
+43
-4
README.md
README.md
+43
-4
No files found.
README.md
View file @
4929d1c1
...
@@ -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
```
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment