All Projects → pmndrs → detect-gpu

pmndrs / detect-gpu

Licence: MIT license
Classifies GPUs based on their 3D rendering benchmark score allowing the developer to provide sensible default settings for graphically intensive applications.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to detect-gpu

Detect Gpu
Classifies GPUs based on their 3D rendering benchmark score allowing the developer to provide sensible default settings for graphically intensive applications.
Stars: ✭ 460 (-38.58%)
Mutual labels:  threejs, device, hardware, detection, pixijs, webgl2
detect-features
Detect and report browser and hardware features.
Stars: ✭ 63 (-91.59%)
Mutual labels:  hardware, detection, webgl2
ARFaceFilter
Javascript/WebGL lightweight face tracking library designed for augmented reality webcam filters. Features : multiple faces detection, rotation, mouth opening. Various integration examples are provided (Three.js, Babylon.js, FaceSwap, Canvas2D, CSS3D...).
Stars: ✭ 72 (-90.39%)
Mutual labels:  threejs, detection, babylonjs
Sketch
Explorations on cross-hatching, engraving, and similar non-photorealistic rendering.
Stars: ✭ 136 (-81.84%)
Mutual labels:  threejs, webgl2
Ray Tracing Renderer
[UNMAINTAINED] Real-time path tracing on the web with three.js
Stars: ✭ 444 (-40.72%)
Mutual labels:  threejs, webgl2
Sunset Cyberspace
🎮👾Retro-runner Game made in Expo, Three.js, OpenGL, WebGL, Tween. 🕹
Stars: ✭ 54 (-92.79%)
Mutual labels:  threejs, webgl2
Parser Javascript
Browser sniffing gone too far — A useragent parser library for JavaScript
Stars: ✭ 66 (-91.19%)
Mutual labels:  device, detection
AXIOM-Remote
A device to control AXIOM cameras.
Stars: ✭ 24 (-96.8%)
Mutual labels:  device, hardware
Fabscanpi Server
FabScan Pi Open Source 3D Scanner - Server application
Stars: ✭ 137 (-81.71%)
Mutual labels:  threejs, hardware
Hardware.Info
Battery, BIOS, CPU - processor, storage drive, keyboard, RAM - memory, monitor, motherboard, mouse, NIC - network adapter, printer, sound card - audio card, graphics card - video card. Hardware.Info is a .NET Standard 2.0 library and uses WMI on Windows, /dev, /proc, /sys on Linux and sysctl, system_profiler on macOS.
Stars: ✭ 238 (-68.22%)
Mutual labels:  device, hardware
three-noise
Simple gradient noise library for use with Three.js. Now with fBm!
Stars: ✭ 31 (-95.86%)
Mutual labels:  threejs, webgl2
d3-force-webgl-integration-demo
Integrating WebGL and D3-force to improve performance. 👻
Stars: ✭ 44 (-94.13%)
Mutual labels:  threejs, pixijs
device.js
🧬 Reactive library to observe essential browser and device properties.
Stars: ✭ 29 (-96.13%)
Mutual labels:  device, detection
gl-bench
⏱ WebGL performance monitor with CPU/GPU load.
Stars: ✭ 146 (-80.51%)
Mutual labels:  threejs, webgl2
Threejs Starter
Stars: ✭ 89 (-88.12%)
Mutual labels:  threejs, webgl2
generative
Creative coding experiments
Stars: ✭ 71 (-90.52%)
Mutual labels:  threejs, babylonjs
Jeelizfacefilter
Javascript/WebGL lightweight face tracking library designed for augmented reality webcam filters. Features : multiple faces detection, rotation, mouth opening. Various integration examples are provided (Three.js, Babylon.js, FaceSwap, Canvas2D, CSS3D...).
Stars: ✭ 2,042 (+172.63%)
Mutual labels:  threejs, detection
Luminous
Luminous provides you a lot of information about the system and a lot of handy methods to quickly get useful data on the iOS platform.
Stars: ✭ 298 (-60.21%)
Mutual labels:  device, hardware
SAMD TimerInterrupt
This library enables you to use Interrupt from Hardware Timers on an SAMD-based board. These SAMD Hardware Timers, using Interrupt, still work even if other functions are blocking. Moreover, they are much more precise (certainly depending on clock frequency accuracy) than other software timers using millis() or micros(). That's mandatory if you …
Stars: ✭ 28 (-96.26%)
Mutual labels:  device, hardware
revit-family-web-viewer
Revit Web Viewer is a Three.js-based project viewer. Revit projects / families must be exported using RvtVa3cExporter (https://github.com/va3c/RvtVa3c)
Stars: ✭ 48 (-93.59%)
Mutual labels:  threejs, webgl2

Detect GPU

npm version gzip size install size

Classifies GPUs based on their 3D rendering benchmark score allowing the developer to provide sensible default settings for graphically intensive applications. Think of it like a user-agent detection for the GPU but more powerful.

Demo

Live demo

Installation

By default we use the UNPKG CDN to host the benchmark data. If you would like to serve the benchmark data yourself download the required benchmarking data from benchmarks.tar.gz and serve it from a public directory.

Make sure you have Node.js installed.

 $ npm install detect-gpu

Usage

import { getGPUTier } from 'detect-gpu';

(async () => {
  const gpuTier = await getGPUTier();

  // Example output:
  // {
  //   "tier": 1,
  //   "isMobile": false,
  //   "type": "BENCHMARK",
  //   "fps": 21,
  //   "gpu": "intel iris graphics 6100"
  // }
})();

detect-gpu uses rendering benchmark scores (framerate, normalized by resolution) in order to determine what tier should be assigned to the user's GPU. If no WebGLContext can be created, the GPU is blocklisted or the GPU has reported to render on less than 15 fps tier: 0 is assigned. One should provide a fallback to a non-WebGL experience.

Based on the reported fps the GPU is then classified into either tier: 1 (>= 15 fps), tier: 2 (>= 30 fps) or tier: 3 (>= 60 fps). The higher the tier the more graphically intensive workload you can offer to the user.

API

getGPUTier({
  /**
   * URL of directory where benchmark data is hosted.
   *
   * @default https://unpkg.com/detect-gpu@{version}/dist/benchmarks
   */
  benchmarksURL?: string;
  /**
   * Optionally pass in a WebGL context to avoid creating a temporary one
   * internally.
   */
  glContext?: WebGLRenderingContext | WebGL2RenderingContext;
  /**
   * Whether to fail if the system performance is low or if no hardware GPU is
   * available.
   *
   * @default true
   */
  failIfMajorPerformanceCaveat?: boolean;
  /**
   * Framerate per tier for mobile devices.
   *
   * @defaultValue [0, 15, 30, 60]
   */
  mobileTiers?: number[];
  /**
   * Framerate per tier for desktop devices.
   *
   * @defaultValue [0, 15, 30, 60]
   */
  desktopTiers?: number[];
  /**
   * Optionally override specific parameters. Used mainly for testing.
   */
  override?: {
    renderer?: string;
    /**
     * Override whether device is an iPad.
     */
    isIpad?: boolean;
    /**
     * Override whether device is a mobile device.
     */
    isMobile?: boolean;
    /**
     * Override device screen size.
     */
    screenSize?: { width: number; height: number };
    /**
     * Override how benchmark data is loaded
     */
    loadBenchmarks?: (file: string) => Promise<ModelEntry[]>;
  };
})

Support

Special care has been taken to make sure all browsers that support WebGL are also supported by detect-gpu including IE 11.

Changelog

Changelog

Licence

My work is released under the MIT license.

detect-gpu uses both mobile and desktop benchmarking scores from https://gfxbench.com.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].