Skip to content
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

Merged
merged 2 commits into from
Oct 28, 2024

Conversation

rbramand-xilinx
Copy link
Collaborator

@rbramand-xilinx rbramand-xilinx commented Jul 8, 2024

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

Copy link
Collaborator

@stsoe stsoe left a 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.

Copy link
Member

@hackwa hackwa left a 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.

Copy link
Collaborator

@AShivangi AShivangi left a 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"),
Copy link
Collaborator

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

Copy link
Collaborator Author

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.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, sounds good!

@rbramand-xilinx
Copy link
Collaborator Author

In both Linux and Windows we print PID now using xrt-smi, the same can be provided to debug apis.
Rebased the changes with latest XRT, please review. Thanks

Copy link
Collaborator

@stsoe stsoe left a 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)?

@AShivangi
Copy link
Collaborator

@rbramand-xilinx, can you please update the description of this PR? It looks old

@rbramand-xilinx
Copy link
Collaborator Author

So are these APIs are called from a different process compared to the process that opened the hw_context (the pid argument)?

Yes Soren, it will be called from debugger process. Pair <context id, pid> uniquely identifies a hw_context

@chvamshi-xilinx chvamshi-xilinx merged commit 74ee1ed into Xilinx:master Oct 28, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants