frank-primary: track the gfx1201 build patch (apt/cmake/ggml guard) + runbook recipe

This commit is contained in:
Frank
2026-09-26 15:44:17 -07:00
parent bed551baa6
commit fc472e89d4
2 changed files with 81 additions and 0 deletions
@@ -0,0 +1,68 @@
diff --git a/Dockerfile.rocm b/Dockerfile.rocm
index 4ea7a1d7..0e22355b 100644
--- a/Dockerfile.rocm
+++ b/Dockerfile.rocm
@@ -59,18 +59,17 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
git \
git-lfs \
- hipblas-dev \
- hipblaslt-dev \
- hipcub-dev \
libcurl4-openssl-dev \
ninja-build \
pkg-config \
python3 \
- rocblas-dev \
- rocprim-dev \
- rocwmma-dev \
&& rm -rf /var/lib/apt/lists/*
+# Ubuntu jammy ships cmake 3.22, which predates the block command that
+# ROCm 7.14 hipblaslt-config.cmake requires (CMake >= 3.25). Install the
+# official 3.31 binary; /usr/local/bin precedes /usr/bin on PATH.
+RUN curl -fsSL https://github.com/Kitware/CMake/releases/download/v3.31.6/cmake-3.31.6-linux-x86_64.tar.gz | tar -xz -C /usr/local --strip-components=1
+
WORKDIR /src
# COPY ordering mirrors the CUDA Dockerfile: C++ build inputs first so the
@@ -152,11 +151,8 @@ ENV PATH=/opt/rocm/bin:${PATH}
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
- hipblas \
- hipblaslt \
libgomp1 \
pciutils \
- rocblas \
&& rm -rf /var/lib/apt/lists/*
# uv (pinned) manages Python 3.12 + resolves the luce + pflash
diff --git a/server/deps/llama.cpp/ggml/src/ggml-cuda/ggml-cuda.cu b/server/deps/llama.cpp/ggml/src/ggml-cuda/ggml-cuda.cu
index 1e6ca455..5f4b3035 100644
--- a/server/deps/llama.cpp/ggml/src/ggml-cuda/ggml-cuda.cu
+++ b/server/deps/llama.cpp/ggml/src/ggml-cuda/ggml-cuda.cu
@@ -3916,6 +3916,12 @@ static void ggml_backend_cuda_synchronize(ggml_backend_t backend) {
GGML_UNUSED(backend);
}
+// (moved above the USE_CUDA_GRAPH guard: ggml_cuda_node_is_noop
+// calls this unconditionally)
+static bool ggml_cuda_node_launches_nothing(const ggml_tensor * node) {
+ return ggml_is_empty(node) || node->op == GGML_OP_RESHAPE || node->op == GGML_OP_TRANSPOSE ||
+ node->op == GGML_OP_VIEW || node->op == GGML_OP_PERMUTE || node->op == GGML_OP_NONE;
+}
#ifdef USE_CUDA_GRAPH
// GGML_CUDA_COLLECTIVE_GRAPH_CAPTURE=1: allow graph capture of a graph that
@@ -3930,10 +3936,6 @@ static bool ggml_cuda_cluster_capture_allowed() {
}
// View-like and empty nodes: the evaluation loops launch nothing for them.
-static bool ggml_cuda_node_launches_nothing(const ggml_tensor * node) {
- return ggml_is_empty(node) || node->op == GGML_OP_RESHAPE || node->op == GGML_OP_TRANSPOSE ||
- node->op == GGML_OP_VIEW || node->op == GGML_OP_PERMUTE || node->op == GGML_OP_NONE;
-}
static bool ggml_cuda_graph_check_compability(ggml_cgraph * cgraph) {
@@ -53,6 +53,19 @@ mode here, not an error.
```
git clone --recurse-submodules https://github.com/Luce-Org/lucebox.git
cd lucebox
# Three local modifications (repo-tracked at
# dankserver/frank-primary/lucebox-gfx1201.patch):
# 1. Dockerfile.rocm drops the ROCm *-dev apt packages (the 7.14.1-full
# base already ships them in /opt/rocm; the apt repo does not serve
# them) and the three runtime math libs.
# 2. Dockerfile.rocm installs the official cmake 3.31.6 binary (jammy's
# 3.22 predates the `block` command ROCm 7.14 hipblaslt-config.cmake
# requires, CMake >= 3.25).
# 3. ggml-cuda.cu: `ggml_cuda_node_launches_nothing` moved above the
# `#ifdef USE_CUDA_GRAPH` guard — `ggml_cuda_node_is_noop` calls it
# unconditionally, but the macro is never defined by the build
# system, so the in-guard definition was dead and the use failed.
git apply ../lucebox-gfx1201.patch
podman build --build-arg LUCE_HIP_ARCHES=gfx1201 \
--build-arg ROCM_VERSION=7.14.1-full \
-t localhost/lucebox-rocm:gfx1201 -f Dockerfile.rocm .