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

Error out of counter splitting if group max is zero #70

Merged

Conversation

jcortell68
Copy link
Contributor

A counter group having a counter max of zero is invalid and will ultimately result in a hang when we try to split counters into multiple passes. This is one of various scenarios that result in a hang during counter splitting; see

#69

This fixes only that specific scenario. We now check that the group max isn't zero, and if it is, we give up trying to split a public counter's HW counters into multiple passes. We log an error, too.

Again, this isn't a comprehensive fix for issue 69. There could be other cases of bad data that result in a hang. Issue 69 should be fixed with a pass cap limit to cover all cases. But this commit still adds value in that it flags the specific invalid GPU counter metadata in addition to avoiding the hang.

Change-Id: I56d7d2043ba92c1b6088f0fdd68f5ec844e7b823

A counter group having a counter max of zero is invalid and
will ultimately result in a hang when we try to split counters
into multiple passes. This is one of various scenarios that
result in a hang during counter splitting; see

 GPUOpen-Tools#69

This fixes only that specific scenario. We now check that the
group max isn't zero, and if it is, we give up trying to split
a public counter's HW counters into multiple passes. We log
an error, too.

Again, this isn't a comprehensive fix for issue 69. There could
be other cases of bad data that result in a hang. Issue 69 should
be fixed with a pass cap limit to cover all cases. But this
commit still adds value in that it flags the specific invalid GPU
counter metadata in addition to avoiding the hang.

Change-Id: I56d7d2043ba92c1b6088f0fdd68f5ec844e7b823
Fixed constant name and log statement
Copy link
Contributor

@PLohrmannAMD PLohrmannAMD left a comment

Choose a reason for hiding this comment

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

A couple nitpicky requests that I should have picked up on in the earlier review - Please remove "ERROR: " from the error messages, capitalize the new first word, and please end the message with a period.

Since they are being reported as a DEBUG_ERROR, the "ERROR:" string is redundant. We chose to let the application decide if/how they want to put additional formatting around the messages being reported.

We actually have a unit test that would confirm that any messages that are output will end with a period, but obviously this particular message is unlikely to be encountered by that test.

Also added missing GPA_ENUM_STRING_VAL for new error code
@jcortell68
Copy link
Contributor Author

Sure thing. Done. I also realized I neglected to add a GPA_ENUM_STRING_VAL for the new error code

@PLohrmannAMD PLohrmannAMD merged commit e86117e into GPUOpen-Tools:master Jul 1, 2024
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.

2 participants