Skip to content

Conversation

@melihmete
Copy link

@melihmete melihmete commented Nov 19, 2025

Description

When developing Vulkan applications, understanding and handling GPU errors is crucial. Currently, traditional graphics debugging methods do not give detailed information about GPU faults.
The VK_EXT_device_fault extension provides detailed information when ERROR_DEVICE_LOST occur, while the VK_EXT_device_address_binding_report extension helps monitor GPU memory usage by reporting
allocated and bound/unbound addresses in Vulkan application.

General Checklist:

Please ensure the following points are checked:

  • My code follows the coding style
  • I have reviewed file licenses
  • I have commented any added functions (in line with Doxygen)
  • I have commented any code that could be hard to understand
  • My changes do not add any new compiler warnings
  • My changes do not add any new validation layer errors or warnings
  • I have used existing framework/helper functions where possible
  • My changes do not add any regressions
  • I have tested every sample to ensure everything runs correctly
  • This PR describes the scope and expected impact of the changes I am making

Note: The Samples CI runs a number of checks including:

  • I have updated the header Copyright to reflect the current year (CI build will fail if Copyright is out of date)
  • My changes build on Windows, Linux, macOS and Android. Otherwise I have documented any exceptions

If this PR contains framework changes:

  • [n/a] I did a full batch run using the batch command line argument to make sure all samples still work properly

Sample Checklist

If your PR contains a new or modified sample, these further checks must be carried out in addition to the General Checklist:

  • I have tested the sample on at least one compliant Vulkan implementation
  • [n/a] If the sample is vendor-specific, I have tagged it appropriately
  • [n/a] I have stated on what implementation the sample has been tested so that others can test on different implementations and platforms
  • [n/a] Any dependent assets have been merged and published in downstream modules
  • For new samples, I have added a paragraph with a summary to the appropriate chapter in the readme of the folder that the sample belongs to e.g. api samples readme
  • For new samples, I have added a tutorial README.md file to guide users through what they need to know to implement code using this feature. For example, see conditional_rendering
  • For new samples, I have added a link to the Antora navigation so that the sample will be listed at the Vulkan documentation site

@CLAassistant
Copy link

CLAassistant commented Nov 19, 2025

CLA assistant check
All committers have signed the CLA.

@melihmete melihmete changed the title VK_EXT_device_fault extension implementation Add a new sample for VK_EXT_device_fault Nov 19, 2025
@gary-sweet
Copy link
Contributor

I see a bunch of compilation errors when I try to build this:

samples/extensions/device_fault/device_fault.cpp:595:49: error: macro "REQUEST_REQUIRED_FEATURE" passed 4 arguments, but takes just 3
  595 |                          bufferDeviceAddress);
      |                                                 ^

framework/core/physical_device.h:188: note: macro "REQUEST_REQUIRED_FEATURE" defined here
  188 | #define REQUEST_REQUIRED_FEATURE(gpu, Feature, flag) gpu.request_required_feature<Feature>(&Feature::flag, #Feature, #flag)
      | 

samples/extensions/device_fault/device_fault.cpp:601:41: error: macro "REQUEST_REQUIRED_FEATURE" passed 4 arguments, but takes just 3
  601 |                          deviceFault);
      |                                         ^

samples/extensions/device_fault/device_fault.cpp:607:50: error: macro "REQUEST_OPTIONAL_FEATURE" passed 4 arguments, but takes just 3
  607 |                          reportAddressBinding);
      |                                                  ^

framework/core/physical_device.h:187: note: macro "REQUEST_OPTIONAL_FEATURE" defined here
  187 | #define REQUEST_OPTIONAL_FEATURE(gpu, Feature, flag) gpu.request_optional_feature<Feature>(&Feature::flag, #Feature, #flag)
      | 

samples/extensions/device_fault/device_fault.h:31:18: error: 'virtual void DeviceFault::request_gpu_features(vkb::PhysicalDevice&)' marked 'override', but does not override
   31 |     virtual void request_gpu_features(vkb::PhysicalDevice &gpu) override;
      |                  ^~~~~~~~~~~~~~~~~~~~

samples/extensions/device_fault/device_fault.cpp:592:5: error: 'REQUEST_REQUIRED_FEATURE' was not declared in this scope
  592 |     REQUEST_REQUIRED_FEATURE(gpu,
      |     ^~~~~~~~~~~~~~~~~~~~~~~~

samples/extensions/device_fault/device_fault.cpp:604:5: error: 'REQUEST_OPTIONAL_FEATURE' was not declared in this scope
  604 |     REQUEST_OPTIONAL_FEATURE(gpu,
      |     ^~~~~~~~~~~~~~~~~~~~~~~~

samples/extensions/device_fault/device_fault.cpp:610:22: error: invalid use of incomplete type 'class vkb::PhysicalDevice'
  610 |     auto &features = gpu.get_mutable_requested_features();
      |                      ^~~

framework/core/device.h:36:7: note: forward declaration of 'class vkb::PhysicalDevice'
   36 | class PhysicalDevice;
      |       ^~~~~~~~~~~~~~
     

@melihmete
Copy link
Author

@gary-sweet All fixed and pushed the changes.

@SaschaWillems
Copy link
Collaborator

Can you move the shaders to a subdirectory called "glsl"? We support different shading languages and the goal is for all samples to have shaders in different shading languages (glsl, slang and/or hlsl).

SaschaWillems
SaschaWillems previously approved these changes Nov 28, 2025
@gary-sweet
Copy link
Contributor

This does build ok for me now, and correctly reports as not-supported. I can't say any more than that though.

SaschaWillems
SaschaWillems previously approved these changes Dec 7, 2025
@melihmete
Copy link
Author

@SaschaWillems Hello, I've just received errors regarding Quality Checks / Copyright Headers Check in the files I haven't modified. Should I fix them or is it related to CI needs a fixing?

@SaschaWillems
Copy link
Collaborator

As per yesterdays call we'll ignore the CI failure caused by files you didn't touch. We'll try to make that CI step more robust/less error prone.

gpx1000
gpx1000 previously approved these changes Jan 9, 2026
@melihmete melihmete dismissed stale reviews from gpx1000 and SaschaWillems via 3714a42 January 16, 2026 15:30
SaschaWillems
SaschaWillems previously approved these changes Jan 26, 2026
@marty-johnson59
Copy link
Contributor

Hi @melihmete, per discussion today, this is almost ready to merge. Just needs the copyright header addressed and the merge conflict resolved. When those are ready, I'll merge. Thanks!

asuessenbach
asuessenbach previously approved these changes Jan 28, 2026
@melihmete melihmete dismissed stale reviews from asuessenbach and SaschaWillems via 60df65e February 6, 2026 09:14
// Log each address info with decimal and hexadecimal representations
for (uint32_t i = 0; i < faultCount.addressInfoCount; i++) {
LOGE("Fault Address Info Address Type: {}", std::to_string(addressInfos[i].addressType));
LOGE("Fault Address Info Reported Address -> Decimal: {} | Hex: 0x{:X}", addressInfos[i].reportedAddress, static_cast<uint64_t>(addressInfos[i].reportedAddress));

Choose a reason for hiding this comment

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

Should probably include the addressPrecision field here, as the reportedAddress may represent a range of addresses (for example, a page).

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.

8 participants