Repository navigation
cuda: clear error for sm_6x and older (Pascal) instead of an NVRTC compile failure - #28
Merged
Merged
Conversation
On a GTX 1080 Ti (sm_61) `--backend cuda` printed `sm_61 (Volta, m8n8k4)` and then failed inside NVRTC with `identifier "__nanosleep" is undefined`. `Gpu::new` now returns a "CUDA init" error that names the card and the sm_70 minimum before anything is compiled, so `backend::open` goes on to Vulkan and reports both errors, and the tests skip the backend. `device_log` no longer labels a pre-Volta arch as Volta. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014eNPMupWL2tifApEBfcCgi
Member
|
Looks good, and I agree with keeping it non-fatal — the CUDA init context makes the auto path try Vulkan and lets the tests skip. Two small things: maybe drop the "no tensor cores" justification and just say sm_70+ is required, and update the 1080 Ti note in #27/SUPPORTED_GPUS so it says it's rejected at init instead of failing in NVRTC. Unit tests pass here (27/27). Mergeable from my side. |
Vasyl-Trefilov
pushed a commit
that referenced
this pull request
Nov 18, 2026
Vasyl-Trefilov
pushed a commit
that referenced
this pull request
Nov 18, 2026
Vasyl-Trefilov
pushed a commit
that referenced
this pull request
Nov 18, 2026
* feat(cuda): inject tiles from Rust and set the preferred carveout Make GEMM_BM/GEMM_BK/FA_BQ/FA_BK Rust-owned #defines injected by source(), with #ifndef guards and static_asserts in kernels.cu. Add attn_prefill_smem() as the single owner of the qs/ks/vs/ps layout, shared by dyn_shmem_need and attn_prefill_m, so the hardcoded FA_BK in the opt-in cannot desync again. Add the pure carveout() decision and set CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT per loaded Volta function, logged next to the opt-in. C1/C2/C3 are selectable for the measurement window via STRATA_SMEM_CARVEOUT, STRATA_GEMM_MIN_BLOCKS and STRATA_GEMM_BK; the shipped defaults and the sm_80+ codegen are unchanged. * fix(cuda): ship the measured carveout default (off) The M2-T3 window rejected every carveout candidate: the driver already picks the smallest fitting configuration, and an explicit request cost 1.15 % at pp 512 with no pp 4096 win. Keep the pure decision and the log, but leave the driver default unless STRATA_SMEM_CARVEOUT=policy|min selects an experiment. * docs: record M2-T3 carveout and tile measurements Baseline vs C1/C2/C3 numbers, res-usage/occupancy, the adopted (none) and rejected decisions with reasons, correctness and Xid status.
Vasyl-Trefilov
pushed a commit
that referenced
this pull request
Nov 18, 2026
Vasyl-Trefilov
added a commit
that referenced
this pull request
Nov 18, 2026
cuda: clear error for sm_6x and older (Pascal) instead of an NVRTC compile failure
Vasyl-Trefilov
added a commit
that referenced
this pull request
Nov 20, 2026
cuda: clear error for sm_6x and older (Pascal) instead of an NVRTC compile failure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #27, as agreed there.
What it does
On a card older than Volta the CUDA backend now stops before compiling anything:
Before, the same command printed
cuda device 0: NVIDIA GeForce GTX 1080 Ti, sm_61 (Volta, m8n8k4)and failed in NVRTC withidentifier "__nanosleep" is undefined.min_arch_error(name, cc)insrc/cuda/mod.rs, called inGpu::newright aftercompute_capability().CUDA initcontext, like a missing driver or a missing NVRTC. So without--backend,backend::opengoes on to Vulkan and, when that fails too (on this card it does,missing shaderFloat16), prints both reasons. The tests skip the CUDA backend on such a card instead of failing. Say if you would rather have it fatal.device_logno longer labels cc < 7.0 as Volta.Gpu::newdoes not reach it for such a card any more, so this is only a guard.No change for sm_70 and newer.
Tested
bench --backend cudagives the error above;benchwithout--backendgivesno GPU backend loads: CUDA: CUDA init: NVIDIA GeForce GTX 1080 Ti is sm_61: ...; Vulkan: Vulkan init: no usable Vulkan device 0 (0 usable; NVIDIA GeForce GTX 1080 Ti: missing shaderFloat16);cargo test --test kernelsskips both backends (26 passed).benchwith--backend cuda, without--backend, and with--backend vulkanrun as before.min_arch_error,arch_support_erroranddevice_logpass on both hosts (3 are new).--test kernelshas the 4 Vulkan f16 failures ofmainthat docs: RTX 2080 Ti, Quadro RTX 6000, V100, A40, RTX A6000, RTX 4500 Ada and A100 40 GB results; GTX 1080 Ti does not run #27 fixes; nothing else fails there.🤖 Generated with Claude Code
https://claude.ai/code/session_014eNPMupWL2tifApEBfcCgi