A simple tool to select the optimal CUDA device based on memory, power, or utilization.
Project description
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)
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 cuda_selector-0.1.5.tar.gz.
File metadata
- Download URL: cuda_selector-0.1.5.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d4d37c6109ac4596016873c763eef6a033d168eea7d9a2d69453e87a9e0b8e1
|
|
| MD5 |
bc27a1ccde7beb2b3f8b0c1d215fe031
|
|
| BLAKE2b-256 |
2a488e71ef362a7cac95b7b7c353bc4ff3280df312fb6b306125b4524fc1f1f7
|
File details
Details for the file cuda_selector-0.1.5-py3-none-any.whl.
File metadata
- Download URL: cuda_selector-0.1.5-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf477d8967cd0fb558750b6e97dcb280d1fff824edcaf2d415f8bf24bcee2050
|
|
| MD5 |
53773713bf6bf57526e38a8107da0403
|
|
| BLAKE2b-256 |
b7c55824359a268524dd9090e6972f230fbb86f85c22dd78bba523e931a83000
|