-
Notifications
You must be signed in to change notification settings - Fork 472
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
Add PID argument to aie mem and reg read/write apis #8275
Conversation
1a5cf86
to
fd0ebd2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For pid
argument, can we use pid_t
? If you include core/include/types.h
there is a typedef even for windows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good! If our tool can grab it from xrt-smi, that will work for us.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use this ticket to track this change
@@ -114,6 +116,7 @@ writeReport(const xrt_core::device* /*_pDevice*/, | |||
const auto& hw_context = pt_hw_context.second; | |||
|
|||
const std::vector<std::string> entry_data = { | |||
hw_context.get<std::string>("pid"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want to print -1 for Ryzen devices. Please do something like:
const auto device_class = xrt_core::device_query_default<xrt_core::query::device_class>(dev, xrt_core::query::device_class::type::alveo);
switch (device_class) {
case xrt_core::query::device_class::type::alveo:
{
hw_context.get<std::string>("pid"),
break;
}
and print this field only if it is populated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @AShivangi , I have already filed a CR to get this info on windows - https://jira.xilinx.com/browse/CR-1204588
If we dont print PID in case of Ryzen devices then users can't provide PID arg and the debug apis behavior will be different on different platforms. So added changes this way.
But that said I am holding off this PR till PID support is added in windows, there is discussion going on this and if it is difficult to provide PID in MCDM flow they will provide some unique identifier in its place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, sounds good!
03be732
to
046b082
Compare
In both Linux and Windows we print PID now using xrt-smi, the same can be provided to debug apis. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So are these APIs are called from a different process compared to the process that opened the hw_context (the pid argument)?
@rbramand-xilinx, can you please update the description of this PR? It looks old |
Yes Soren, it will be called from debugger process. Pair <context id, pid> uniquely identifies a hw_context |
Signed-off-by: rbramand <[email protected]>
Signed-off-by: rbramand <[email protected]>
046b082
to
41a324a
Compare
Problem solved by the commit
Added PID argument to aie debug apis to uniquely identify hw ctx.
Bug / issue (if any) fixed, which PR introduced the bug, how it was discovered
How problem was solved, alternative solutions (if any) and why they were rejected
Context ID alone doesn't uniquely identify a hw context as per driver implementation, so added extra PID arg to debug APIs.
Risks (if any) associated the changes in the commit
Low
What has been tested and how, request additional testing if necessary
Tested the flow on both Linux and windows and the apis work as expected.
Documentation impact (if any)
Added doxygen comment for the arg added