fix(cuda.core): clear peer access on recycled pools - #2859
aryanputta wants to merge 1 commit into
Conversation
44eac39 to
47fca25
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 44eac392c7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return {}; | ||
| } | ||
| return wrap_mempool_owned(pool); | ||
| return wrap_mempool_owned(pool, -1); |
There was a problem hiding this comment.
Preserve the owner when wrapping imported device pools
On a multi-GPU host, closing an IPC-imported DeviceMemoryResource passes -1 here, so clear_mempool_peer_access excludes no ordinal and includes the pool's owning device in the descriptor batch. CUDA rejects that entire batch, causing the new warning wrapper to write an error during normal teardown while leaving peer access uncleared for a recycled handle. DeviceMemoryResource.from_allocation_handle already receives the associated device ID, so the import path needs to preserve it for device-backed pools.
Useful? React with 👍 / 👎.
| assert DMR_mempool_get_access(mr, peer.device_id) == "" | ||
|
|
||
|
|
||
| def test_owned_mempool_recycled_peer_access_is_cleared(mempool_device_x2): |
There was a problem hiding this comment.
Mark the new test as agent-authored
This Codex-authored test is added without the required provenance decorator. Add @pytest.mark.agent_authored(model="gpt-5.6-sol") immediately above the function so authorship-based test selection and later review-state updates remain reliable.
AGENTS.md reference: AGENTS.md:L122-L131
Useful? React with 👍 / 👎.
Fixes NVIDIA#2807 Signed-off-by: Aryan Putta <aryansputta@gmail.com>
c103103 to
52d973e
Compare
Fixes #2807
Summary
Clear peer access from an owned memory pool before destroying it without including the pool's owning device in the
cuMemPoolSetAccessdescriptor list.CUDA rejects a batch that contains the owning device with
CUDA_ERROR_INVALID_DEVICE. Because the call's return value was ignored, peer access could remain on a recycled pool handle and affect the next pool that received the same handle. The cleanup call now excludes the owner and uses the existing warning-on-failure wrapper so cleanup failures are visible.Validation
Checklist