A tool to occupy free GPU memory and prevent others from using it
Project description
occgpu: Occupy Free GPU Memory
Prevent others from using idle GPUs by automatically occupying their free memory.
Perfect for researchers or engineers who want to reserve GPU resources in shared environments (e.g., lab servers, cloud clusters).
🚀 Features
- ✅ Auto-detect free GPUs – Uses
nvidia-smito find GPUs with high free memory. - ✅ Configurable threshold – Only target GPUs where
free_memory / total_memory > proportion. - ✅ Multi-GPU support – Can occupy multiple GPUs simultaneously.
- ✅ Framework fallback – Supports both PyTorch and TensorFlow (falls back if one is missing).
- ✅ Command-line & environment variables – Flexible configuration via CLI or
$OCCGPU_PROPORTION,$OCCGPU_GPU_NUMS. - ✅ Safe cleanup – Gracefully terminates processes on exit (
Ctrl+Csupported). - ✅ Lightweight & standalone – No database or external services required.
📦 Installation & Usage
# Clone the repo
git clone https://github.com/howccc/occgpu.git
cd occgpu
# Install in development mode
pip install -e .
# Environment Variable Configuration
export OCCGPU_N = <NUMBERS>
export OCCGPU_P = <Proportion>
occgpu
# or configure through the CLI(priorest)
occgpu -p <PROPORTION> -n <NUMBERS>
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
occgpu-0.1.0.tar.gz
(5.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file occgpu-0.1.0.tar.gz.
File metadata
- Download URL: occgpu-0.1.0.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c0e73c51005c970af17cb3860a12a7debe07614e7fd4f59a6ee8ba91a9512280
|
|
| MD5 |
9dc4b390bdf03b515ff5c3b1f1c17ec3
|
|
| BLAKE2b-256 |
2be7c0b292788faa60fa6e00c865153773d0caff21640692a9b4c844c1791706
|
File details
Details for the file occgpu-0.1.0-py3-none-any.whl.
File metadata
- Download URL: occgpu-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75b456ad3fe37c1cd7653c26c9110692f218c4f7188fe9b1c9e977c2b8a41706
|
|
| MD5 |
3ade5c26c5f1127c2b654dc5157c6676
|
|
| BLAKE2b-256 |
8fb593c53fd9b5d1710f18c2960f5109ff3c7c45a8f7cc0d1e0102335de1cebd
|