Skip to content

Commit

Permalink
[WebGPU] Update error messages to be more user-friendly (#17021)
Browse files Browse the repository at this point in the history
  • Loading branch information
Neet-Nestor authored May 25, 2024
1 parent 7f7762d commit f498cef
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion web/src/webgpu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ export async function detectGPUDevice(): Promise<GPUDeviceDetectOutput | undefin
if (typeof navigator !== "undefined" && navigator.gpu !== undefined) {
const adapter = await navigator.gpu.requestAdapter({ "powerPreference": "high-performance" });
if (adapter == null) {
throw Error("Cannot find adapter that matches the request");
throw Error(
"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. " +
"Please check if your device has a GPU properly set up and if your your browser supports WebGPU. " +
"You can also consult your browser's compatibility chart to see if it supports WebGPU. " +
"For more information about WebGPU support in your browser, visit https://webgpureport.org/"
);
}
const computeMB = (value: number) => {
return Math.ceil(value / (1 << 20)) + "MB";
Expand Down

0 comments on commit f498cef

Please sign in to comment.