From f236dbb85c163bb391b8977549d6bf00dba2235c Mon Sep 17 00:00:00 2001 From: xxDoman Date: Tue, 6 Oct 2026 13:11:37 +0200 Subject: [PATCH] gfx906: the 0.1.40 tree does not build on HIP/gfx906 (three compile errors) The STRATA_HIP_GFX906 build defines STRATA_HIP_GFX906, not STRATA_USE_HIP, so three sites that gate on STRATA_USE_HIP still take the CUDA branch and fail to compile: 1. fused_gr.cu: a bare 'return;' in the bool fused_gr_read_multi -> 'return false;'. 2. mtp.cpp: the MTP stream-priority block (cudaDeviceGetStreamPriorityRange) is gated on !defined(STRATA_HIP_GFX906) too. 3. vmm.cpp: the include and the CUDA driver VMM code get the same gate. All three are inside #if blocks that only the gfx906 build reaches. --- src/core/mtp.cpp | 2 +- src/core/vmm.cpp | 2 +- src/kernels/cuda/fused_gr.cu | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/mtp.cpp b/src/core/mtp.cpp index b446b434..a93f4c51 100644 --- a/src/core/mtp.cpp +++ b/src/core/mtp.cpp @@ -415,7 +415,7 @@ bool MtpDrafter::load(const std::string& rt_dir, const ModelGeometry& g, Session // --pipeline-windows 2 (the forcing graphs): the chain shares its card with stage 1's windows and the next launch // on stage 0 waits for it, so its stream gets the highest priority there (STRATA_MTP_PRIORITY=0: the default) bool prio = false; -#if !defined(STRATA_USE_HIP) // (HIP: the default priority) +#if !defined(STRATA_USE_HIP) && !defined(STRATA_HIP_GFX906) // (HIP: the default priority) static const bool hi_prio = [] { const char* v = std::getenv("STRATA_MTP_PRIORITY"); return v == nullptr || std::atoi(v) != 0; }(); int prio_lo = 0, prio_hi = 0; if (force_on_ && hi_prio && cudaDeviceGetStreamPriorityRange(&prio_lo, &prio_hi) == cudaSuccess) diff --git a/src/core/vmm.cpp b/src/core/vmm.cpp index d66f17b5..9ada955d 100644 --- a/src/core/vmm.cpp +++ b/src/core/vmm.cpp @@ -1,6 +1,6 @@ #include "strata/core/vmm.hpp" -#if !defined(STRATA_USE_HIP) +#if !defined(STRATA_USE_HIP) && !defined(STRATA_HIP_GFX906) #include #include diff --git a/src/kernels/cuda/fused_gr.cu b/src/kernels/cuda/fused_gr.cu index a00c4242..210cf228 100644 --- a/src/kernels/cuda/fused_gr.cu +++ b/src/kernels/cuda/fused_gr.cu @@ -1740,7 +1740,7 @@ bool fused_gr_read_multi(const FusedGrArgs* a, int n_tok, float* xn_scratch, voi std::fprintf(stderr, "fused_gr_read_multi: %s\n", cudaGetErrorString(e)); std::exit(1); } - return; + return false; // the gfx906 STRATA_GR_SPLIT read: no q8_1 (the caller quantizes), like the v3 path above } #endif // the default read (STRATA_GR_V3 unset): v1, or the bitwise-equal v2 / v3 this card's check accepted