Skip to content

Commit f498cef

Browse files
authored
[WebGPU] Update error messages to be more user-friendly (#17021)
1 parent 7f7762d commit f498cef

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

web/src/webgpu.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,12 @@ export async function detectGPUDevice(): Promise<GPUDeviceDetectOutput | undefin
3737
if (typeof navigator !== "undefined" && navigator.gpu !== undefined) {
3838
const adapter = await navigator.gpu.requestAdapter({ "powerPreference": "high-performance" });
3939
if (adapter == null) {
40-
throw Error("Cannot find adapter that matches the request");
40+
throw Error(
41+
"Unable to find a compatible GPU. This issue might be because your computer doesn't have a GPU, or your system settings are not configured properly. " +
42+
"Please check if your device has a GPU properly set up and if your your browser supports WebGPU. " +
43+
"You can also consult your browser's compatibility chart to see if it supports WebGPU. " +
44+
"For more information about WebGPU support in your browser, visit https://webgpureport.org/"
45+
);
4146
}
4247
const computeMB = (value: number) => {
4348
return Math.ceil(value / (1 << 20)) + "MB";

0 commit comments

Comments
 (0)