Skip to main content

A simple CLI tool that runs your commands once GPUs are available.

Project description

GPU eXecutor (gx)

A simple CLI tool that runs your commands once GPUs are available.

Why gx?

Tired of manually checking nvidia-smi and waiting for GPUs to become free? gx automates this process by monitoring GPU availability and intelligently selecting GPUs with the least utilization for your task.

It can also notify you upon job start and completion, eliminating the need to constantly check your experiment's status.

[!NOTE] While dedicated job schedulers like Slurm or Determined AI offer more comprehensive solutions, gx serves as a practical workaround, especially in environments like university labs where GPU resources might be managed directly on bare-metal machines without a scheduling system.

Quick Start

# Install using uv (recommended) or pip
uv tool install gx-cli
# or: pip install gx-cli

# Example 1: Wait for one GPU with at least 40GB VRAM, then run training
gx -m 40 python train.py

# Example 2: Wait for two exclusive GPUs, each with 32GB VRAM, then run distributed training
gx -m 32 -n 2 -x python distributed_train.py

[!TIP] If your command includes arguments that might conflict with gx (e.g., -m), use -- to separate gx options from your command: gx [gx-options] -- your_command [your-command-options]

Consider using scripts or command runners (like just) to simplify complex commands.

Notification Setup

gx supports notifications via a configuration file located at ~/.config/gx/config.toml.

Generate a default configuration file:

gx --config

Configure your preferred notification service:

[notification]
# Supported services: "bark", "telegram", "slack". Set to "" to disable.
service = "slack"
notify_on_gpu_found = true
notify_on_task_complete = true

# --- Service-specific settings ---
# Add the details for your chosen service below.

# Example for Slack:
[notification.slack]
webhook_url = "your-slack-webhook-url"

# Example for Telegram:
[notification.telegram]
bot_token = "your-bot-token"
chat_id = "your-chat-id"

# Example for Bark:
[notification.bark]
key = "your-bark-key"
# server = "https://api.day.app" # Optional: Specify a custom Bark server URL

For service setup instructions, refer to the official documentation:

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

gx_cli-0.1.0.tar.gz (40.8 kB view details)

Uploaded Source

Built Distribution

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

gx_cli-0.1.0-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file gx_cli-0.1.0.tar.gz.

File metadata

  • Download URL: gx_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 40.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.14

File hashes

Hashes for gx_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b7f9adb55abb1cff3929d48d05b4ca85dc3fb47050a2e35c5956b90c9100fd30
MD5 605f5a0656e596ef980ca0ce07d742a2
BLAKE2b-256 3745a789d82439d7a2b2dc2ff3d1ec62aa641209f6c8068f8c725e81eeddc6dd

See more details on using hashes here.

File details

Details for the file gx_cli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: gx_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.14

File hashes

Hashes for gx_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7bf094979937b4a98f211c34a2e59e846a1edd0c2717668d1c8138279406c9ec
MD5 b06ecf433e87aaa7a678c8e67dd5e8f7
BLAKE2b-256 2c8914b0e94d8cbc60ce10565aa41681993aa2ee3d5d82cde091042c573a8f9f

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