Skip to main content

A simple tool to select the optimal CUDA device based on memory, power, or utilization.

Project description

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)

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

cuda_selector-0.1.5.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cuda_selector-0.1.5-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

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

Hashes for cuda_selector-0.1.5.tar.gz
Algorithm Hash digest
SHA256 5d4d37c6109ac4596016873c763eef6a033d168eea7d9a2d69453e87a9e0b8e1
MD5 bc27a1ccde7beb2b3f8b0c1d215fe031
BLAKE2b-256 2a488e71ef362a7cac95b7b7c353bc4ff3280df312fb6b306125b4524fc1f1f7

See more details on using hashes here.

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

Hashes for cuda_selector-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 cf477d8967cd0fb558750b6e97dcb280d1fff824edcaf2d415f8bf24bcee2050
MD5 53773713bf6bf57526e38a8107da0403
BLAKE2b-256 b7c55824359a268524dd9090e6972f230fbb86f85c22dd78bba523e931a83000

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