-
Notifications
You must be signed in to change notification settings - Fork 54
Add deadlock warnings to Stream.add_callback and Stream.async_done docstrings #321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
…cstrings - Add warning about potential deadlock when using libraries that call CUDA functions without releasing the GIL - This can occur when callback functions attempt to acquire the GIL while another thread is holding it and making CUDA calls - Recommends using libraries that properly release the GIL around CUDA operations
|
Auto-sync is disabled for ready for review pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
- Clarify that deadlock is due to lock ordering issue between GIL and CUDA driver lock - Remove reference to 'another thread attempting to make CUDA calls' as this is not required - Focus on the core issue: callback acquiring GIL while CUDA driver lock is held
Contributor
|
/ok to test |
gmarkall
approved these changes
Jul 18, 2025
gmarkall
added a commit
to gmarkall/numba-cuda
that referenced
this pull request
Jul 18, 2025
- Add deadlock warnings to Stream.add_callback and Stream.async_done docstrings (NVIDIA#321) - `MemoryPointer`: ensure `CUdeviceptr` used with NVIDIA binding (NVIDIA#328) - Fix indexing GPUs with CUdevice object (NVIDIA#319) - Fix bindings: consistency of contexts, streams, and events, similar to NVIDIA#295 (NVIDIA#296) - Fix nvrtc resolution when CUDA_HOME env is set (NVIDIA#314)
Merged
gmarkall
added a commit
that referenced
this pull request
Jul 18, 2025
- Add deadlock warnings to Stream.add_callback and Stream.async_done docstrings (#321) - `MemoryPointer`: ensure `CUdeviceptr` used with NVIDIA binding (#328) - Fix indexing GPUs with CUdevice object (#319) - Fix bindings: consistency of contexts, streams, and events, similar to #295 (#296) - Fix nvrtc resolution when CUDA_HOME env is set (#314)
atmnp
pushed a commit
to atmnp/numba-cuda
that referenced
this pull request
Jul 21, 2025
…cstrings (NVIDIA#321) * Add deadlock warnings to Stream.add_callback and Stream.async_done docstrings - Add warning about potential deadlock when using libraries that call CUDA functions without releasing the GIL - This can occur when callback functions attempt to acquire the GIL while another thread is holding it and making CUDA calls - Recommends using libraries that properly release the GIL around CUDA operations * Update docstring warnings to clarify lock ordering issue - Clarify that deadlock is due to lock ordering issue between GIL and CUDA driver lock - Remove reference to 'another thread attempting to make CUDA calls' as this is not required - Focus on the core issue: callback acquiring GIL while CUDA driver lock is held
atmnp
pushed a commit
to atmnp/numba-cuda
that referenced
this pull request
Jul 21, 2025
- Add deadlock warnings to Stream.add_callback and Stream.async_done docstrings (NVIDIA#321) - `MemoryPointer`: ensure `CUdeviceptr` used with NVIDIA binding (NVIDIA#328) - Fix indexing GPUs with CUdevice object (NVIDIA#319) - Fix bindings: consistency of contexts, streams, and events, similar to NVIDIA#295 (NVIDIA#296) - Fix nvrtc resolution when CUDA_HOME env is set (NVIDIA#314)
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.
This PR adds important deadlock warnings to the docstrings of Stream.add_callback and Stream.async_done methods.
Changes Made
Context
Based on the third bullet point from #317 (comment), these methods need clearer documentation about potential deadlock scenarios when integrating with other CUDA libraries that don't properly handle GIL management.
The warnings help developers understand the threading implications and make informed decisions about their code architecture to avoid deadlocks.
This pull request was generated from Cursor