Commit 2477e403 authored by songlinfeng's avatar songlinfeng
Browse files

update readme

parent 3440c625
...@@ -284,3 +284,28 @@ services: ...@@ -284,3 +284,28 @@ services:
```sh ```sh
docker stack deploy -c docker-compose.yml rocm-stack docker stack deploy -c docker-compose.yml rocm-stack
``` ```
### containerd 配置
配置 containerd 需要先配置 containerd 的配置文件 `/etc/containerd/config.toml`
```shell
$ dcu-ctk runtime configure --runtime=containerd --set-as-default --cdi.enabled
$ systemctl restart containerd
```
若用于kubernetes,则需要配合dcu-device-plugin使用
https://download.sourcefind.cn:65024/5/main/Kubernetes%E6%8F%92%E4%BB%B6
若使用nerdctl命令行工具,则需要使用--runtime
```shell
$ nerdctl run --rm --runtime dcu -e DCU_VISIBLE_DEVICES=0,1 ubuntu:18.04 bash
```
### 查询DCU被docker容器使用情况
若开启了dcu-tracker, 则可以使用dcu-tracker查询DCU被docker容器使用情况,若没有开启dcu-tracker,则可以使用该功能查询被docker容器使用中的DCU
情况,若只是被挂载到容器而没有被使用,则不会显示在该列表中。
```shell
$ dcu-ctk docker
------------------------------------------------------------------------------------------------------------------------
DCU Id UUID Container Names
------------------------------------------------------------------------------------------------------------------------
0 0x73873C7A6EB02041 peaceful_hawking
------------------------------------------------------------------------------------------------------------------------
```
...@@ -21,7 +21,13 @@ export PATH=${HOME}/go/bin:$PATH ...@@ -21,7 +21,13 @@ export PATH=${HOME}/go/bin:$PATH
make cmds make cmds
source=("dcu-container-runtime" "dcu-cdi-hook" "dcu-ctk" "dcu-docker") source=("dcu-container-runtime" "dcu-cdi-hook" "dcu-ctk" "dcu-docker")
mkdir SOURCES RPMS BUILD SRPMS BUILDROOT dirs=("SOURCES" "RPMS" "BUILD" "SRPMS" "BUILDROOT")
for dir in "${dirs[@]}"
do
if [ ! -d $dir ];then
mkdir $dir
fi
done
for file in "${source[@]}" for file in "${source[@]}"
do do
rm -rf SOURCES/$file > /dev/null 2>&1 rm -rf SOURCES/$file > /dev/null 2>&1
......
...@@ -108,22 +108,22 @@ func (m command) build() *cli.Command { ...@@ -108,22 +108,22 @@ func (m command) build() *cli.Command {
Destination: &config.mode, Destination: &config.mode,
}, },
&cli.StringFlag{ &cli.StringFlag{
Name: "dtk-runtime-name", Name: "dcu-runtime-name",
Usage: "specify the name of the DTK runtime that will be added", Usage: "specify the name of the DCU runtime that will be added",
Value: defaultDTKRuntimeName, Value: defaultDTKRuntimeName,
Destination: &config.dtkRuntime.name, Destination: &config.dtkRuntime.name,
}, },
&cli.StringFlag{ &cli.StringFlag{
Name: "dtk-runtime-path", Name: "dcu-runtime-path",
Aliases: []string{"runtime-path"}, Aliases: []string{"runtime-path"},
Usage: "specify the path to the DTK runtime executable", Usage: "specify the path to the DCU runtime executable",
Value: defaultDTKRuntimeExecutable, Value: defaultDTKRuntimeExecutable,
Destination: &config.dtkRuntime.path, Destination: &config.dtkRuntime.path,
}, },
&cli.BoolFlag{ &cli.BoolFlag{
Name: "dtk-set-as-default", Name: "dcu-set-as-default",
Aliases: []string{"set-as-default"}, Aliases: []string{"set-as-default"},
Usage: "set the DTK runtime as the default runtime", Usage: "set the DCU runtime as the default runtime",
Destination: &config.dtkRuntime.setAsDefault, Destination: &config.dtkRuntime.setAsDefault,
}, },
&cli.BoolFlag{ &cli.BoolFlag{
......
...@@ -243,7 +243,7 @@ func ShowStatus(dcus string) error { ...@@ -243,7 +243,7 @@ func ShowStatus(dcus string) error {
} }
fmt.Println(strings.Repeat("-", 120)) fmt.Println(strings.Repeat("-", 120))
fmt.Printf("%-40s%-50s%-20s\n", "GPU Id", "UUID", "Container Names") fmt.Printf("%-40s%-50s%-20s\n", "DCU Id", "UUID", "Container Names")
fmt.Println(strings.Repeat("-", 120)) fmt.Println(strings.Repeat("-", 120))
for dcuId := range dcuinfos { for dcuId := range dcuinfos {
for idx, name := range dcuinfos[dcuId].ContainerName { for idx, name := range dcuinfos[dcuId].ContainerName {
......
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