"git@developer.sourcefind.cn:yangql/googletest.git" did not exist on "b2d81b4fb2a229d01655afabec9679197cc2c1f4"
using-docker.mdx 1.49 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
---
id: using-docker
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';


# Using Docker

SuperBench runs benchmarks inside Docker container,
here are the guides on how to build images and start containers during development.

## Build image

16
You need to [clone the code](./development.md#set-up) first before building the image.
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

<Tabs
  groupId='gpu-platform'
  defaultValue='cuda'
  values={[
    {label: 'CUDA', value: 'cuda'},
    {label: 'ROCm', value: 'rocm'},
  ]
}>
<TabItem value='cuda'>

```bash
export DOCKER_BUILDKIT=1
docker buildx build \
  --platform linux/amd64 --cache-to type=inline,mode=max \
32
  --tag superbench-dev --file dockerfile/cuda12.1.dockerfile .
33
34
35
36
37
38
```

</TabItem>
<TabItem value='rocm'>

```bash
39
40
41
export DOCKER_BUILDKIT=1
docker buildx build \
  --platform linux/amd64 --cache-to type=inline,mode=max \
42
  --tag superbench-dev --file dockerfile/rocm5.1.x.dockerfile .
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
```

</TabItem>
</Tabs>

## Run container

<Tabs
  groupId='gpu-platform'
  defaultValue='cuda'
  values={[
    {label: 'CUDA', value: 'cuda'},
    {label: 'ROCm', value: 'rocm'},
  ]
}>
<TabItem value='cuda'>

```bash
docker run \
  -itd --name=sb-dev \
  --privileged --net=host --ipc=host \
  --gpus=all \
  -w /root -v /mnt:/mnt \
  superbench-dev bash
```

</TabItem>
<TabItem value='rocm'>

```bash
docker run \
  -itd --name=sb-dev \
  --privileged --net=host --ipc=host \
  --security-opt seccomp=unconfined --group-add video \
  -w /root -v /mnt:/mnt \
  superbench-dev bash
```

</TabItem>
</Tabs>