Tidy up README

This commit is contained in:
Donato Capitella
2025-07-28 21:05:09 +01:00
parent bbd10a5795
commit 864a02f526
+29 -109
View File
@@ -1,93 +1,28 @@
# amd-strix-halo-toolboxes # amd-strix-halo-toolboxes
This repository provides two Fedora Rawhidebased Dockerfiles for building isolated dev containers with AMDs new **Strix Halo** GPUs (gfx1151): This repository provides Fedora Rawhidebased containers for dev work on AMD **Strix Halo** GPUs (gfx1151):
- **Dockerfile.rocm**: Builds `llama.cpp` with ROCm (HIP) support targeting gfx1151 - **Dockerfile.rocm** — builds `llama.cpp` with ROCm (HIP) support
- **Dockerfile.vulkan**: Builds `llama.cpp` with Vulkan compute support - **Dockerfile.vulkan** — builds `llama.cpp` with Vulkan compute support
Both images load the latest ROCm/Vulkan libraries from Fedora Rawhide to ensure compatibility with Strix Halo. Both containers have up-to-date ROCm/Vulkan libs from Fedora Rawhide.
## Repository Structure
```
.
├── Dockerfile.rocm # HIP-based build for ROCm (gfx1151)
├── Dockerfile.vulkan # Vulkan-based build
└── README.md # This documentation
```
## Prerequisites ## Prerequisites
- **Podman** (or Docker aliased to Podman) - Podman (or Docker, aliased)
- **Toolbox** (for creating interactive dev containers, https://containertoolbx.org/) - Toolbox (https://containertoolbx.org/)
- Recent Linux kernel with AMD GPU drivers (`amdgpu`) installed on the host - Linux kernel with AMD GPU (`amdgpu`) drivers
## 1. Pulling Pre-built Containers ## Pull and Run Pre-built Containers
If you don't want to build locally, pull pre-built images from the registry: **Pull pre-built images:**
```bash ```bash
podman pull docker.io/kyuz0/amd-strix-halo-toolboxes:rocm podman pull docker.io/kyuz0/amd-strix-halo-toolboxes:rocm
podman pull docker.io/kyuz0/amd-strix-halo-toolboxes:vulkan podman pull docker.io/kyuz0/amd-strix-halo-toolboxes:vulkan
``` ```
```bash **Create toolboxes:**
toolbox create llama-rocm \
--image docker.io/kyuz0/amd-strix-halo-toolboxes:rocm \
-- \
--device /dev/kfd \
--device /dev/dri \
--group-add video \
--security-opt seccomp=unconfined
```
```bash
toolbox create llama-vulkan \
--image docker.io/kyuz0/amd-strix-halo-toolboxes:vulkan \
-- \
--device /dev/dri \
--group-add video \
--security-opt seccomp=unconfined
```
## 2. Building the Images
### ROCm (HIP) Image
```bash
podman build -t llama-rocm -f Dockerfile.rocm .
```
### Vulkan Image
```bash
podman build -t llama-vulkan -f Dockerfile.vulkan .
```
- **Podman** (or Docker aliased to Podman)
- **Toolbox** (for creating interactive dev containers, https://containertoolbx.org/)
- Recent Linux kernel with AMD GPU drivers (`amdgpu`) installed on the host
## 1. Building the Images
### ROCm (HIP) Image
```bash
podman build -t llama-rocm -f Dockerfile.rocm .
```
### Vulkan Image
```bash
podman build -t llama-vulkan -f Dockerfile.vulkan .
```
## 2. Creating Toolbox Containers
Toolbox will automatically mount your home directory, map your UID:GID, enable X11, and use the host network. You only need to pass through the GPU devices and relax seccomp.
### ROCm Toolbox
```bash ```bash
toolbox create llama-rocm \ toolbox create llama-rocm \
@@ -97,13 +32,7 @@ toolbox create llama-rocm \
--device /dev/dri \ --device /dev/dri \
--group-add video \ --group-add video \
--security-opt seccomp=unconfined --security-opt seccomp=unconfined
```
> **Note:** The `--` separator tells `toolbox` to pass subsequent flags to the underlying Podman/Docker command.
### Vulkan Toolbox
```bash
toolbox create llama-vulkan \ toolbox create llama-vulkan \
--image docker.io/kyuz0/amd-strix-halo-toolboxes:vulkan \ --image docker.io/kyuz0/amd-strix-halo-toolboxes:vulkan \
-- \ -- \
@@ -112,50 +41,41 @@ toolbox create llama-vulkan \
--security-opt seccomp=unconfined --security-opt seccomp=unconfined
``` ```
## 3. Entering and Testing > The `--` passes remaining flags to Podman/Docker for GPU access.
After creation, enter each container and verify that your GPU and libraries are accessible. **Enter and test:**
### ROCm (HIP) Test
```bash ```bash
toolbox enter llama-rocm toolbox enter llama-rocm
# inside container:
llama-cli --list-devices llama-cli --list-devices
toolbox enter llama-vulkan
vulkaninfo | head -n 10
llama-cli --help
``` ```
You should see your Strix Halo gfx1151 device listed. ## (Optional) Building the Images
### Vulkan Test
```bash ```bash
toolbox enter llama-vulkan podman build -t llama-rocm -f Dockerfile.rocm .
# inside container: podman build -t llama-vulkan -f Dockerfile.vulkan .
vulkaninfo | head -n 10
llama-cli --help # run the Vulkan-enabled CLI
``` ```
If `vulkaninfo` reports your GPU and `llama-cli` runs without errors, the Vulkan build is working.
## Host Configuration ## Host Configuration
The following host details and kernel settings ensure optimal performance and unified memory access for Strix Halo: - **Machine:** HP Z2 Mini G1a
- **Memory:** 128 GB RAM (512 MB GPU in BIOS)
- **Machine**: HP Z2 Mini G1a - **Host OS:** Fedora 42, kernel 6.15.6-200.fc42.x86_64
- **Memory**: 128 GB RAM, with 512 MB allocated to the GPU in BIOS - **Kernel boot parameters:**
- **Host OS**: Fedora 42, kernel 6.15.6-200.fc42.x86_64 ```
- **Kernel boot parameters** (in `/etc/default/grub`):
```text
amd_iommu=off amdgpu.gttsize=131072 ttm.pages_limit=335544321 amd_iommu=off amdgpu.gttsize=131072 ttm.pages_limit=335544321
``` ```
- `amd_iommu=off` disables IOMMU for lower latency and avoids address translation overhead. - `amd_iommu=off` disables IOMMU for lower latency.
- `amdgpu.gttsize=131072` sets the GPU GTT (Graphics Translation Table) size, enabling a unified memory window so the GPU can directly access up to 128 GB of system RAM. - `amdgpu.gttsize=131072` enables unified GPU/system memory (up to 128 GB).
- `ttm.pages_limit=335544321` raises the TTM (Translation Table Maps) page limit to allow larger pinned allocations. - `ttm.pages_limit=335544321` allows large pinned allocations.
- **Apply parameters**: after editing `/etc/default/grub`, run - **Apply with:**
```bash ```bash
sudo grub2-mkconfig -o /boot/grub2/grub.cfg sudo grub2-mkconfig -o /boot/grub2/grub.cfg
``` ```
## Notes Both containers use Fedora Rawhide packages for up-to-date ROCm and Vulkan support.
Both images pull Fedora Rawhide packages for the newest ROCm/Vulkan support.