Skip to main content

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-smi to 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+C supported).
  • 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


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)

Uploaded Source

Built Distribution

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

occgpu-0.1.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

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

Hashes for occgpu-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c0e73c51005c970af17cb3860a12a7debe07614e7fd4f59a6ee8ba91a9512280
MD5 9dc4b390bdf03b515ff5c3b1f1c17ec3
BLAKE2b-256 2be7c0b292788faa60fa6e00c865153773d0caff21640692a9b4c844c1791706

See more details on using hashes here.

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

Hashes for occgpu-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 75b456ad3fe37c1cd7653c26c9110692f218c4f7188fe9b1c9e977c2b8a41706
MD5 3ade5c26c5f1127c2b654dc5157c6676
BLAKE2b-256 8fb593c53fd9b5d1710f18c2960f5109ff3c7c45a8f7cc0d1e0102335de1cebd

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