npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

bare-gpu-info

v0.1.1

Published

GPU information for Bare

Readme

bare-gpu-info

https://github.com/holepunchto/libgpuinfo bindings for Bare. Enumerates the GPUs available on the system and reports static device information, detected graphics drivers, and runtime utilization.

npm i bare-gpu-info

Usage

const GPUInfo = require('bare-gpu-info')

const info = new GPUInfo()

console.log(info.drivers()) // { vulkan: true, metal: true, ... }

for (const gpu of info) {
  console.log(gpu.name, gpu.vendor, gpu.type)
}

const usage = info.sample(0)

console.log(usage.compute) // Fraction in [0, 1], or `undefined` if unavailable

info.destroy()

API

const info = new GPUInfo()

Initialize a query context. The context enumerates the available devices and detects the supported drivers up front, and additionally retains the state needed to compute utilization as a delta between successive samples.

Call info.destroy() when done to release the context. The context is also released automatically when garbage collected.

info.length

The number of GPUs enumerated in the system.

info.drivers()

Get the graphics APIs for which a local driver was detected on the system, returned as an object of booleans:

drivers = {
  vulkan, // Vulkan
  opencl, // OpenCL
  opengl, // OpenGL, including OpenGL ES via EGL
  webgpu, // WebGPU, via a native Dawn or wgpu implementation
  metal, // Apple Metal, only available on macOS
  direct3d11, // Direct3D 11, only available on Windows
  direct3d12, // Direct3D 12, only available on Windows
  cuda, // NVIDIA CUDA
  levelZero, // Intel oneAPI Level Zero
  rocm // AMD ROCm/HIP
}

const gpu = info.gpu(index)

Get static information about the GPU at index, where index is in the range [0, info.length). The values are static for the lifetime of the process and describe the hardware rather than its current load. Throws a RangeError if index is out of range.

gpu = {
  name, // Human-readable model name, `null` if unknown
  vendor, // Human-readable vendor name, `null` if unknown
  driverName, // Kernel driver bound to the device, e.g. 'amdgpu' (Linux only), `null` if unknown
  driverVersion, // Driver software version, `null` if unknown
  type, // The device category, as a value of `constants.gpuType`
  drivers, // The graphics APIs the device can be driven by, as in `info.drivers()`
  vendorId, // PCI vendor identifier, e.g. `0x10de` for NVIDIA, `undefined` if unknown
  deviceId, // PCI device identifier, `undefined` if unknown
  subsystemId, // PCI subsystem identifier, `undefined` if unknown
  revision, // PCI revision
  unifiedMemory, // Whether the device shares a unified memory space with the CPU
  memory // Total video memory in bytes, `undefined` if unknown
}

const gpus = info.gpus()

Get static information about all enumerated GPUs, returned as an array. Equivalent to calling info.gpu(index) for every index.

const usage = info.sample(index)

Sample the runtime utilization of the GPU at index, where index is in the range [0, info.length). Throws a RangeError if index is out of range.

usage = {
  compute, // Fraction of compute capacity in use, in [0, 1]
  encode, // Fraction of video encode capacity in use, in [0, 1]
  decode, // Fraction of video decode capacity in use, in [0, 1]
  memoryUsed, // Memory currently in use, in bytes, `undefined` if unknown
  memoryTotal, // Total memory available to the device, in bytes, `undefined` if unknown
  power, // Instantaneous power draw, in watts
  temperature // Device temperature, in degrees Celsius
}

Metrics that could not be determined on the current platform are reported as undefined.

info.destroy()

Destroy the query context. Safe to call more than once. Any subsequent use of the context throws.

The class also implements Symbol.dispose, so it can be scoped to a using declaration and destroyed automatically:

using info = new GPUInfo()

console.log(info.drivers())

for (const gpu of info) { ... }

GPUInfo is iterable, yielding the static information for each enumerated GPU in turn.

GPUInfo.constants

constants = {
  gpuType: { UNKNOWN, INTEGRATED, DEDICATED, VIRTUAL, EXTERNAL }
}

License

Apache-2.0