Skip to main content

PyPI - Version PyPI - License PyPI - Python Version PyPI - Downloads

Auto Cuda Selector

A simple tool to select the optimal CUDA device based on memory, power, temperature, or utilization. It supports fallback to CPU and custom sorting functions. Supports CUDA devices on Linux and MPS devices on macOS. Full documentation be found here

Install

pip install cuda-selector

Usage

from cuda_selector import auto_cuda

# Select the CUDA device with the most memory available
device = auto_cuda()

# Select the CUDA device with the lowest power usage
device = auto_cuda('power')

# Select the CUDA device with the lowest GPU utilization
device = auto_cuda('utilization')

# Select the CUDA device with the lowest temperature
device = auto_cuda('temperature')

# Select multiple devices with the most free memory
devices = auto_cuda(n=3)

# Exclude specific devices by their index
devices = auto_cuda(exclude=[0, 1])

# Apply thresholds for power usage and utilization
devices = auto_cuda(thresholds={'power': 150, 'utilization': 70})

# Use a custom ranking function for selecting devices
devices = auto_cuda(sort_fn=lambda d: d['memory_free'] * 0.7 + d['utilization'] * 0.3)

Metadata

Release files for cuda-selector 0.1.5

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

Source distribution (sdist)

Source distribution for cuda-selector 0.1.5
File Size Uploaded
cuda_selector-0.1.5.tar.gz 4.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cuda-selector 0.1.5
File Interpreter ABI Platform
cuda_selector-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 8.8 kB

Release files / cuda_selector-0.1.5.tar.gz

Download URL cuda_selector-0.1.5.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
5d4d37c6109ac4596016873c763eef6a033d168eea7d9a2d69453e87a9e0b8e1
BLAKE2b-256 checksum
How to use checksums
2a488e71ef362a7cac95b7b7c353bc4ff3280df312fb6b306125b4524fc1f1f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.10

Release files / cuda_selector-0.1.5-py3-none-any.whl

Download URL cuda_selector-0.1.5-py3-none-any.whl
Size 4.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cf477d8967cd0fb558750b6e97dcb280d1fff824edcaf2d415f8bf24bcee2050
BLAKE2b-256 checksum
How to use checksums
b7c55824359a268524dd9090e6972f230fbb86f85c22dd78bba523e931a83000
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.10

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

1 release file

0.1.0

1 release file

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