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,
gxserves 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 separategxoptions 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
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 gx_cli-0.1.2.tar.gz.
File metadata
- Download URL: gx_cli-0.1.2.tar.gz
- Upload date:
- Size: 41.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c071b86f4f3a8420aec2d51a2235e7458f86eeb3b66a8ce1051a729483355ff
|
|
| MD5 |
6d786951fca147068787dbe779278135
|
|
| BLAKE2b-256 |
adeaa22b18e1d3a170e040f36a933a71858af5494e17c5b5d990c976e51ae613
|
File details
Details for the file gx_cli-0.1.2-py3-none-any.whl.
File metadata
- Download URL: gx_cli-0.1.2-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
279baaf7132897dab1e97ceddc40b1f3b047dec9c538dece5cb75c486358d5b0
|
|
| MD5 |
8db02632396575d0086cf39ee38197ca
|
|
| BLAKE2b-256 |
ec3c9a83d3b22ffc8be18afcb7dc6d05bcd3ade63476564b8f0c96d55911aa17
|