[BUG]: cuda.core fails to build from source against cuda-bindings 13.0.x
Nobody has claimed this yet.
- Dominant language
- Cython
- Stars
- 3.4k
- Forks
- 329
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 116
Description
Is this a duplicate?
- I confirmed there appear to be no duplicate issues for this bug and that I agree to the Code of Conduct
Type of Bug
Compile-time Error
Component
cuda.core
Describe the bug
Building cuda-core from source against cuda-bindings==13.0.x fails at Cython compilation time. This is distinct from the runtime import failure fixed in #2063/#2064 -- that fix addressed cuDevSmResourceSplit not being found at import time. This issue is about the build itself failing.
The root cause is that build_hooks.py only passes CUDA_CORE_BUILD_MAJOR (integer 12 or 13) to Cython's compile-time environment. Several IF CUDA_CORE_BUILD_MAJOR >= 13: guards in _device_resources.pyx reference types, enum values, and struct fields that were only introduced in cuda-bindings 13.1.0, not 13.0.x.
When building with CUDA 13.0 headers, CUDA_CORE_BUILD_MAJOR is set to 13, which activates all >= 13 guards, including those that reference:
CUdevSmResource_st.flagsfieldCU_DEV_SM_RESOURCE_GROUP_PARAMSstructCUdevSmResourceGroup_flagsenumCUdevWorkqueueConfigScopeenumCUdevWorkqueueConfigResource/CUdevWorkqueueResourcestructsCU_DEV_RESOURCE_TYPE_WORKQUEUE_CONFIG/CU_DEV_RESOURCE_TYPE_WORKQUEUEenum valuesCUdevResource_st.wqConfig,.wqfields
None of these exist in cuda-bindings 13.0.x's cydriver.pxd, causing Cython to fail.
The issue is scoped to 10 guards, all in _device_resources.pyx. The remaining 40+ IF CUDA_CORE_BUILD_MAJOR >= 13: guards across the codebase (graph, memory, tensor_map, device modules) use only types available in cuda-bindings 13.0.x and are unaffected.
How to Reproduce
- Install CUDA 13.0 toolkit (so
CUDA_HOMEpoints to a 13.0 installation) pip install cuda-bindings==13.0.3- Attempt to build
cuda-corefrom source:pip install --no-binary cuda-core cuda-core - Cython compilation fails with errors about unknown types/fields from
cydriver.pxd
Expected behavior
cuda-core should build successfully against any cuda-bindings 13.0.x release, with 13.1+ features gracefully disabled at compile time.
System information
Any system with CUDA 13.0 toolkit and cuda-bindings 13.0.x installed.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with build_hooks.py and the 10 CUDA_CORE_BUILD_MAJOR guards in _device_resources.pyx. Reproduce with CUDA 13.0 and cuda-bindings==13.0.3 using pip install --no-binary cuda-core cuda-core, then inspect the Cython errors. Done means cuda-core builds successfully against cuda-bindings 13.0.x while 13.1-only features remain disabled.
Written by the indexing model from the issue text.
Assessment
- Domain
- build-system, compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100