1 Commits
Author SHA1 Message Date
Niko1221 a8371d27fa fix(inkling2, hy4): say plainly when the binary has no GPU code for the card, before anything loads (#6759)
A CUDA engine binary is built for a list of architectures (the CUDA 13 packages: sm_75 and newer; the CUDA 12 ones also
sm_60/61/70). On a card it holds no code for, the weights load and the first kernel fails; strata-inkling then ended with a
misleading "CUDA error 2 (out of memory)" in the loader, and a binary that gets past that (lazy module loading, as under
volta-forever) leaves the logits at 0 and answers token id 0 forever, with no error.

strata/core/arch_probe.hpp builds the message; strata-inkling (ink_cuda_backend.cu) and strata-hy4 (hy4_main.hip.cpp, CUDA
builds, serve and CLI, every GPU named) ask CUDA for the attributes of a probe kernel (cudaFuncGetAttributes), which answers
for the whole binary, and end with: "this strata-inkling has no GPU code for <card> (compute capability X.Y): <cuda error>.
<way out>" (a Pascal / Volta card: the CUDA 12 engine package or a CUDA 12.x build with -DSTRATA_EXPERIMENTAL_SM60=ON; else
the package made for the card or a rebuild for that architecture). strata (generate.cpp, the Qwen engine) already did this
(device_code_error()).

Test arch_probe_test (no GPU): the message names engine, card, compute capability, CUDA error and the way out; the Volta
text appears only below 7.5.

Measured on an RTX 4090 (sm_89) with binaries built for sm_120 only (no SASS for the card, PTX compute_120 cannot run on it):
- strata-inkling, origin/main: "strata-inkling CUDA error 2 at ink_runner.cuh:322: out of memory", exit 1.
- strata-inkling, this change: "init: this strata-inkling has no GPU code for NVIDIA GeForce RTX 4090 (compute capability 8.9):
  invalid resource handle. Use the engine package made for this card ... -DCMAKE_CUDA_ARCHITECTURES=89", exit 1, nothing loaded.
- strata-hy4, origin/main: no mention of the card (it goes on to read the model); this change: the same message, as an
  "ERR ..." line in --serve and on stderr in the CLI, exit 1.
2026-11-23 12:20:56 +01:00