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. |
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