This directory contains the Dockerfile for building hipDNN development environment.
- Docker installed on your system
- ROCm-compatible GPU (for running with GPU support)
- Sufficient disk space for Docker images
- File:
Dockerfile.ubuntu24 - Base Image: Ubuntu 24.04 LTS
- Purpose: Primary development environment for hipDNN
- Includes:
- ROCm development tools
- CMake build system
- Google Test framework
- Ninja build tool
The Dockerfile supports two build types: prebuilt (using nightly tarballs) and fullbuild (building from source).
| Argument | Default | Description | Valid Values |
|---|---|---|---|
BUILD_TYPE |
prebuilt |
Selects build method | prebuilt, fullbuild |
THEROCK_ASIC |
gfx94X (prebuilt)gfx90a (fullbuild) |
GPU architecture target | values for prebuild here, future support here, and values for fullbuild here |
| Argument | Default | Description |
|---|---|---|
THEROCK_GIT_TAG |
7.0.0rc20250909 |
Git tag for nightly tarballs |
THEROCK_TARBALL |
therock-dist-linux-gfx94X-dcgpu-7.0.0rc20250909.tar.gz |
Overrides the full tarball path for nightly tarballs (setting this will ignore THEROCK_ASIC, and THEROCK_GIT_TAG) |
Note: Prebuilt mode downloads pre-compiled binaries from TheRock nightly builds (much faster)
| Argument | Default | Description |
|---|---|---|
THEROCK_GIT_HASH |
default |
Specific git commit hash to checkout (uses default branch if not specified) |
THEROCK_BUILD_PRESET |
linux-release-package |
Specify which build preset to use when building TheRock |
Note: Fullbuild mode clones and compiles TheRock from source (slower but more flexible)
Default prebuilt (gfx94X, tag 7.0.0rc20250909):
docker build -f Dockerfile.ubuntu24 -t hipdnn:prebuilt .Override ASIC and Git Tag (gfx950, tag 7.0.0rc20250908):
docker build -f Dockerfile.ubuntu24 --build-arg THEROCK_ASIC=gfx950 --build-arg THEROCK_GIT_TAG=7.0.0rc20250908 -t hipdnn:prebuilt_gfx950 .Default fullbuild (gfx90a, default branch):
docker build -f Dockerfile.ubuntu24 --build-arg BUILD_TYPE=fullbuild -t hipdnn:fullbuild .Custom ASIC and Git Hash (gfx950, hash abcd1234):
docker build -f Dockerfile.ubuntu24 --build-arg BUILD_TYPE=fullbuild --build-arg THEROCK_ASIC=gfx950 --build-arg THEROCK_GIT_HASH=abcd1234 -t hipdnn:custom_source_build .To run the hipDNN docker environment with full GPU support:
docker run -it \
-v /path/to/hipdnn/repo:/workspace/hipdnn \
--privileged \
--rm \
--device=/dev/kfd \
--device /dev/dri:/dev/dri:rw \
--volume /dev/dri:/dev/dri:rw \
-v /var/lib/docker/:/var/lib/docker \
--group-add video \
--cap-add=SYS_PTRACE \
--security-opt seccomp=unconfined \
<image-name>| Option | Purpose |
|---|---|
-it |
Interactive terminal |
-v /path/to/hipdnn/repo:/workspace/hipdnn |
Mount hipDNN source code |
--privileged |
Required for GPU access |
--rm |
Remove container after exit |
--device=/dev/kfd |
AMD GPU compute device |
--device /dev/dri:/dev/dri:rw |
Direct Rendering Infrastructure for GPU |
--group-add video |
Add container to video group for GPU access |
--cap-add=SYS_PTRACE |
Enable debugging capabilities |
--security-opt seccomp=unconfined |
Required for some debugging tools |
Ubuntu 22.04:
docker run -it \
-v $(pwd):/workspace/hipdnn \
--privileged \
--rm \
--device=/dev/kfd \
--device /dev/dri:/dev/dri:rw \
--group-add video \
--cap-add=SYS_PTRACE \
--security-opt seccomp=unconfined \
hipdnn:prebuilt-
Volume Mounting: Mount your hipDNN source code directory to persist changes:
-v /absolute/path/to/hipdnn:/workspace/hipdnn
-
GPU Verification: Once inside the container, verify GPU access:
rocm-smi
-
Development Workflow: The containers include all necessary development tools, so you can edit code on your host machine and build/test inside the container.
- Ensure ROCm is properly installed on the host system
- Verify that
/dev/kfdand/dev/driexist on the host - Check that your user is in the
videoandrendergroups
- Make sure to use the
--privilegedflag - Verify that the mounted directories have appropriate permissions
- Ensure all submodules are initialized:
git submodule update --init --recursive - Check that the ROCm version in the container matches your GPU requirements
- Since the docker build doesn't change when the cloned source is updated, you will need to either provide a new hash for the docker build to rebuild
--build-arg THEROCK_GIT_HASH=abcd1234, or provide--no-cacheoption when building to force rebuild