# gpuinfo
[](https://crates.io/crates/gpuinfo)
[](LICENSE)
[](https://deps.rs/repo/github/BDHU/gpuinfo)

A small command-line tool used to query and monitor GPU status.

NOTE: We only support NVIDIA GPUs currently. All contributions are welcome! This is an ongoing project and there might be changes in the future. The tool is tested on Linux. It might also work on macOS and Windows with some features missing.
Usage
-----
```bash
$ gpu-info
```
Common options:
* `-w`, `--watch`: Prints GPU information to terminal every second
* `-i`, `--interval <seconds>`: Prints GPU information to terminal at the given interval
* `-f`, `--format <text|json|csv>`: Output format (default: text)
* `--no-color`: Disable ANSI colors in text output
* `--no-header`: Disable CSV header row
* `-g`, `--gpu <index>`: Select a specific GPU by index
* `-v`, `--verbose`: Verbose output (text)
* `-q`, `--quiet`: Minimal output (text)
Examples:
```bash
# Watch with default text output
gpu-info --watch
# Output JSON for tooling
gpu-info --format json
# Output CSV without a header (useful for appending)
gpu-info --format csv --no-header
```
Installation
------------
The crate is publicly available at [crates.io](https://crates.io/crates/gpuinfo):
```bash
cargo install gpuinfo
```
Output
------
Text output (default):
> [0] RTX 4090 | SM8.9 | 12% | 2048/24576MB | 45C | Fan:30% | 120/450W | 2100MHz/10500MHz | Gen4x16 | python:512MB
* `[0]`: GPU index
* `RTX 4090`: GPU name
* `SM8.9`: Compute capability
* `12%`: GPU utilization
* `2048/24576MB`: Memory used/total
* `45C`: Temperature
* `Fan:30%`: Fan speed (if available)
* `120/450W`: Power usage/limit (if available)
* `2100MHz/10500MHz`: Graphics/memory clocks (if available)
* `Gen4x16`: PCIe link info (if available)
* `python:512MB`: Running processes and their GPU memory use
CSV output (with header by default):
```text
index,name,uuid,gpu_util%,mem_util%,mem_used_mb,mem_total_mb,temp_c,power_w,power_limit_w,clock_graphics_mhz,clock_memory_mhz,fan%,pcie_gen,pcie_width,process_count
```
License
-------
[MIT License](LICENSE)