Skip to main content

cuthon

Cuthon is a simple Python script to avoid setting CUDA_VISIBLE_DEVICES when running python programs on a GPU. The script will find the first unused GPU(s) then run the program as usual. At its simplest:

cuthon my_program.py

This tool is intended for a fairly niche use case: running python programs on an interactive node which has more than one GPU. For those that have done this often you may be relieved at never having to run nvidia-smi followed by setting CUDA_VISIBLE_DEVICES again (when running a python program that is).

Install

Install with pip:

pip install cuthon

Usage

In general, use cuthon just like you would use python.

  • cuthon to launch a python repl.

  • cuthon -V to see the python version number.

  • cuthon train_model.py to run your program.

For help on available cuthon options type:

cuthon -h --

The output will be:

usage: cuthon.py [-h] [-n NUM_GPUS] [-l]

Select the first unused GPU(s) and run Python. To pass the script arguments
specify '--' between cuthon arguments and arguments to be passed through to
your script. If '--' is not specified, then all arguments will be passed
through.

optional arguments:
  -h, --help            show this help message and exit
  -n NUM_GPUS, --num_gpus NUM_GPUS
                        The number of GPUs to use.
  -l, --least_used      Switch from an unused to a least-used policy.

For example, to run on two available GPUs execute:

cuthon -n 2 -- train_model.py

Metadata

Release files for cuthon 0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cuthon 0.4
File Size Uploaded Provenance Actions
cuthon-0.4.tar.gz 3.0 kB Without provenance Details for cuthon-0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cuthon 0.4
File Interpreter ABI Platform Actions
cuthon-0.4-py2.py3-none-any.whl Python 3, Python 2 none any Details for cuthon-0.4-py2.py3-none-any.whl

Total release size: 6.4 kB

Release files / cuthon-0.4.tar.gz

Download URL cuthon-0.4.tar.gz
Size 3.0 kB
Tags Source
SHA-256 checksum
How to use checksums
60fc6ded70908fc6ede0dff550b0142d98995a53cd9415513a56e01b3c599d50
BLAKE2b-256 checksum
How to use checksums
a0cf31b2b0928bfc32a56cabb9bc7d2ecbb2c0243d1df754d143df5e1dc1a68a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / cuthon-0.4-py2.py3-none-any.whl

Download URL cuthon-0.4-py2.py3-none-any.whl
Size 3.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
fa686a40d353261ba645f141e37133c8993b7bbe40a6e4fbc5beb04b307e14d2
BLAKE2b-256 checksum
How to use checksums
f060d5636a0e6b169553de0b182d0277a8ba69c1d3d0cb716bceb780015811c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for cuthon 0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page