Metadata-Version: 2.4
Name: cgpu-info
Version: 0.3.0
Summary: Quick CUDA/GPU status summary for ML engineers
Project-URL: Homepage, https://github.com/augustsletto/cgpu
Project-URL: Repository, https://github.com/augustsletto/cgpu
Project-URL: Issues, https://github.com/augustsletto/cgpu/issues
Author-email: August Sletto <augustsletto@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: cuda,deep-learning,gpu,machine-learning,nvidia,pytorch
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.8
Requires-Dist: colorama>=0.4.0
Requires-Dist: tqdm>=4.0.0
Provides-Extra: dev
Requires-Dist: black; extra == 'dev'
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: pytest-cov; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Provides-Extra: full
Requires-Dist: matplotlib; extra == 'full'
Requires-Dist: numpy; extra == 'full'
Requires-Dist: pandas; extra == 'full'
Requires-Dist: scikit-learn; extra == 'full'
Requires-Dist: seaborn; extra == 'full'
Requires-Dist: torch; extra == 'full'
Requires-Dist: torchaudio; extra == 'full'
Requires-Dist: torchvision; extra == 'full'
Provides-Extra: science
Requires-Dist: matplotlib; extra == 'science'
Requires-Dist: numpy; extra == 'science'
Requires-Dist: pandas; extra == 'science'
Requires-Dist: scikit-learn; extra == 'science'
Requires-Dist: seaborn; extra == 'science'
Provides-Extra: torch
Requires-Dist: torch; extra == 'torch'
Requires-Dist: torchaudio; extra == 'torch'
Requires-Dist: torchvision; extra == 'torch'
Description-Content-Type: text/markdown

# cgpu

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

## Installation

```bash
uv pip install cgpu-info
```

Or with pip:
```bash
pip install cgpu-info
```

## Usage

### Python
```python
from cgpu import cgpu

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

### Progress bar with GPU metrics
```python
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
```bash
# 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:
```bash
# 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:

```bash
# 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
