fix(cuda.core): declare cdef attrs for system event wrappers and decode packed gpu_id - #2606
Open
rluo8 wants to merge 4 commits into
Open
fix(cuda.core): declare cdef attrs for system event wrappers and decode packed gpu_id#2606rluo8 wants to merge 4 commits into
rluo8 wants to merge 4 commits into
Conversation
Contributor
Author
|
Hi @mdboom , this issue is about system event. Could you please help review it? |
|
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
Two issues were found when adding coverage tests (internal bug 6595639):
Missing
cdefattributes onSystemEvent,SystemEvents,EventData, andDeviceAttributes. These are Cythoncdef classtypes (no__dict__), so undeclaredself._event_data/self._attributesassignments raiseAttributeError.RegisteredSystemEvents.wait()therefore crashes as soon as a real bind/unbind event arrives.SystemEvent.devicetype mismatch. NVML's packed intgpu_id(domain[31:16] | bus[15:8] | device[7:0]), which requires an NVML-style PCI bus ID string (NVML_DEVICE_PCI_BUS_ID_FMT). Decode at the call site via_pci_bus_id_from_gpu_id.Adds regression tests for construction, packing decode, and end-to-end
SystemEvent.deviceresolution against livepci_info.Verification:
0000:c1:00.0yields
SystemEventswithgpu_id=0xC100→00000000:C1:00.0, andpost-rebind
SystemEvent.deviceresolves correctlyDeviceAttributescdef fix verified