Metadata-Version: 2.1
Name: sustainer
Version: 0.0.2
Summary: Keep GPU and CPU temperatures within given limit.
Home-page: https://github.com/james4ever0/sustain_gpu_temperature
License: DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 
                            Version 2, December 2004 
        
         Copyright (C) 2004 Sam Hocevar <sam@hocevar.net> 
        
         Everyone is permitted to copy and distribute verbatim or modified 
         copies of this license document, and changing it is allowed as long 
         as the name is changed. 
        
                    DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 
           TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 
        
          0. You just DO WHAT THE FUCK YOU WANT TO.
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pynvml
Requires-Dist: xmltodict

# Sustainer

Keep GPU and CPU temperatures within given limit.

With it you no longer have to worry about hardware heating up when running long time tasks, especially for your cheap P106 and P104 GPU cards.

## Demo

You can use the command line tool `sustainer`:

```bash
sustainer # default target is 'all', so both cpu and gpu stats will be sustained
python3 -m sustainer # alternative syntax

# to specify only cpu or gpu as target
sustainer --target cpu 
sustainer --target gpu  

# changing default configuration:
env TARGET_TEMP=60 sustainer # default: 65
env MAX_POWER_LIMIT_RATIO=0.7 sustainer # default: 0.8
env MAX_FREQ_RATIO=0.7 sustainer # default: 0.8
```

Optionally run with a process manager such as [pm2](https://pm2.keymetrics.io/) to persist as daemon:

```bash
pm2 start -n sustainer_daemon sustainer
pm2 save
```

If you want to call it with code, check out the [test files](./tests/).

## Install

First, install from PyPI:

```bash
pip install sustainer
```

Then, install the following binaries:

```bash
sudo apt install -y cpufrequtils lm-sensors
```

For NVIDIA GPU, you need to install related drivers and make sure `nvidia-smi` is in PATH.

For AMD GPU, install ROCm drivers and make sure `rocm-smi` is in PATH.

## Supported hardware

CPU: Intel, AMD, ARM

GPU: NVIDIA, AMD

## Supported platform

Linux only currently.

## Stargazers

<picture>
  <source
    media="(prefers-color-scheme: dark)"
    srcset="
      https://api.star-history.com/svg?repos=james4ever0/sustain_gpu_temperature&type=Date&theme=dark
    "
  />
  <source
    media="(prefers-color-scheme: light)"
    srcset="
      https://api.star-history.com/svg?repos=james4ever0/sustain_gpu_temperature&type=Date
    "
  />
  <img
    alt="Star History Chart"
    src="https://api.star-history.com/svg?repos=james4ever0/sustain_gpu_temperature&type=Date"
  />
</picture>
