Skip to main content

Gpu Utils: Simple Tool for GPU Analysis and Allocation

Project description

GpuUtils

Working on a shared environment with multiple GPUs might be problematic. Advanced frameworks apply greedy approach and they tend to allocate all GPUs and all memory of your system. GpuUtils helps you to find the best GPU on your system to allocate. It also provides a gpu related information in a structure format.

Installation

The easiest way to install GpuUtils is to install it via PyPI

pip install gpuutils

Analyzing system

Running nvidia-smi command in the command prompt allows users to monitor GPU related information such as memory and utilization. Herein, system analysis function loads GPU related information into a pandas data frame or json array.

from gpuutils import GpuUtils
df = GpuUtils.analyzeSystem() #this will return a pandas data frame
#dict = GpuUtils.analyzeSystem(pandas_format = False) #this will return a json array

Default configuration of system analysis returns a Pandas data frame.

gpu_index total_memories_in_mb available_memories_in_mb memory_usage_percentage utilizations power_usages_in_watts power_capacities_in_watts
1 32480 32469 0.0339 0 43 300
2 32480 32469 0.0339 0 43 300
3 32480 32469 0.0339 0 44 300
4 32480 32469 0.0339 0 43 300
5 32480 32469 0.0339 0 43 300
6 32480 32469 0.0339 0 43 300
7 32480 32469 0.0339 0 43 300
0 32480 31031 4.4612 7 56 300

Allocation

GpuUtils can allocate GPUs as well. Calling allocation function directly finds the available GPUs and allocate based on your demand.

from gpuutils import GpuUtils
GpuUtils.allocate() #this tries to allocate a GPU having 1GB memory
#GpuUtils.allocate(required_memory = 10000)
#GpuUtils.allocate(required_memory = 10000, gpu_count=1)

Support

There are many ways to support a project - starring⭐️ the GitHub repos is just one.

Licence

GpuUtils is licensed under the MIT License - see LICENSE for more details.

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

gpuutils-0.0.1.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

gpuutils-0.0.1-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file gpuutils-0.0.1.tar.gz.

File metadata

  • Download URL: gpuutils-0.0.1.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.6.4

File hashes

Hashes for gpuutils-0.0.1.tar.gz
Algorithm Hash digest
SHA256 c35268f1dd89fe42aa4618ca4fd768d38951e2577bce308b001ba4005160acb4
MD5 1298b29eb790a3be8329317cf4633932
BLAKE2b-256 d3feafb374c810c833373765fd00374e6b3b55c3ea759fdd80d91e141ff150bc

See more details on using hashes here.

File details

Details for the file gpuutils-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: gpuutils-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.6.4

File hashes

Hashes for gpuutils-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 02486dd7d73924096cb8b31efb23a15e15dc7f5d7b87866a48d8207e0f3b4499
MD5 40ae5a144970146f999ab31a3f1827ff
BLAKE2b-256 bde3ebd6e705990bbc88ddac5c5e1ee2fa85c45aa51a9510cead2b789c968763

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page