maierfelix / maierfelix/webgpu

Error: Out of memory Error: vkAllocateMemory failed with VK_ERROR_OUT_OF_DEVICE_MEMORY

Open
#48 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
248
Forks
17
PR merge metrics
No merged PRs in 30d

Description

Hello @maierfelix

I use procedural geometry and add 4 million instances to top level acceleration structure(bottom level acceleration structure only has 1 aabb), then when I run the demo, it error:
```js
Error: Out of memory Error: vkAllocateMemory failed with VK_ERROR_OUT_OF_DEVICE_MEMORY
at CheckVkOOMThenSuccessImpl (../../src/dawn_native/vulkan/VulkanError.cpp:94)
at AllocateResourceHeap (../../src/dawn_native/vulkan/ResourceMemoryAllocatorVk.cpp:87)
at Allocate (../../src/dawn_native/vulkan/ResourceMemoryAllocatorVk.cpp:140)
at Initialize (../../src/dawn_native/vulkan/BufferVk.cpp:171)
at Create (../../src/dawn_native/vulkan/BufferVk.cpp:125)
at device._onErrorCallback (D:\Github\WebGPU-Example\node_modules\wonder-webgpu\index.js:57:21)
at _buildContainers (file:///D:/Github/WebGPU-Example/packages/arc_ray_tracing_pipeline/src/pipeline/jobs/init/InitRayTracingPassJob.js:148:36)
at exec (file:///D:/Github/WebGPU-Example/packages/arc_ray_tracing_pipeline/src/pipeline/jobs/init/InitRayTracingPassJob.js:179:29)
at exec (file:///D:/Github/WebGPU-Example/packages/arc_ray_tracing_pipeline/src/pipeline/InitPipeline.js:19:13)
at async _main (file:///D:/Github/WebGPU-Example/packages/arc_ray_tracing_pipeline/src/index.js:52:13)
```

I want to add at least >10 million instances to top level acceleration structure! How to handle the error?

Thank you very much!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported demo and follow the allocation stack through InitRayTracingPassJob.js, BufferVk.cpp, and ResourceMemoryAllocatorVk.cpp. Check how the four-million-instance acceleration structure reaches vkAllocateMemory and document whether the requested instance count is supported or what limit and failure behavior should be expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, javascript
Domain
computer-graphics
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.