Detect Gpu

Classifies GPUs based on their 3D rendering benchmark score allowing the developer to provide sensible default settings for graphically intensive applications.
Alternatives To Detect Gpu
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Cpu X1,657
11 days ago2gpl-3.0C
CPU-X is a Free software that gathers information on CPU, motherboard and more
Vkfft1,050
6 days ago41mitC
Vulkan/CUDA/HIP/OpenCL/Level Zero/Metal Fast Fourier Transform library
Detect Gpu856293 days ago124July 17, 202225mitTypeScript
Classifies GPUs based on their 3D rendering benchmark score allowing the developer to provide sensible default settings for graphically intensive applications.
Oceananigans.jl787
2 days ago151mitJulia
🌊 Julia software for fast, friendly, flexible, ocean-flavored fluid dynamics on CPUs and GPUs
Zluda762
2 years ago11otherC++
CUDA on Intel GPUs
Weblas6661545 years ago3January 11, 201726mitJavaScript
GPU Powered BLAS for Browsers :gem:
Spark Rapids539
10 hours ago10April 14, 20221,006apache-2.0Scala
Spark RAPIDS plugin - accelerate Apache Spark with GPUs
Pyhpc Benchmarks258
4 months ago6unlicensePython
A suite of benchmarks for CPU and GPU performance of the most popular high-performance libraries for Python :rocket:
Nvbench244
14 days ago51apache-2.0Cuda
CUDA Kernel Benchmarking Library
Mixbench211
3 months ago7gpl-2.0C++
A GPU benchmark tool for evaluating GPUs and CPUs on mixed operational intensity kernels (CUDA, OpenCL, HIP, SYCL, OpenMP)
Alternatives To Detect Gpu
Select To Compare


Alternative Project Comparisons
Readme

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/[email protected]{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.

Popular Benchmark Projects
Popular Gpu Projects
Popular Software Performance Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Typescript
Benchmark
Gpu
Webgl
Webgl2
Threejs
Pixijs