Skip to content

gpuav: Add ShaderAbort support - #13756

Open
spencer-lunarg wants to merge 1 commit into
KhronosGroup:mainfrom
spencer-lunarg:spencer-lunarg-abort
Open

spencer-lunarg wants to merge 1 commit into
KhronosGroup:mainfrom
spencer-lunarg:spencer-lunarg-abort

Conversation

@spencer-lunarg

@spencer-lunarg spencer-lunarg commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

This adds a new opt-in option that will work like "safe mode" but instead inject an OpAbortKHR so that you will stop and see your error message right when it occurs

This will cause a device lost so this is going to be designed for only people who need this

This makes use of https://github.com/LunarG/ShaderAbortStrip to both not redo work, but also to dog feed our new tool

closes #11943

@spencer-lunarg
spencer-lunarg requested a review from a team as a code owner November 20, 2026 17:15
((uint32_t*)error_output_buffer_range_.offset_mapped_ptr)[glsl::error_buffer_u32_size_member_offset] =
uint32_t(error_output_buffer_range_.size / sizeof(uint32_t));

cmd_buffer_id_ = gpuav_.next_cmd_buffer_id_++;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just a fly bye: are you conflating a command buffer and a command buffer submission here?
I will look further tomorrow, but this has been a pitfall in the past

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

similar to other issue, the ID is per command buffer, not per submission as that is enough to decode the error, but it would mean every submission of the same command buffer finds the same abort messages.

will fix to duplicate report (and get a test)

@arno-lunarg arno-lunarg Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For now don't bother doing that, since this issue is also already present for error buffers anyway: they should be associated to command buffer submissions, not global command buffer state like now. When the issue is fixed for error buffers, we can look at abort messages

I just wanted to make sure no issue goes beyond the ones we already have with our error buffers!

Comment thread docs/gpu_av_shader_abort.md Resolved
Comment thread docs/gpu_av_shader_abort.md Resolved
Comment thread docs/gpu_av_shader_abort.md Resolved
Comment thread docs/gpu_av_shader_abort.md Resolved
Comment thread docs/gpu_av_shader_abort.md Resolved
Comment thread layers/gpuav/core/gpuav_record.cpp Resolved
Comment thread layers/gpuav/core/gpuav_record.cpp Resolved
"[WARNING] A device lost occurred. Trying to print an error GPU-AV might have gathered. Since GPU buffers storing "
"GPU-AV errors are in theory undefined in this context, error messages may be inaccurate or wrongly report a "
"nonexistent error. In practice, memory tends to hold up, and reads are fine.\n";
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
}
} else if (abort_error_records.empty()) {
// skip the error scanning loop, but just this
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

what?

this is

if (!abort_error_records.empty()) {
   // report our shader abort
} else if (is_device_lost) {
  // thing broke, try to recover
}

// normal scanning logic

not sure what you are asking here

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.

Add VK_KHR_shader_abort support into GPU-AV

3 participants