https://github.com/abuccts/rocm-container-runtime
ROCm container runtime
https://github.com/abuccts/rocm-container-runtime
container docker rocm runtime
Last synced: 3 months ago
JSON representation
ROCm container runtime
- Host: GitHub
- URL: https://github.com/abuccts/rocm-container-runtime
- Owner: abuccts
- License: mit
- Created: 2020-01-08T10:33:49.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-02-19T11:54:40.000Z (over 5 years ago)
- Last Synced: 2025-04-14T16:57:16.499Z (6 months ago)
- Topics: container, docker, rocm, runtime
- Language: Shell
- Size: 2.93 KB
- Stars: 9
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
ROCm Container Runtime
======================rocm-container-runtime is a wrapper for [runc](https://github.com/opencontainers/runc).
If environment variable `AMD_VISIBLE_DEVICES` is set in OCI config,
the runtime will inject necessary fields into OCI config to use AMD GPUs in containers.The runtime is the same as [ROCm-docker](https://github.com/RadeonOpenCompute/ROCm-docker) on the host, but provides flexibility for AMD GPUs on Kubernetes.
The runtime achieves similar functionality to [nvidia-container-runtime](https://github.com/NVIDIA/nvidia-container-runtime), but is for AMD GPUs on [ROCm Platform](https://rocm.github.io/).
Installation
------------```sh
git clone https://github.com/abuccts/rocm-container-runtime
cd rocm-container-runtime
# you can edit rocm-container-runtime.conf for configurations
bash install.sh
```> NOTE: the runtime only works for Debian distributions currenly, changes are needed for other Linux distributions.
Docker Engine Setup
-------------------* Docker daemon configuration file
Add the following fields into `/etc/docker/daemon.json` and restart Docker service:
```json
{
"runtimes": {
"rocm": {
"path": "/usr/bin/rocm-container-runtime",
"runtimeArgs": []
}
}
}
```You can optionally set it to default runtime in `/etc/docker/daemon.json`:
```json
"default-runtime": "rocm"
```Docker Usage
------------```sh
# use 4 AMD GPUs
docker run --runtime=rocm -e AMD_VISIBLE_DEVICES=0,1,2,3 --security-opt seccomp=unconfined rocm/rocm-terminal rocminfo# use the 3rd AMD GPU
docker run --runtime=rocm -e AMD_VISIBLE_DEVICES=2 --security-opt seccomp=unconfined rocm/rocm-terminal rocminfo
```> NOTE: To use AMD GPUs in Docker, please follow [ROCm's document](https://rocm.github.io/ROCmInstall.html#Ubuntu) to install drivers first.