nvline

Crates.ionvline
lib.rsnvline
version0.1.0
sourcesrc
created_at2024-06-22 14:16:56.11448
updated_at2024-06-22 14:16:56.11448
descriptionA simple command line tool to record your gpu usage
homepage
repositoryhttps://github.com/drbh/nvline
max_upload_size
id1280485
size33,332
drbh (drbh)

documentation

README

nvline

Crates.io Version Crates.io Downloads

your nvidia gpu usage timeline.

cargo install nvline

Features

the following command will record 100 lines of nvidia-smi output every 1000 milliseconds to log1.jsonl.

nvline --max-lines 100 --interval 1000 --file-path log1.jsonl
# 2024-06-21T04:20:58.576466Z  INFO nvline: name=NVIDIA A10G device=0 used=4 percent=4/23028 (0.02%)
# 2024-06-21T04:20:59.635555Z  INFO nvline: name=NVIDIA A10G device=0 used=4 percent=4/23028 (0.02%)
# 2024-06-21T04:21:00.691742Z  INFO nvline: name=NVIDIA A10G device=0 used=4 percent=4/23028 (0.02%)
# 2024-06-21T04:21:01.751656Z  INFO nvline: name=NVIDIA A10G device=0 used=4 percent=4/23028 (0.02%)

logfile looks like

{"driver_version":"545.23.08","index":0,"memory_free":22508,"memory_total":23028,"memory_used":4,"name":"NVIDIA A10G","temperature_gpu":30,"timestamp":1718943658}
{"driver_version":"545.23.08","index":0,"memory_free":22508,"memory_total":23028,"memory_used":4,"name":"NVIDIA A10G","temperature_gpu":30,"timestamp":1718943659}
{"driver_version":"545.23.08","index":0,"memory_free":22508,"memory_total":23028,"memory_used":4,"name":"NVIDIA A10G","temperature_gpu":30,"timestamp":1718943660}
{"driver_version":"545.23.08","index":0,"memory_free":22508,"memory_total":23028,"memory_used":4,"name":"NVIDIA A10G","temperature_gpu":30,"timestamp":1718943661}

cli options

nvline --help`
Usage: nvline [OPTIONS]

Options:
  -m, --max-lines <MAX_LINES>  Maximum number of lines to keep in the log file [default: 100]
  -i, --interval <INTERVAL>    Interval between log entries in milliseconds [default: 1000]
  -f, --file-path <FILE_PATH>  Path to the log file [default: gpu_log.jsonl]
  -h, --help                   Print help
  -V, --version                Print version

Commit count: 8

cargo fmt