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

Terminate process once all trim ranges have been captured #1194

Merged
merged 1 commit into from
Aug 18, 2023

Conversation

panos-lunarg
Copy link
Contributor

@panos-lunarg panos-lunarg commented Jul 13, 2023

Once all frame ranges specified by
GFXRECON_CAPTURE_FRAMES/debug.gfxrecon.capture_frames) have been
recorded, GFXR will call exit() forcing the whole process to terminate.

New control options (GFXRECON_QUIT_AFTER_CAPTURE_FRAMES for desktop and
debug_gfxrecon.quit_after_capture_frames for Android) can be used to
enable or disable this.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 5586.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 2974 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 2974 passed.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 6278.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 2980 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 2980 failed.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 6350.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 2981 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 2981 passed.

@andrew-lunarg
Copy link
Contributor

andrew-lunarg commented Jul 14, 2023

I don't care myself but just mentioning this would cause an otherwise validation-passing replay to not pass validation since all Vulkan handles must be destroyed. I guess hard exiting this way might stop validation errors on exit being reported anyway even if the --validate flag was passed to the replay that was being recaptured for trim.

To make this clean for use in a zero validation error environment you'd add a shutdown function which destroyed and freed every live object and memory allocation in reverse order to that of their creation.

Copy link
Contributor

@andrew-lunarg andrew-lunarg left a comment

Choose a reason for hiding this comment

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

LGTM

@bradgrantham-lunarg
Copy link
Contributor

It looks like this would also stop D3D12 captures after the last trim range. @davidd-lunarg do you agree? @panos-lunarg could you add your Vulkan usage note to the D3D12 usage .md as well?

if (quit_after_frame_ranges_)
{
GFXRECON_LOG_INFO("All trim ranges have been captured. Quitting.");
exit(0);
Copy link
Contributor

Choose a reason for hiding this comment

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

This skips DestroyInstance which calls ~CaptureManager() which calls util::PageGuardManager::Destroy();. I think exiting is relatively safe or we'd have real problems when applications crash and cause GFXR to terminate unexpectedly. Still, what do you think about a more formal shutdown path here which closes out CaptureManager, calling the virtual dtor for the derived capture managers?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

exit(0) still exists but now I am installing an atexit function which should be called right after exit() and call the destructor

@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 8981.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 2994 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 9022.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 2995 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 2995 passed.

Once all frame ranges specified by
GFXRECON_CAPTURE_FRAMES / debug.gfxrecon.capture_frames have been
recorded, GFXR will call exit(), forcing the whole process to terminate.

New control boolean options (GFXRECON_QUIT_AFTER_CAPTURE_FRAMES for
desktop and debug_gfxrecon.quit_after_capture_frames for Android) can be
used to control the new behavior.
@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 24991.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 3089 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 3089 failed.

@panos-lunarg panos-lunarg merged commit 655fd55 into LunarG:dev Aug 18, 2023
5 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.

4 participants