orillusion-webgpu-samples icon indicating copy to clipboard operation
orillusion-webgpu-samples copied to clipboard

strange loss of gpu support when consuming landing page from url other than localhost

Open John-Skinner opened this issue 2 years ago • 2 comments

I'm using the examples to learn webgpu. One observation is that if i change vite to host on non-localhost via 'vite --host 0.0.0.0', webgpu support is lost when i use the ip url rather than localhost:3000. If i use localhost:3000, then webgpu support is present. Even when the browser is on the same system. I wanted to use this these examples to test webgpu from firefox/chrome running on a few different linux distributions.

I'll look deeper into where there may be any logic that distinguishes localhost in some way.

John-Skinner avatar Jul 21 '23 12:07 John-Skinner

https is required if not open from localhost Chrome security policy

lslzl3000 avatar Jul 21 '23 12:07 lslzl3000

Thanks lslzl3000. You are right.

https://developer.mozilla.org/en-US/docs/Web/API/WebGPU_API (See Security requirements)

https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts)

Saved me much time.

John-Skinner avatar Jul 21 '23 12:07 John-Skinner