Skip to main content

Quick CUDA/GPU status summary for ML engineers

Project description

cgpu

Quick CUDA/GPU status summary for ML engineers. One import, one call, all the info you need.

Installation

uv pip install cgpu-info

Or with pip:

pip install cgpu-info

Usage

Python

from cgpu import cgpu

device = cgpu()
# Now use `device` in your code
model.to(device)

Progress bar with GPU metrics

from cgpu import ctqdm

# Drop-in replacement for tqdm - shows GPU temp, VRAM, and utilization
for batch in ctqdm(dataloader, desc="Training"):
    ...

Output:

Training:  50%|█████     | 50/100 [00:05<00:05] 42°C | 8.2/24.0GB | GPU: 87%

Install nvidia-ml-py for temperature and utilization. Without it, VRAM usage is still shown via torch.

CLI

# Show GPU status
cgpu

# Show version
cgpu --version

That's it! You'll see a colorful summary like:

═══════════════════════════════════════
          GPU Status Summary
═══════════════════════════════════════
✓ CUDA Available
  Device: cuda
  GPU Count: 1
  [0] NVIDIA GeForce RTX 4090
      VRAM: 24.0 GB
      Allocated: 0.00 GB
      Reserved: 0.00 GB
      Temp: 42°C
      GPU Util: 0%
      Mem Util: 0%
  CUDA Version: 12.1
  cuDNN Version: 8902
  PyTorch: 2.1.0
═══════════════════════════════════════

What it shows

  • CUDA availability status
  • Device string (cuda or cpu)
  • GPU name and count
  • VRAM total and usage
  • Temperature (color-coded: green < 50°C, yellow < 70°C, red >= 70°C)
  • GPU/Memory utilization
  • CUDA, cuDNN, and PyTorch versions

Installing PyTorch with specific CUDA version

Use the built-in install helper to get PyTorch with your desired CUDA version:

# Install torch with CUDA 12.1
cgpu install --cuda 12.1

# Install torch with CUDA 12.4
cgpu install --cuda 12.4

# Install torch with CUDA 11.8
cgpu install --cuda 11.8

# Install CPU-only torch
cgpu install --cuda cpu

Optional dependencies

If you want to install additional ML packages along with cgpu:

# Full ML stack: torch, torchvision, torchaudio, numpy, pandas, matplotlib, seaborn, scikit-learn
uv pip install cgpu-info[full]

# Just PyTorch stack
uv pip install cgpu-info[torch]

# Just data science packages (no torch)
uv pip install cgpu-info[science]

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cgpu_info-0.3.0.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cgpu_info-0.3.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file cgpu_info-0.3.0.tar.gz.

File metadata

  • Download URL: cgpu_info-0.3.0.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for cgpu_info-0.3.0.tar.gz
Algorithm Hash digest
SHA256 1a92211418f2b078fd6917ce08d544f73989b5994ea98e0296fa1e4dac4e920a
MD5 332985077b0d31c256527359e1e8c2fa
BLAKE2b-256 0b619e09ebc5252286c5138bd819e08ff45dcaa3b0c8f6d87ff0f161126fa37b

See more details on using hashes here.

File details

Details for the file cgpu_info-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: cgpu_info-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for cgpu_info-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 93e53330098defac189c2196f34ffb2d471eb2827319b416de3241cc17fdd051
MD5 9a62ac0f92a8e802b5a0a330c7641042
BLAKE2b-256 558f14bf5122df0651bf44c76f1ffe022139b9f5502f879a8e01594b47257967

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page