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

[WebGPU] Update error messages to be more user-friendly #17021

Merged
merged 1 commit into from
May 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading