Skip to content

GPU Module

Sam edited this page Jul 6, 2024 · 4 revisions

The gpu module displays information such as your GPU's name, vendor and memory. It creates a new line for each individual GPU.

Using

Insert into the modules array.

Configuration

  • method -> (String) The method used to find GPU info, see below for more details.
  • cache -> (Bool) Whether to cache the information, only recommended for if your using the glxinfo method. See below for more details.
  • title -> (String) The module title.
  • format -> (String) The format used to display the module. Check below to see available placeholders.
  • title_color -> (Optional/String) Override the title color to be used.
  • title_bold -> (Optional/Bool) Make the title bold.
  • title_italic -> (Optional/Bool) Make the title italic.
  • seperator -> (Optional/Char) Override the separator to be used.
  • use_ibis -> (Optional/Bool) Override whether to display in 'ibibytes instead of 'gabytes.
Method & Cache Explanation

Getting accurate GPU information in Linux can be a bit of a pain in the butt. To give you the choice between accuracy vs speed, CrabFetch provides two methods to getting GPU information; pcisysfile and glxinfo.

pcisysfile scans your computer's PCI bus and uses whatever data that has about your GPU. This can be fast but also kind of inaccurate, as it only provides ID's and some vendor's aren't very good at defining those.
glxinfo is a 3rd party command that directly speaks to your GPU using OpenGL and provides you whatever information it provides. This provides a much more accurate reading, but the problem is that it's really slow.

Here's a benchmark comparing the two, without caching;
image

To help you decide;

  • If you want un-cached speed or are benchmarking with other fetchers; use pcisysfile without caching.
  • If you want un-cached accuracy and don't mind it being a bit slow; use glxinfo without caching.
  • If you want accuracy with speed and don't mind cheating a little; use glxinfo with caching.
Format placeholders;
  • {vendor} -> The name of the GPU's vendor, e.g AMD or Intel.
  • {model} -> The name of the GPU's model, e.g Radeon RX 7700.
  • {vram} -> The amount of virtual memory the GPU has.
Default Configuration
[gpu]
method = "pcisysfile"
cache = false

title = "GPU"
format = "{vendor} {model} ({vram})"

Example

modules = [
    "gpu"
]

[gpu]
method = "pcisysfile"
cache = false

title = "Graphics"
format = "{vendor} {model}"