Skip to content

Commit

Permalink
Improve null GPU adapter experience on Live Examples page (#565)
Browse files Browse the repository at this point in the history
  • Loading branch information
mhawryluk authored Nov 15, 2024
1 parent b886e55 commit 5b72a18
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions apps/typegpu-docs/src/components/design/Snackbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export function Snackbar(props: { text: string }) {

return (
<div
className="absolute bottom-4 right-4 z-40 flex items-center gap-4 w-full max-w-[min(28rem,calc(100vw-2rem))] p-4 text-gray-500 bg-red-100 rounded-lg"
className="absolute bottom-8 right-8 z-40 flex items-center gap-4 max-w-[min(28rem,calc(100vw-4rem))] p-4 text-gray-500 bg-red-100 rounded-lg box-border"
role="alert"
>
<div className="inline-flex items-center justify-center flex-shrink-0 w-8 h-8 text-red-500">
Expand All @@ -19,7 +19,7 @@ export function Snackbar(props: { text: string }) {
<span className="sr-only">Error icon</span>
</div>

<div className="text-sm text-gray-600">{text}</div>
<div className="overflow-auto text-sm text-gray-600">{text}</div>
</div>
);
}
7 changes: 6 additions & 1 deletion apps/typegpu-docs/src/content/docs/blog/troubleshooting.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
---
title: How to enable WebGPU on your device
date: 2024-10-04
lastUpdated: 2024-11-12
lastUpdated: 2024-11-15
tags:
- Safari
- iPhone
- Chrome
- Troubleshooting
- macOS
- WebGPU support
Expand Down Expand Up @@ -68,3 +69,7 @@ If you are running Deno 1.39 or newer you can either:
"webgpu"
]
```

## Chrome for Android and desktop

WebGPU for Google Chrome should work by default on Android and desktop devices, just make sure you run the newest available version of the app. If however it does not work, you might need to try enabling some experimental flags listed in the official [Chrome developer documentation](https://developer.chrome.com/docs/web-platform/webgpu/troubleshooting-tips).
5 changes: 4 additions & 1 deletion apps/typegpu-docs/src/utils/isGPUSupported.ts
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
export const isGPUSupported = navigator.gpu !== undefined;
const adapter = await navigator.gpu?.requestAdapter();
adapter?.requestDevice().then((device) => device.destroy());

export const isGPUSupported = !!adapter;

0 comments on commit 5b72a18

Please sign in to comment.