Is this a duplicate?
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.flags field
CU_DEV_SM_RESOURCE_GROUP_PARAMS struct
CUdevSmResourceGroup_flags enum
CUdevWorkqueueConfigScope enum
CUdevWorkqueueConfigResource / CUdevWorkqueueResource structs
CU_DEV_RESOURCE_TYPE_WORKQUEUE_CONFIG / CU_DEV_RESOURCE_TYPE_WORKQUEUE enum values
CUdevResource_st.wqConfig, .wq fields
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_HOME points to a 13.0 installation)
pip install cuda-bindings==13.0.3
- Attempt to build
cuda-core from 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.
Is this a duplicate?
Type of Bug
Compile-time Error
Component
cuda.core
Describe the bug
Building
cuda-corefrom source againstcuda-bindings==13.0.xfails at Cython compilation time. This is distinct from the runtime import failure fixed in #2063/#2064 -- that fix addressedcuDevSmResourceSplitnot being found at import time. This issue is about the build itself failing.The root cause is that
build_hooks.pyonly passesCUDA_CORE_BUILD_MAJOR(integer 12 or 13) to Cython's compile-time environment. SeveralIF CUDA_CORE_BUILD_MAJOR >= 13:guards in_device_resources.pyxreference types, enum values, and struct fields that were only introduced incuda-bindings 13.1.0, not13.0.x.When building with CUDA 13.0 headers,
CUDA_CORE_BUILD_MAJORis set to13, which activates all>= 13guards, 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,.wqfieldsNone of these exist in
cuda-bindings 13.0.x'scydriver.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
CUDA_HOMEpoints to a 13.0 installation)pip install cuda-bindings==13.0.3cuda-corefrom source:pip install --no-binary cuda-core cuda-corecydriver.pxdExpected behavior
cuda-coreshould build successfully against anycuda-bindings 13.0.xrelease, 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.