cuda.core: fix build compatibility with cuda-bindings 13.0.x - #2700
Open
andre-motta wants to merge 1 commit into
Open
cuda.core: fix build compatibility with cuda-bindings 13.0.x#2700andre-motta wants to merge 1 commit into
andre-motta wants to merge 1 commit into
Conversation
Build hooks now extract and pass CUDA_CORE_BUILD_MINOR alongside CUDA_CORE_BUILD_MAJOR so Cython compile-time conditionals can distinguish 13.0 from 13.1+. Ten guards in _device_resources.pyx that referenced 13.1-only declarations (workqueue types, CUdevSmResource.flags, CU_DEV_SM_RESOURCE_GROUP_PARAMS) are tightened from >= 13 to >= 13.1. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Andre Lustosa <alustosa@redhat.com>
Contributor
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.
Description
closes #2699
Building
cuda-corefrom source againstcuda-bindings==13.0.xfails at Cython compilation time becausebuild_hooks.pyonly passesCUDA_CORE_BUILD_MAJORto Cython, making it impossible to distinguish 13.0 from 13.1+. TenIF CUDA_CORE_BUILD_MAJOR >= 13:guards in_device_resources.pyxreference types only available in cuda-bindings 13.1+ (workqueue types,CUdevSmResource.flags,CU_DEV_SM_RESOURCE_GROUP_PARAMS).This is distinct from the runtime import fix in #2064 -- that addressed
cuDevSmResourceSplitnot being found at import time via PyCapsule. This PR fixes the build-time failure.Changes:
build_hooks.py: Refactor_determine_cuda_major_versioninto_determine_cuda_versionthat returns(major, minor). Extract minor version fromCUDA_VERSIONmacro (e.g. 13000 -> minor 0, 13010 -> minor 1). PassCUDA_CORE_BUILD_MINORalongsideCUDA_CORE_BUILD_MAJORin Cython'scompile_time_env. Also supports explicit override viaCUDA_CORE_BUILD_MINORenv var whenCUDA_CORE_BUILD_MAJORis set._device_resources.pyx: Tighten 10 guards fromIF CUDA_CORE_BUILD_MAJOR >= 13:toIF CUDA_CORE_BUILD_MAJOR > 13 or (CUDA_CORE_BUILD_MAJOR == 13 and CUDA_CORE_BUILD_MINOR >= 1):for code that uses 13.1-only declarations. The remaining 40+>= 13guards across other files are unaffected (they use only types present in 13.0).Checklist