mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #1071] vmm.cpp: the CUDA 12 engine does not build with a toolkit older than 12.5 (missing CUDART_VERSION guard) #458
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#458
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @zhouxihong1 on GitHub (Oct 6, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/1071
Problem
Building the experimental CUDA 12 engine (
--cuda 12) with a toolkit older than CUDA 12.5 fails on the newsrc/core/vmm.cpp:cudaGetDriverEntryPointByVersionarrived in CUDA 12.5. The same call is already version-gated one file over:src/core/vmm.cpp:28misses that guard. Both files resolve the same driver entry points (cuDeviceGetAttribute,cuMemGetAllocationGranularity,cuMemAddressReserve,cuMemAddressFree,cuMemCreate,cuMemRelease,cuMemMap,cuMemUnmap,cuMemSetAccess), so the#elsepattern is already the one that ships next door.Why it is a regression:
src/core/vmm.cppis new in 0.1.40 (added in1735d64, the release tip). 0.1.39 built with CUDA 12.2; 0.1.40 does not. (This also matches #1066, which hits the same new file from the gfx906 side.)Also inconsistent with setup.py:
setup.py:2505accepts CUDA 12.0 for arch < 120:while the code needs 12.5.
docs/OLDER_GPUS.md:34and the--buildfailure message (setup.py:2514, "install CUDA 12.9") both say the CUDA 12 engine is built with CUDA 12.9 — the check is simply too permissive.Fix
The same guard as
expert_cache.cpp:cudaGetDriverEntryPoint(name, &p, cudaEnableDefault, &q)returns the entry point for the runtime's own version; the pinned12000asks for the CUDA 12.0 ABI of the same symbol, and thesecu*VMM entry points have stable signatures across 12.x. On CUDA >= 12.5 the guard takes exactly today's call, so it only affects older toolkits.Scope / safety
vmm.cppchanges. The HIP path is inside#if !defined(STRATA_USE_HIP)at the top of the file and is untouched.CUDART_VERSION >= 12050) the compiled code is identical to today's, so CUDA 13 and the ready-made engines are unaffected.STRATA_HIP_GFX906gate rather than aCUDART_VERSIONone).Verified
-std=c++2a), CUDA Toolkit 12.2,--cuda 12,--layer-split 12,24,36, engine v0.1.40 (1735d647).src/core/vmm.cppcompiles and the build proceeds past51/136.vmm.cpp:43instantiatesresolve("cuDeviceGetAttribute", attr)fromapi().Workaround for anyone on CUDA 12.0-12.4 today: build with CUDA 12.9 as
docs/OLDER_GPUS.mdintends, or carry the guard above locally.@Niko1221 commented on GitHub (Oct 7, 2026):
Fixed in 0.1.40.2: vmm.cpp now uses cudaGetDriverEntryPointByVersion only from CUDA 12.5 (CUDART_VERSION >= 12050) and cudaGetDriverEntryPoint below it, the same fallback expert_cache.cpp already had. Thanks for the patch, zhouxihong1 is credited as co-author.