Skip to content

WebGPU: Deno hangs when destroying a device that has created a buffer #24798

Closed
@matthew-wong1

Description

I compiled Deno from source using the latest commit (fe884c5 as of writing).

I found that the following program causes Deno to hang on Linux (Ubuntu 22.04) and not finish execution (or at least not finish execution within 30 mins on my machine):

async function main() {
	const adapter = await navigator.gpu.requestAdapter();
	const device = await adapter.requestDevice();
	const buffer = device.createBuffer({
		mappedAtCreation: true,
		size: 12,
		usage: GPUBufferUsage.COPY_SRC
	});
	device.destroy();
}
main().catch(console.error);

On macOS, there is some different behavior. The following is output to the console:

No active command buffers for fence value 1
Failed to wait for buffer Id(0,1,mtl): Parent device is lost

It seems to be because mappedAtCreation is true. When mappedAtCreation is false, the program finishes executing on both macOS and Linux successfully.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working correctlyupstreamChanges in upstream are required to solve these issueswebrelated to Web APIswebgpuWebGPU API

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions