From a751fbb128598b0dc494e50e70f51d6abce3e32a Mon Sep 17 00:00:00 2001 From: Niko1221 Date: Mon, 5 Oct 2026 13:59:39 +0200 Subject: [PATCH] gfx906 compat build: s26_tsum.cuh takes its AMD branch only on gfx10+ (permlanex16 / DPP), device_free_bytes skips the integrated-GPU attribute the compat layer lacks Compile check on ROCm 7.14.1 (Aurora): f-140 itself stops in fused_gr.cu (12 errors) and mtp.cpp (2) for gfx906 there; with this commit the port adds no error of its own (fused_gr.cu's pre-existing ones remain). --- docs/AMD_HIP.md | 2 +- src/core/expert_cache.cpp | 2 +- src/kernels/cuda/s26_tsum.cuh | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/AMD_HIP.md b/docs/AMD_HIP.md index 35b06264..e08f5fbe 100644 --- a/docs/AMD_HIP.md +++ b/docs/AMD_HIP.md @@ -6,7 +6,7 @@ RX 9070 / 9070 XT / Radeon AI PRO R9700 (RDNA4, gfx1201; see [RDNA4](#rdna4-gfx1 (gfx1101) and the RX 9060 XT (gfx1200) were validated by their owners (see [Community-validated cards](#community-validated-cards)); the RX 6800 / 6900 series (RDNA2, gfx1030) builds and runs too, reported by a community machine and not yet validated by the maintainers (see [RDNA2](#rdna2-gfx1030)). Setup chooses it by itself on a PC with no NVIDIA card Strata can use (`--backend hip` on a PC with both); the install steps for users are in [INSTALL.md](INSTALL.md#amd-cards). gfx906 (Instinct MI50 / MI60, Radeon VII; wave64) has a separate -opt-in build, see [gfx906](#gfx906-instinct-mi50--mi60-radeon-vii-wave64-built-from-source). Other AMD architectures and mixed +opt-in build, see [gfx906](#gfx906-instinct-mi50--mi60-radeon-vii-wave64-built-from-source). The Ryzen AI Max "Strix Halo" APU (gfx1151, RDNA3.5, unified memory) is built from source on Linux: see [STRIX_HALO.md](STRIX_HALO.md). Other AMD architectures and mixed AMD/NVIDIA execution in one run are not supported. The backend maps the CUDA-shaped runtime and BLAS calls to HIP/hipBLAS, uses diff --git a/src/core/expert_cache.cpp b/src/core/expert_cache.cpp index fed6c43a..c64b5ac4 100644 --- a/src/core/expert_cache.cpp +++ b/src/core/expert_cache.cpp @@ -28,7 +28,7 @@ namespace strata::core { size_t device_free_bytes() { size_t free_b = 0, total_b = 0; cudaMemGetInfo(&free_b, &total_b); -#if defined(__linux__) +#if defined(__linux__) && !defined(STRATA_HIP_GFX906) // (the gfx906 compat layer has no cudaDevAttrIntegrated; that GPU is discrete) // per device: a box can mix an integrated GPU (an APU) with a discrete one, and the answer is the CURRENT device's static std::atomic uma_cache[64]; // 0 unknown, 1 integrated (unified memory), 2 discrete bool unified_memory = false; diff --git a/src/kernels/cuda/s26_tsum.cuh b/src/kernels/cuda/s26_tsum.cuh index 575ec8e2..f484492b 100644 --- a/src/kernels/cuda/s26_tsum.cuh +++ b/src/kernels/cuda/s26_tsum.cuh @@ -7,9 +7,11 @@ // DPP row_xmask / permlanex16 instead of ds_bpermute. #pragma once +#include // (before the first use of __forceinline__ / __float_as_int: a gfx906 build gets them from its shim) + namespace strata::kernels::s26ts { -#if defined(__HIP_PLATFORM_AMD__) +#if defined(__HIP_PLATFORM_AMD__) && !defined(STRATA_HIP_GFX906) // (permlanex16 / DPP row_xmask: gfx10+ only) __device__ __forceinline__ float xmov16(float v) { return __int_as_float(__builtin_amdgcn_permlanex16(__float_as_int(v), __float_as_int(v), 0x76543210u, 0xfedcba98u, false, false));