Which GPU is WebGL using?

338 views
Skip to first unread message

Philip Taylor

unread,
Nov 2, 2022, 2:32:17 PM11/2/22
to webgl-d...@googlegroups.com
It looks like the ANGLE backend went through a significant revamp recently. 

When we look in chrome://gpu/ we now see multiple GPUs on laptops featuring the integrated/discreet GPU combo.

However, when I check which GPU WebGL is using, it says the integrated one. I've tried forcing the high performance GPU in the NVidia control panel. 

When we create a WebGL  context, we always request the 'high performance' profile. 

I am getting reasonably good performance, so I am not sure which GPU is actually being used.

image.png

image.png
--
Philip TAYLOR
CTO, Zea Inc.
Montréal, Québec

The contents of this e-mail are confidential with all rights reserved to the author. It is illegal to use or divulge this information without authorization. If you have received this e-mail by mistake, please notify me immediately by replying to the e-mail. 

Jonah Ryan-Davis

unread,
Nov 2, 2022, 3:07:44 PM11/2/22
to WebGL Dev List
Hi Philip,

The WebGL powerPreference context creation attribute has historically only worked on Safari, and Chrome on Mac (though the latter only works when Chrome is using OpenGL, and it works by switching the entire system over to the high performance GPU). Very soon this should be available on Chrome on Mac when it's using Metal.

There is future work to enable high-performance GPU support in Chrome via powerPreference on Windows/D3D11, but this work hasn't landed yet.
You can force all of Chrome's rendering on Windows to the high-performance GPU by passing in the command line flag --force_high_performance_gpu, or by forcing the Windows DXGI GPU preference to be the high performance GPU. (I haven't done the latter, but it looks like there are some instructions online: https://www.trishtech.com/2018/12/how-to-set-graphics-performance-preference-for-apps-in-windows-10/)
This might not be what you are looking for, because it only affects your machine and not all the users of your WebGL app.

Jonah

Ken Russell

unread,
Nov 2, 2022, 3:48:52 PM11/2/22
to webgl-d...@googlegroups.com
After following Jonah's instructions, you should be able to confirm which GPU is being used for WebGL contexts by requesting the WEBGL_debug_renderer_info extension, and via it, the unmasked renderer string.

-Ken



--
You received this message because you are subscribed to the Google Groups "WebGL Dev List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webgl-dev-lis...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/webgl-dev-list/d0e6d00b-e58f-4780-8f92-c1ff93c1601en%40googlegroups.com.

Matthew Amato

unread,
Nov 2, 2022, 3:57:39 PM11/2/22
to webgl-d...@googlegroups.com
If you are just looking to confirm your local setup, you can also use https://webglreport.com/ which provides this info. (And the code is on GitHub so you can grab it as an example if you are looking to integrate something directly into your application).

Philip Taylor

unread,
Nov 2, 2022, 4:33:37 PM11/2/22
to webgl-d...@googlegroups.com
Thanks all for the quick responses. 

My screenshot showed that the Intel GPU was listed under GL_RENDERER.
This was also confirmed by the  webglreport website. 

Anyway, thanks to the article posted by Jonah from trishtech.com, I discovered the new Windows GPU setting which did make my NVidia GPU the GPU used by Chrome.
Thanks for the help, now it's working like a charm.

I can now help customers of ours when they run into this issue. 

igor choromanski

unread,
Nov 2, 2022, 9:37:38 PM11/2/22
to webgl-d...@googlegroups.com

--

Nick Cooper

unread,
Nov 29, 2022, 7:07:11 PM11/29/22
to WebGL Dev List
Hello Jonah,

Was digging into a regression for our browser-based 3D game and concluded it was a particular thing with integrated graphics being chosen by default - We do specify high-performance powerPerference but of course as you note it doesn't seem to have effect. Am wondering if there's a public issue tracking the future work you mention? Or at least a rough quarter/month-level ETA?

Our only viable alternative it seems would be to package ourselves as an Electron app which is not ideal for many reasons.

Thanks,

Nick.

Jonah Ryan-Davis

unread,
Nov 30, 2022, 11:41:15 AM11/30/22
to WebGL Dev List
Hello Nick,

This is already available on Mac/OpenGL.
The overall tracking bug for Mac/Metal dual-GPU support is here: https://bugs.chromium.org/p/chromium/issues/detail?id=1251724
I can't find tracking bugs for Windows/other platforms, and I can't verify what priority other platforms' dual-GPU support is. I'll update this thread if I learn anything.

Jonah

Nick Cooper

unread,
Nov 30, 2022, 9:12:58 PM11/30/22
to webgl-d...@googlegroups.com
Thanks for the reply Jonah!

Looking through the relevant changes from that issue - it actually appears to me at least initially that this fix would in-fact also work for Chrome-Windows. As far as I can tell the gating control for EGL Dual-GPU Rendering would also affect the GPU preference available to Windows. I'm going to get this building on Windows to confirm (and I lack enough relevant background to speak with authority) but at first glance it does appear that Dual-GPU support that's targeting the fix for Metal would also give this ability to Windows.

Nick.

--
You received this message because you are subscribed to the Google Groups "WebGL Dev List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webgl-dev-lis...@googlegroups.com.

Jonah Ryan-Davis

unread,
Dec 1, 2022, 10:05:27 AM12/1/22
to WebGL Dev List
Hi Nick,

You're right that Windows does share a lot of the infrastructure work going into the Metal dual-GPU support, but there is missing work within SharedImages to actually support it. As of now it's unclear when this work will be done.

Jonah

Nick Cooper

unread,
Dec 2, 2022, 2:19:13 PM12/2/22
to webgl-d...@googlegroups.com
Ah, that's unfortunate. Sounds like we'll need to take the Electron route - I don't suppose you know what the scope of such work is? Like if we watch the OSX-side work is the level of effort similar for Windows? I ask as looking to contribute could be a valid path for us.

Essentially any Dual-GPU Windows Laptop is not useful for WebGL [and presumably WebGPU] without this - much the same as OSX 

You received this message because you are subscribed to a topic in the Google Groups "WebGL Dev List" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/webgl-dev-list/gf0NHCFQkMM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to webgl-dev-lis...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/webgl-dev-list/f831066c-0384-4a5d-be87-7cb12225efc4n%40googlegroups.com.

Philip Taylor

unread,
Dec 2, 2022, 4:21:09 PM12/2/22
to webgl-d...@googlegroups.com
Can I suggest you look at Tauri :  https://tauri.app/
We have found it to be way better than the aging electron.
It uses the built in OS Web Renderer, which on Windows is Edge, and on Mac is Safari. 
This makes the package miniscule and loads super fast.




Nick Cooper

unread,
Dec 3, 2022, 10:33:52 AM12/3/22
to webgl-d...@googlegroups.com
Shall check it out. But one reason we would want electron is to start the process with the force high performance gpu setting. 

Edge (which is blink as well) shares the same issue so we would need to ensure we can still start it appropriately 

Reply all
Reply to author
Forward
0 new messages