Enable dtrace for npu3#9888
Open
garimadhaked wants to merge 3 commits into
Open
Conversation
garimadhaked
commented
Jun 30, 2026
Collaborator
- Enable dtrace plugin for NPU3
- Fix dtrace run hooks polling an unsubmitted command
- get_xdp_kernel_data() called run_impl->state(), which polls the hwqueue. The XDP dtrace run_constructor/run_start hooks fire from the run_impl constructor and immediately before submit, when the command has no fence id yet. Polling it threw 'Cannot poll a command that has not been submitted', breaking HW-context/runner creation (e.g. FlexMLRT) when aie_dtrace was enabled.
Wire up the AIE dtrace plugin in the client build path so it is loaded when Debug.aie_dtrace is enabled. dtrace::load() now selects the loader based on build type (sdk_loader on client Windows, module_loader otherwise) and picks the NPU3-specific plugin name via AMD_XDP_NPU3, matching the existing aie_profile/aie_trace/aie_halt plugins.
get_xdp_kernel_data() called run_impl->state(), which polls the hwqueue. The XDP dtrace run_constructor/run_start hooks fire from the run_impl constructor and immediately before submit, when the command has no fence id yet. Polling it threw 'Cannot poll a command that has not been submitted', breaking HW-context/runner creation (e.g. FlexMLRT) when aie_dtrace was enabled. Read the cached ERT packet state directly instead of polling.
stsoe
requested changes
Jun 30, 2026
Address review feedback: std::getenv is not permitted; switch to the xrt_core::utils env helpers (is_env for boolean checks, getenv for value comparison) and drop the now-unneeded cstring/cstdlib includes and the getenv MSVC warning suppression. Signed-off-by: Garima Dhaked <garima.dhaked@amd.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
|
clang-tidy review says "All clean, LGTM! 👍" |
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.