-
Notifications
You must be signed in to change notification settings - Fork 652
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 Mobile NeRF Ray Query Sample #1134
Add Mobile NeRF Ray Query Sample #1134
Conversation
Signed-off-by: Rodrigo Holztrattner <[email protected]>
Signed-off-by: Rodrigo Holztrattner <[email protected]>
Signed-off-by: Rodrigo Holztrattner <[email protected]>
Moving sample out from draft (for review). Note: There are some VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03710 validation errors on AMD devices when using acceleration structures. The ray_tracing_extended sample seems to trigger this same errors as well. This might be device/driver dependent and not really an issue on more up-to-date HW/drivers. An old and similar issue These errors do not appear on NVIDIA's or mobile devices in general. |
Signed-off-by: Rodrigo Holztrattner <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unlike the existing mobile NeRF sample, this one does not work for me. I get this error at startup:
[error] Required device extension VK_KHR_get_physical_device_properties2 not available, cannot run
[error] Error Message: Extensions not present : ERROR_EXTENSION_NOT_PRESENT
[error] Failed when running application Mobile NeRF Ray Query
This is caused, by VK_KHR_get_physical_device_properties2 being added as a device extension, while it actually is an instance level extension.
Also mouse camera controls feel odd. Like they're inverted, compared to the other mobile NeRF sample. |
The sample also trigger a lot of warnings about uninitialized variables (~75). Those need to be fixed too. |
I also get these validation messages with the latest SDK:
|
Signed-off-by: Rodrigo Holztrattner <[email protected]>
283da4c
to
1fcb6b8
Compare
Hi @SaschaWillems , I got the updated code from the team and update the PR, thanks for your feedback! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have to admit, I can't follow all that mlp-stuff...
But there are a few minor issues, and the camera movement is not consistent: moving left/right is correct but up/down is inverted.
Signed-off-by: Rodrigo Holztrattner <[email protected]>
Hi @asuessenbach, I just got the updated code from the team and updated the PR, the remaining issues should all have been addressed. |
…eno -> mobile devices that support ray queries)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good looks good (aside from a very minor thing, see my comment), sample runs fine.
But I do get this validation error at startup:
[error] 115483881 - VUID-VkShaderModuleCreateInfo-pCode-08740: Validation Error: [ VUID-VkShaderModuleCreateInfo-pCode-08740 ] | MessageID = 0x6e224e9 | vkCreateShaderModule(): SPIR-V Capability UniformBufferArrayNonUniformIndexing was declared, but one of the following requirements is required (VkPhysicalDeviceVulkan12Features::shaderUniformBufferArrayNonUniformIndexing). The Vulkan spec states: If pCode is a pointer to SPIR-V code, and pCode declares any of the capabilities listed in the SPIR-V Environment appendix, one of the corresponding requirements must be satisfied (https://vulkan.lunarg.com/doc/view/1.3.290.0/windows/1.3-extensions/vkspec.html#VUID-VkShaderModuleCreateInfo-pCode-08740)
Looks like that feature isn't enabled.
Signed-off-by: Rodrigo Holztrattner <[email protected]>
Signed-off-by: Rodrigo Holztrattner <[email protected]>
@SaschaWillems I was trying to resolve the issue below before pushing the changes to fix the validation layer error, at this point I'm starting to think it's a problem with the framework and not actually the sample, but just letting you know the latest version shouldn't have any validation errors anymore.
|
It seems other samples have the errors I mentioned above, it doesn't seem specific to this one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on Arm GPUs and there seems to be an improvement (with respect to no-RQ) with the USE_OPAQUE
flag, but a regression without it. Could USE_OPAQUE
be the default?
Can we defer minor remarks/questions? This PR has been around for quite some time now and I think we should make sure that PRs as these get merged as fast as possible. Adding in late minor changes would require everyone to re-approve. |
In this case the sample goal is to show the performance advantage of using ray query, but this is not the case (in the devices I tested), so it might require major changes, including a better solution for the device_lost issue mentioned in the comments |
@JoseEmilio-ARM the performance really depends on the number of objects and which device was used for testing, let me cover each topic and the device issue problem: One or just a few objects are much faster when using the ray-query approach, we simplified the draw calls on this sample to make it easier to consume by doing as few draw commands as possible. Multiple draws, each with its own model, would significantly lower cache misses and consequentially, increase performance, while complicating the sample code. While testing on our devices, Snapdragon 8 Gen 2 is almost in pair with the non-ray-query version, while Gen 3 and Gen 4 offers significant increased FPS then the previous generations. For the USE_OPAQUE mode: The original models from the paper have transparent textures, but the ones we made available to the public doesn't. To ensure compatibility with some AMD devices the non-opaque mode was left there just to avoid the possible crash if one decides to use the original models. We don't mind removing the non-opaque code. For the items where there could be actionable changes, I would prefer to create a new PR for addressing them instead of adding more changes to this one, as it's been active for a while now. I assume performance is the main point, but not only we do get faster performance with ray-query on more recent devices, it's a modern approach and likely to mature even more in the next generations of devices, providing even greater performance for NeRF processing on mobile. |
Signed-off-by: Rodrigo Holztrattner <[email protected]>
c0ebea8
Merging per discussion today. Thanks everyone! |
Description
Adds a new sample, Mobile NeRF Ray Query, which is an upgraded version of the original Mobile NeRF sample. This one uses rayqueries to accelerate the NeRF processing.
General Checklist:
Please ensure the following points are checked:
Note: The Samples CI runs a number of checks including:
If this PR contains framework changes:
batch
command line argument to make sure all samples still work properlySample Checklist
If your PR contains a new or modified sample, these further checks must be carried out in addition to the General Checklist: