Skip to content

Instantly share code, notes, and snippets.

@cvan
Last active January 19, 2024 02:54
Show Gist options
  • Star 91 You must be signed in to star a gist
  • Fork 14 You must be signed in to fork a gist
  • Save cvan/042b2448fcecefafbb6a91469484cdf8 to your computer and use it in GitHub Desktop.
Save cvan/042b2448fcecefafbb6a91469484cdf8 to your computer and use it in GitHub Desktop.
use JavaScript to detect GPU used from within your browser
var canvas = document.createElement('canvas');
var gl;
var debugInfo;
var vendor;
var renderer;
try {
gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
} catch (e) {
}
if (gl) {
debugInfo = gl.getExtension('WEBGL_debug_renderer_info');
vendor = gl.getParameter(debugInfo.UNMASKED_VENDOR_WEBGL);
renderer = gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL);
}
// Sample output:
//
// » console.log(renderer);
// ATI Technologies Inc. AMD Radeon R9 M370X OpenGL Engine
@vimal691
Copy link

vimal691 commented Dec 30, 2022

Can anyone tell me what will be the output for android phone and Windows desktop. Both for chrome and mozilla.

@noel-friedrich
Copy link

Can anyone tell me what will be the output for android phone and Windows desktop. Both for chrome and mozilla.

Using Android Phone (Samsung S10e) I got:

vendor: Google Inc. (ARM)
renderer: ANGLE (ARM, Mali-G76, OpenGL ES 3.2)

On Windows 11 (Acer Aspire A315-56, Intel i3-1005G1 CPU) I got:

vendor: Google Inc. (Intel)
renderer: ANGLE (Intel, Intel(R) UHD Graphics Direct3D11 vs_5_0 ps_5_0, D3D11)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment