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

[vulkan] acceleration structure in a descriptor pool are not properly allocated #6859

Closed
Tracked by #6762
Vecvec opened this issue Jan 5, 2025 · 0 comments · Fixed by #6861
Closed
Tracked by #6762

[vulkan] acceleration structure in a descriptor pool are not properly allocated #6859

Vecvec opened this issue Jan 5, 2025 · 0 comments · Fixed by #6861

Comments

@Vecvec
Copy link
Contributor

Vecvec commented Jan 5, 2025

Description
When calculating the counts for a each descriptor type in a descriptor pool acceleration structures are not placed in the array.

//Note: ignoring other types, since they can't appear here
let unfiltered_counts = [
(vk::DescriptorType::SAMPLER, descriptor_count.sampler),
(
vk::DescriptorType::SAMPLED_IMAGE,
descriptor_count.sampled_image,
),
(
vk::DescriptorType::STORAGE_IMAGE,
descriptor_count.storage_image,
),
(
vk::DescriptorType::UNIFORM_BUFFER,
descriptor_count.uniform_buffer,
),
(
vk::DescriptorType::UNIFORM_BUFFER_DYNAMIC,
descriptor_count.uniform_buffer_dynamic,
),
(
vk::DescriptorType::STORAGE_BUFFER,
descriptor_count.storage_buffer,
),
(
vk::DescriptorType::STORAGE_BUFFER_DYNAMIC,
descriptor_count.storage_buffer_dynamic,
),
];

This can lead to Out Of Memory errors on some platforms.
This may also be causing the OOMs in bindgroup creation from #6727 (but not the seg-faults).

Repro steps
Run any ray-tracing example (e.g ray_cube_compute) on a gpu that cares about these (e.g an Intel Arc IGPU)

Expected vs observed behavior
We should allocate this correctly

Extra materials
Section of logs

[2025-01-05T09:28:39Z INFO  wgpu_examples::framework] Entering event loop...
[2025-01-05T09:28:39Z INFO  wgpu_examples::framework] Surface resume PhysicalSize { width: 800, height: 600 }
[2025-01-05T09:28:39Z INFO  wgpu_core::device::ray_tracing] Created blas Id(0,1) with CreateBlasDescriptor { label: None, flags: AccelerationStructureFlags(PREFER_FAST_TRACE), update_mode: Build }
[2025-01-05T09:28:39Z INFO  wgpu_core::device::ray_tracing] Created tlas Id(0,1) with CreateTlasDescriptor { label: None, max_instances: 64, flags: AccelerationStructureFlags(PREFER_FAST_TRACE), update_mode: Build }
[2025-01-05T09:28:39Z ERROR wgpu::backend::wgpu_core] Handling wgpu errors as fatal by default
thread 'main' panicked at wgpu\src\backend\wgpu_core.rs:1175:26:
wgpu error: Validation Error

Caused by:
  In Device::create_bind_group
    Not enough memory left.

Platform
Trunk, Intel arc IGPU.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant