Files
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

179 lines
6.9 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# hipTensor Docker Images
Two Dockerfiles are provided, both targeting Ubuntu 24.04:
| File | Description |
|-----------------------------------|----------------------------------------------------------------|
| `Dockerfile.ubuntu24.prebuilt` | Downloads a prebuilt ROCm tarball (nightly, stable, or latest) |
| `Dockerfile.ubuntu24.fullbuild` | Clones and builds ROCm from source (TheRock) |
---
## Prebuilt
Downloads a prebuilt ROCm tarball from a configurable source (`THEROCK_URL_BASE`). Faster to build; suitable for day-to-day development.
**Default build** (gfx94X, latest available nightly):
```bash
docker build -f Dockerfile.ubuntu24.prebuilt -t hiptensor:prebuilt .
```
`THEROCK_GIT_TAG` defaults to `latest`, which queries `THEROCK_URL_BASE` at build time, finds all tarballs matching the ASIC prefix, and downloads the highest version. ADHOCBUILD tarballs are excluded.
**Select another ASIC** :
```bash
docker build -f Dockerfile.ubuntu24.prebuilt \
--build-arg THEROCK_ASIC=gfx950 \
-t hiptensor:prebuilt .
```
**Pin to a specific nightly** (format: `<version>a<YYYYMMDD>`):
```bash
docker build -f Dockerfile.ubuntu24.prebuilt \
--build-arg THEROCK_ASIC=gfx950 \
--build-arg THEROCK_GIT_TAG=7.13.0a20260401 \
-t hiptensor:prebuilt .
```
**Use stable releases instead of nightlies:**
```bash
docker build -f Dockerfile.ubuntu24.prebuilt \
--build-arg THEROCK_GIT_TAG=latest \
--build-arg THEROCK_URL_BASE=https://repo.amd.com/rocm/tarball/ \
-t hiptensor:prebuilt .
```
**Pin to a specific stable release** (format: `<version>`):
```bash
docker build -f Dockerfile.ubuntu24.prebuilt \
--build-arg THEROCK_GIT_TAG=7.12.0 \
--build-arg THEROCK_URL_BASE=https://repo.amd.com/rocm/tarball/ \
-t hiptensor:prebuilt .
```
**Available tarball sources** (`THEROCK_URL_BASE`):
| Source | URL |
|--------------------------|-----------------------------------------------|
| Nightly builds (default) | `https://rocm.nightlies.amd.com/tarball/` |
| Stable releases | `https://repo.amd.com/rocm/tarball/` |
| Prereleases (QA) | `https://rocm.prereleases.amd.com/tarball/` |
| Dev builds | `https://rocm.devreleases.amd.com/tarball/` |
See the [TheRock releases page](https://github.com/ROCm/TheRock/blob/main/RELEASES.md#browsing-release-tarballs) for details.
### ASIC suffix note
The tarball suffix (`-dcgpu`, `-dgpu`, `-all`, or none) is derived automatically from `THEROCK_ASIC`:
| ASIC(s) | Auto-selected suffix |
|--------------------------------------------------------------------|----------------------|
| `gfx94X`, `gfx90X`, `gfx950` | `-dcgpu` |
| `gfx101X`, `gfx103X` | `-dgpu` |
| `gfx110X`, `gfx120X` | `-all` |
| `gfx900`, `gfx906`, `gfx908`, `gfx90a`, `gfx1150`–`gfx1153` | _(none)_ |
Use `THEROCK_PREBUILT_ID` only if you need a non-default suffix (e.g. `gfx110X-dgpu` instead of `gfx110X-all`):
```bash
docker build -f Dockerfile.ubuntu24.prebuilt \
--build-arg THEROCK_PREBUILT_ID=gfx110X-dgpu \
-t hiptensor:prebuilt .
```
### Providing a full tarball URL or local path
If the tarball source uses a non-standard naming convention, bypass all auto-detection by providing the complete download URL via `THEROCK_TARBALL_URL`. All other `THEROCK_*` arguments are ignored when this is set:
```bash
docker build -f Dockerfile.ubuntu24.prebuilt \
--build-arg THEROCK_TARBALL_URL=https://repo.amd.com/rocm/tarball/therock-dist-linux-gfx950-dcgpu-7.12.0.tar.gz \
-t hiptensor:prebuilt .
```
`THEROCK_TARBALL_URL` also accepts local paths resolved relative to the Docker build context. Use a `file:///` prefix for an absolute path within the build context, or a plain relative path:
```bash
# Absolute path within the build context
docker build -f Dockerfile.ubuntu24.prebuilt \
--build-arg THEROCK_TARBALL_URL=file:///therock-dist-linux-gfx94X-dcgpu-7.12.0.tar.gz \
-t hiptensor:prebuilt .
# Relative path within the build context
docker build -f Dockerfile.ubuntu24.prebuilt \
--build-arg THEROCK_TARBALL_URL=tarballs/therock-dist-linux-gfx94X-dcgpu-7.12.0.tar.gz \
-t hiptensor:prebuilt .
```
The build context is the directory passed to `docker build` (`.` by default). The tarball must be inside it — Docker cannot access files outside the build context, and passing a large directory as the context will cause Docker to transfer its entire contents to the daemon before the build starts.
If the tarball lives outside the current directory, use a temporary build context containing only the tarball:
```bash
TARBALL=/path/to/therock-dist-linux-gfx94X-dcgpu-7.12.0.tar.gz
CTX=$(mktemp -d)
cp "$TARBALL" "$CTX/"
docker build \
-f "$(pwd)/Dockerfile.ubuntu24.prebuilt" \
--build-arg THEROCK_TARBALL_URL=$(basename "$TARBALL") \
-t hiptensor:prebuilt \
"$CTX"
rm -rf "$CTX"
```
---
## Fullbuild
Clones TheRock from GitHub and builds ROCm from source. Takes significantly longer; useful when a prebuilt tarball is unavailable or when custom build options are needed.
**Default build** (gfx94X, latest default branch):
```bash
docker build -f Dockerfile.ubuntu24.fullbuild -t hiptensor:fullbuild .
```
**Specify a different ASIC and commit hash:**
```bash
docker build -f Dockerfile.ubuntu24.fullbuild \
--build-arg THEROCK_ASIC=gfx950 \
--build-arg THEROCK_GIT_HASH=abc123def456 \
-t hiptensor:fullbuild .
```
**Debug build using 32 parallel jobs:**
```bash
docker build -f Dockerfile.ubuntu24.fullbuild \
--build-arg THEROCK_BUILD_MODE=Debug \
--build-arg BUILD_JOBS=32 \
-t hiptensor:debug .
```
**Build with a custom TheRock CMake preset:**
```bash
docker build -f Dockerfile.ubuntu24.fullbuild \
--build-arg THEROCK_BUILD_MODE=Preset \
--build-arg THEROCK_BUILD_PRESET=linux-debug-package \
-t hiptensor:custom-preset .
```
**Build mode options** (`THEROCK_BUILD_MODE`):
| Mode | Description |
|---------------------|-----------------------------------------------------------|
| `Release` (default) | Standard optimized build |
| `Debug` | Debug symbols, no optimization |
| `Preset` | Use a named TheRock CMake preset (`THEROCK_BUILD_PRESET`) |
---
## Running a Container
Mount your current directory into `/workspace`:
```bash
docker run -itd --name my-container --rm --network=host --device=/dev/kfd --device=/dev/dri --group-add video --cap-add=SYS_PTRACE --security-opt seccomp=unconfined \
-v $(pwd):/workspace \
-v $HOME/.ssh:/root/.ssh/ \
hiptensor:prebuilt
docker exec -it --privileged my-container /bin/bash
```