wgpu-hal: vulkan: ensure entries to PhysicalDeviceCapabilities use effective api version#4250
Closed
i509VCB wants to merge 1 commit intogfx-rs:trunkfrom
Closed
wgpu-hal: vulkan: ensure entries to PhysicalDeviceCapabilities use effective api version#4250i509VCB wants to merge 1 commit intogfx-rs:trunkfrom
i509VCB wants to merge 1 commit intogfx-rs:trunkfrom
Conversation
…fective api version This was the cause of an error while testing wgpu-hal on agxv. Specifically I was getting an error about running out of memory while creating the "zero init buffer". This was occuring because PhysicalDeviceCapabilities was reading the instance api version and not the device version. But furthermore this is wrong because the actual api version that can be used is the lower of the instance's api version and device's api version. agxv does not implement maintenance3 yet, so what was being returned for a max memory allocation size was 0, because ash initialized the value to 0. Then when the gpu allocator is created with a maximum allocation size of 0, all gpu memory allocations fail. Signed-off-by: i509VCB <git@i509.me>
nical
approved these changes
Oct 17, 2023
teoxoy
reviewed
Oct 17, 2023
Comment on lines
+792
to
+795
| // Set the effective api version before we test for extension support | ||
| capabilities.effective_api_version = self | ||
| .driver_api_version | ||
| .min(capabilities.properties.api_version); |
Member
There was a problem hiding this comment.
Moving this up here won't work as capabilities.properties.api_version will be 0.
I opened #4252 as I also wanted to decouple the instance and device API versions for some time now.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This was the cause of an error while testing wgpu-hal on agxv. Specifically I was getting an error about running out of memory while creating the "zero init buffer". This was occuring because PhysicalDeviceCapabilities was reading the instance api version and not the device version. But furthermore this is wrong because the actual api version that can be used is the lower of the instance's api version and device's api version.
agxv does not implement maintenance3 yet, so what was being returned for a max memory allocation size was 0, because ash initialized the value to 0. Then when the gpu allocator is created with a maximum allocation size of 0, all gpu memory allocations fail.
Checklist
cargo clippy.Although when running clippy this error shows up. Definitely not a fault of my changes: