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.4.tar.gz (41.1 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.4-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for gx_cli-0.1.4.tar.gz
Algorithm Hash digest
SHA256 e93a923ae4a5a8bba59c944773b1ad2a0acdccd6a3193f1a3578e49122f77faa
MD5 6fe0fc880c1e4f9d606decd9ae4ad0a7
BLAKE2b-256 8ece9d502c7b168e589954556be79d56a6e70052f23205ae178b5395dcd4f5de

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for gx_cli-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 017e95db0de4e07d046ffa86f55b209583aef19057a0fc7f3d3712b0544901f8
MD5 0f421a68f76ace544c6a2af9a3b2cc0e
BLAKE2b-256 2aa1144969f44a485485bc6a530272951f6ddf9bc72b279539bbd7fe690acd68

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