From 941f671d65ab8bd3ded02ee474ce2e24ff0de4b2 Mon Sep 17 00:00:00 2001 From: mikicvi Date: Mon, 28 Sep 2026 19:14:51 +0000 Subject: [PATCH] Accept sm_80+ GPUs at runtime, matching the build guard and the README The CMake arch guard already lets RTX 30 (sm_86) / 40 (sm_89) build - its own comment says the kernels need sm_80 or newer (tf32 mma, bf16 math) - and the README lists RTX 30/40/50 as supported. But device_info() still refused anything with cc_major != 12, so a working Ampere/Ada build died at startup with 'Strata targets sm_120 only'. Relax the runtime check to the kernels' real floor (compute capability 8.0) and align the stale 120-only comments. Verified on RTX A2000 12GB + RTX 3080 10GB (both sm_86), CUDA 12.0, gcc-13, engine 0.1.20 serving daily: TG 21-24 t/s flat 1k-128k, 29.6 t/s code-gen at 81% draft acceptance, PP 375/445 @8k/32k, 8/8 needle retrieval at 113k. --- CMakeLists.txt | 6 +++--- src/core/device.cu | 13 +++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 929d6a6d..e00ec8f1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,9 +4,9 @@ # `strata-pack` are added when their sources exist - a target with no sources would make the build graph # claim something the tree does not have, which is worse than an absent target. # -# CUDA targets arrive in Phase 2 and this build REJECTS any architecture other than 120: the engine is -# written against sm_120 (RTX 5000 / Blackwell) and silently building for an older arch would produce a -# binary that runs and is wrong about its own performance, which is the worst of both outcomes. +# CUDA targets arrive in Phase 2. The kernels need sm_80 or newer (tf32 mma, bf16 math) and the guard +# below refuses anything older: silently building for a pre-Ampere arch would produce a binary that runs +# and is wrong about its own performance, which is the worst of both outcomes. cmake_minimum_required(VERSION 3.24) project(strata VERSION 0.1.20 LANGUAGES CXX) add_compile_definitions(STRATA_VERSION="${PROJECT_VERSION}") diff --git a/src/core/device.cu b/src/core/device.cu index 9b8a5373..1d793ee9 100644 --- a/src/core/device.cu +++ b/src/core/device.cu @@ -30,7 +30,7 @@ DeviceInfo device_info(int ordinal) { int count = 0; check(cudaGetDeviceCount(&count), "cudaGetDeviceCount"); if (count == 0) { - throw CudaError("no CUDA device is present; Strata targets sm_120 (RTX 5000 series)", -1); + throw CudaError("no CUDA device is present; Strata needs an NVIDIA GPU of compute capability 8.0 or newer", -1); } if (ordinal < 0 || ordinal >= count) { throw CudaError("device ordinal " + std::to_string(ordinal) + " is out of range (have " + @@ -56,13 +56,14 @@ DeviceInfo device_info(int ordinal) { check(cudaDriverGetVersion(&d.driver_version), "cudaDriverGetVersion"); check(cudaRuntimeGetVersion(&d.runtime_version), "cudaRuntimeGetVersion"); - // The engine is written against sm_120. Compiling for it is enforced by CMake; RUNNING on something else - // is caught here, because a binary can be carried to a machine with an older card and would otherwise - // silently take whatever path the driver chose. - if (d.cc_major != 12) { + // The kernels need sm_80 or newer (tf32 mma in the attention scorer, bf16 math) - the same floor the + // arch guard in CMakeLists enforces at build time (RTX 30 / 40 / 50). Anything older is caught here, + // because a binary can be carried to a machine with an older card and would otherwise silently take + // whatever path the driver chose. Pre-Blackwell is untested by the author; trust, then verify. + if (d.cc_major < 8) { throw CudaError("device " + d.name + " reports compute capability " + std::to_string(d.cc_major) + "." + std::to_string(d.cc_minor) + - "; Strata targets sm_120 (RTX 5000 series / Blackwell) only", + "; Strata needs an NVIDIA GPU of compute capability 8.0 or newer (RTX 30 / 40 / 50)", -1); } return d;