Fix peer access test synchronization issue#1573
Closed
rwgk wants to merge 1 commit intoNVIDIA:mainfrom
Closed
Conversation
Add missing device synchronization calls to ensure resident device operations are complete before peer device accesses memory. The test was failing because when dev0 accesses peer memory from dev1, PatternGen only syncs dev0 (the accessing device) but not dev1 (the resident device). This can cause synchronization issues where dev0 reads peer memory before dev1 has completed all operations. Changes: - Sync dev1 after IPC import (Test 1) to ensure import operations complete - Sync dev1 after granting peer access (Test 3) before dev0 accesses peer memory This follows CUDA best practices: when accessing peer memory, sync the resident device to ensure its operations are complete before the peer device reads the memory. Fixes test failures on ARM64 with CUDA 13.2 RC025. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
|
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. |
Collaborator
Author
|
/ok to test |
|
Andy-Jost
reviewed
Feb 5, 2026
Comment on lines
+97
to
+98
| # Sync dev1 to ensure IPC import operations are complete | ||
| dev1.sync() |
Contributor
There was a problem hiding this comment.
This should not be needed. For one thing, IPC import APIs are synchronous; for another, verify_buffer in the next line synchronizes device 1
See lines 65 and 82 in
cuda-python/cuda_core/tests/helpers/buffers.py
Lines 61 to 66 in eec6988
and
cuda-python/cuda_core/tests/helpers/buffers.py
Lines 74 to 83 in eec6988
Comment on lines
+111
to
+113
| # Sync dev1 to ensure peer access setup and any pending operations are complete | ||
| # before dev0 accesses the peer memory | ||
| dev1.sync() |
Contributor
There was a problem hiding this comment.
I think this is also not needed. Peer accessibility APIs are synchronous.
github-actions bot
pushed a commit
that referenced
this pull request
Feb 6, 2026
Removed preview folders for the following PRs: - PR #1573
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.
This Cursor-generated change is expected to resolve failures in QA environments (nvbug 5821337).
Problem
The test
TestBufferPeerAccessAfterImport::test_mainwas failing with assertion errors indicating memory comparison failures. The root cause is most likely a synchronization issue when accessing peer memory.When
dev0accesses peer memory fromdev1,PatternGen.verify_buffer()only synchronizesdev0(the accessing device) but notdev1(the resident device). This can cause synchronization issues wheredev0reads peer memory beforedev1has completed all operations, leading to incorrect data being read.Changes
dev1.sync()call after IPC import (Test 1)dev1.sync()call after granting peer access (Test 3) beforedev0accesses peer memoryThis follows CUDA best practices: when accessing peer memory, sync the resident device to ensure its operations are complete before the peer device reads the memory.