From f1bbe33557067a5b9b9ea197e641411e65b72792 Mon Sep 17 00:00:00 2001 From: Carson McNeil Date: Tue, 2 Jun 2026 18:13:09 +0000 Subject: [PATCH 1/2] Build native cubins for Ada (sm_89) and Hopper (sm_90) CMAKE_CUDA_ARCHITECTURES was 75 only (Turing/T4 CI runner), so the wheel ships an sm_75 cubin + compute_75 PTX and nothing else. On a non-Turing GPU the driver must JIT that PTX, and a JIT requires a driver at least as new as the build toolkit. On an L4 (sm_89) with Dataflow's R535 / CUDA 12.2 driver, JITing this package's CUDA 12.x PTX fails at kernel launch with cudaErrorUnsupportedPtxVersion (code 222). Add sm_89 (Ada: L4, RTX 40-series) and sm_90 (Hopper: H100/H200) so those GPUs load native SASS with no JIT, independent of driver version. Native cubins are gated only by hardware support, so an R535-class driver runs them fine. Verified locally: ptxas compiles this package's PTX to both sm_89 and sm_90, and a beamform on sm_89 hardware (RTX 4090) produces bit-identical output to the JIT'd sm_75+PTX path. --- CMakeLists.txt | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index db59017..7132150 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,9 +52,19 @@ set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS_INIT} ${CMAKE_CUDA_FLAGS}") set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --ptxas-options=-v") # debug info set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --generate-line-info") -# Compute-capability 7.5+, to support Github T4 runner +# Build native SASS for every GPU we deploy on. Shipping a native cubin per +# arch avoids relying on PTX JIT at load time -- a JIT only happens when no +# cubin matches the device, and it requires a driver at least as new as the +# build toolkit. A device whose arch has no cubin therefore fails on an older +# driver: e.g. an L4 (sm_89) on an R535/CUDA-12.2 driver (the version Dataflow +# ships) cannot JIT this package's CUDA-12.x PTX and dies with +# cudaErrorUnsupportedPtxVersion. Native cubins are gated only by hardware +# support, so they run regardless of driver age. +# 75 = Turing (T4; GitHub CI runner) +# 89 = Ada (L4, A40, RTX 40-series) +# 90 = Hopper (H100/H200) # https://developer.nvidia.com/cuda-gpus -set(CMAKE_CUDA_ARCHITECTURES 75) +set(CMAKE_CUDA_ARCHITECTURES 75 89 90) # nanobind requires GCC 8+ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") From ad6cf68dfeb79b259ea63910f28a1d7d4c807d10 Mon Sep 17 00:00:00 2001 From: Carson McNeil Date: Tue, 2 Jun 2026 18:26:31 +0000 Subject: [PATCH 2/2] Shrink excessive comment. --- CMakeLists.txt | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7132150..927eabb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,15 +55,7 @@ set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --generate-line-info") # Build native SASS for every GPU we deploy on. Shipping a native cubin per # arch avoids relying on PTX JIT at load time -- a JIT only happens when no # cubin matches the device, and it requires a driver at least as new as the -# build toolkit. A device whose arch has no cubin therefore fails on an older -# driver: e.g. an L4 (sm_89) on an R535/CUDA-12.2 driver (the version Dataflow -# ships) cannot JIT this package's CUDA-12.x PTX and dies with -# cudaErrorUnsupportedPtxVersion. Native cubins are gated only by hardware -# support, so they run regardless of driver age. -# 75 = Turing (T4; GitHub CI runner) -# 89 = Ada (L4, A40, RTX 40-series) -# 90 = Hopper (H100/H200) -# https://developer.nvidia.com/cuda-gpus +# build toolkit. set(CMAKE_CUDA_ARCHITECTURES 75 89 90) # nanobind requires GCC 8+