Name | caioh-nvml-gpu-control JSON |
Version |
2.1.2.1
JSON |
| download |
home_page | None |
Summary | A small program that uses the NVIDIA Management Library to control the GPU independent of OS or display server. This project is not provided or endorsed by NVIDIA |
upload_time | 2025-08-06 15:24:06 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | None |
keywords |
nvidia
gpu
nvml
fan control
power control
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# CaioH NVML GPU Control
This is a small program that uses the NVIDIA Management Library (NVML) to monitor GPU temperature and set fan speed. NVML is being used, because it is OS and display sever agnostic (that means it doesn't depend on X11 or Windows). Another important reason is that the official NVIDIA tool (NVIDIA smi) does not currently support fan control.
## Disclaimer
* This project is NOT endorsed or sponsored by NVIDIA
* This project is independent and not affiliated to NVIDIA
## Supported hardware
* Any NVIDIA CUDA supported card with a driver higher or equal to version 520
## Dependencies
To use it, you must have installed:
* NVIDIA's proprietary drivers (>= v520)
* Python 3
* [nvidia-ml-py](https://pypi.org/project/nvidia-ml-py/) (NVIDIA's official python bindings)
You will also need **admin/root** privileges to be able to **set anything**. Query can be done by unprivileged users however.
## Installation
### Windows
Install the package with [pip](https://packaging.python.org/en/latest/tutorials/installing-packages/) running as **admin** to make it system wide (needed for startup services)
```bash
pip install caioh-nvml-gpu-control
```
### Linux
Install the package with [pipx](https://github.com/pypa/pipx) running as root, so it can be [installed system-wide](https://pipx.pypa.io/stable/installation/#-global-argument) (needed for startup services).
```bash
sudo pipx install --global caioh-nvml-gpu-control
```
> [!WARNING]
> Files must be writable only to admin/root, otherwise unprivileged programs may escalate provileges with the startup services. If you followed the steps, this should be done already
## Uninstall
### Windows
Uninstall the package by running [pip](https://packaging.python.org/en/latest/tutorials/installing-packages/) as **admin**
```bash
pip uninstall caioh-nvml-gpu-control
```
### Linux
Uninstall the package by running [pipx](https://github.com/pypa/pipx) command as **root**
```bash
sudo pipx uninstall --global caioh-nvml-gpu-control
```
## How to use
> [!NOTE]
> Some commands require admin/root privileges to run, so run it with something like `sudo` (Linux) or in an admin prompt (Windows). Services already run with the highest privileges, so there is no need to prefix the command with `sudo`.
> [!TIP]
> You can start the program with `chnvml` if the Scripts directory is in the PATH or use `python -m caioh_nvml_gpu_control`.
* You must first list all cards that are connected, so you can get the name or UUID
```bash
chnvml list
```
* Then you can select a target by name
```bash
sudo chnvml control -n 'NVIDIA GeForce RTX 4080'
```
* Or by UUID
```bash
sudo chnvml control -id GPU-00000000-0000-0000-0000-000000000000
```
* And the fan speed for each temperature level (**requires admin or root**)
```bash
sudo chnvml control -n 'NVIDIA GeForce RTX 4080' -sp '10:35,20:50,30:50,35:100'
```
* You can also set a temperature or a power limit as well (**requires admin or root**)
```bash
sudo chnvml control -n 'NVIDIA GeForce RTX 4080' -sp '10:35,20:50,30:50,35:100' -tl 65 -pl 280
```
* You could also use the `--dry-run` for testing! (**no** admin or root)
```bash
chnvml control -n 'NVIDIA GeForce RTX 4080' -sp '10:35,20:50,30:50,35:100' --dry-run
```
* You can also revert to the original fan state by runnig the following command or *rebooting the machine*
```bash
sudo chnvml fan-policy --auto -n 'NVIDIA GeForce RTX 4080'
```
Note that it does not current support fan curve (or linear progression), so it works on levels. Each level the temperature is verified against the configuration (higher or equal) and then set properly. Also, each temperature associated with speed is ordered automatically. (think of it as a staircase graph)
```
Temp : speed(%)
1. 40 : 100 (>=40°C - 100%)
2. 30 : 50 (>=30°C - 50%)
3. 20 : 30 (>=20°C - 30%)
4. Default speed (DS)
___________________________
41°C - 100%
21°C - 30%
19°C - Default speed
```
#### Usage actions and options
```
python ./nvml_gpu_control.py <ACTION> <OPTIONS>
ACTIONS
help
Display help text
list
List all available GPUs connected to the system by printing its name and UUID
control
Allows the use of all controls in a single command/loop. Each setting is enabled by configuring its respective option: fan curve, power and temperature
fan-info
Shows information about fan speed
fan-policy <--auto|--manual>
Changes the fan control policy to automatic (vBIOS controlled) or manual. Note that when the fan speed is changed, the NVML library automatically changes this setting to manual. This setting is useful to change the GPU back to its original state
fan-policy-info
Shows information about the current fan policy
power-limit-info
Shows information about the power limit of the selected GPU
thresholds-info
Shows information about temperature thresholds in dregrees Celsius of the selected GPU.
OPTIONS
--name OR -n <GPU_NAME>
Select a target GPU by its name. Example: --name "NVIDIA GeForce RTX 4080". Note: UUID has preference over name
--uuid OR -id <GPU_UUID>
Select a target GPU by its Universally Unique IDentifier (UUID). Example: --uuid "GPU-00000000-0000-0000-0000-000000000000". Note: UUID has preference over name
--time-interval OR -ti <TIME_SECONDS>
Time period in seconds to wait before probing the GPU again. Works for all actions that run in a loop
--retry-interval OR -ri <TIME_SECONDS>
Time period in seconds to wait before trying to issue commands to the GPU again. Works for all actions that run in a loop
--dry-run OR -dr
Run the program, but don't change/set anything. Useful for testing the behavior of the program
--speed-pair OR -sp <TEMP_CELSIUS:SPEED_PERCENTAGE,TEMP_CELSIUS:SPEED_PERCENTAGE...>
A comma separated list of pairs of temperature in celsius and the fan speed in % (temp:speed) defining basic settings for a fan curve
--default-speed OR -ds <FAN_SPEED_PERCENTAGE>
Set a default speed for when there is no match for the fan curve settings
--manual
Sets the fan policy to manual
--auto
Sets the fan policy to automatic (vBIOS controlled)
--power-limit OR -pl <POWER_LIMIT_WATTS>
Sets the power limit of the GPU in watts
--acoustic-temp-limit OR -tl <TEMPERATURE_CELSIUS>
Sets the acoustic threshold in celsious (note that this is the same temperature limit used by GeForce Experience)
--single-use OR -su
Makes some actions work only once instead of in a loop
--verbose OR -V
When there are no settings changes, leg messages are omitted by default. This option enables them back (good for debugging)
--retry OR -rt
By default the program closes when it encounters an error, but this lets the program try to recover. It could be useful to let the service manaer restart the process
```
## Changelog
### 1.0.0.0
* Initial pypi release
### 1.1.0.0
* Added a new option: --verbose OR -V
### 2.0.0.0
* Actions removed: `fan-control`, `power-control`, `temp-control`
* Action renamed: `control-all` -> `control`
* Quality of life
* More information on initial log
* Some options aren't automatically ignored anymore
### 2.1.0.0
* Added a new option: `--retry OR -rt`
* The program now halts by default when it encounters an error, allowing the service manager to restart the process
### 2.1.1.1
* NVML dependency update: 12.570.86 -> 13.580.65
* It now reports the NVML version as well
### 2.1.2.1
* Temperature thresholds are now removed from initial information logs (it returns NOT_SUPPORTED on Linux 575.64.05, which caused all controls to fail)
* It now reports the version of the program
Raw data
{
"_id": null,
"home_page": null,
"name": "caioh-nvml-gpu-control",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "Caio Gomes Flausino <caio.hacktestes@gmail.com>",
"keywords": "NVIDIA, gpu, nvml, fan control, power control",
"author": null,
"author_email": "Caio Gomes Flausino <caio.hacktestes@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/6f/d7/965b779dc583f2ce64b272727ccf6375cf63fc3716d4bf3dbeed6249cd07/caioh_nvml_gpu_control-2.1.2.1.tar.gz",
"platform": null,
"description": "# CaioH NVML GPU Control\r\n\r\nThis is a small program that uses the NVIDIA Management Library (NVML) to monitor GPU temperature and set fan speed. NVML is being used, because it is OS and display sever agnostic (that means it doesn't depend on X11 or Windows). Another important reason is that the official NVIDIA tool (NVIDIA smi) does not currently support fan control.\r\n\r\n## Disclaimer\r\n\r\n* This project is NOT endorsed or sponsored by NVIDIA\r\n* This project is independent and not affiliated to NVIDIA\r\n\r\n## Supported hardware\r\n\r\n* Any NVIDIA CUDA supported card with a driver higher or equal to version 520\r\n\r\n## Dependencies\r\n\r\nTo use it, you must have installed:\r\n\r\n* NVIDIA's proprietary drivers (>= v520)\r\n* Python 3\r\n* [nvidia-ml-py](https://pypi.org/project/nvidia-ml-py/) (NVIDIA's official python bindings)\r\n\r\nYou will also need **admin/root** privileges to be able to **set anything**. Query can be done by unprivileged users however.\r\n\r\n## Installation\r\n\r\n### Windows\r\n\r\nInstall the package with [pip](https://packaging.python.org/en/latest/tutorials/installing-packages/) running as **admin** to make it system wide (needed for startup services)\r\n\r\n```bash\r\npip install caioh-nvml-gpu-control\r\n```\r\n\r\n### Linux\r\n\r\nInstall the package with [pipx](https://github.com/pypa/pipx) running as root, so it can be [installed system-wide](https://pipx.pypa.io/stable/installation/#-global-argument) (needed for startup services).\r\n\r\n```bash\r\nsudo pipx install --global caioh-nvml-gpu-control\r\n```\r\n\r\n> [!WARNING]\r\n> Files must be writable only to admin/root, otherwise unprivileged programs may escalate provileges with the startup services. If you followed the steps, this should be done already \r\n\r\n## Uninstall\r\n\r\n### Windows\r\n\r\nUninstall the package by running [pip](https://packaging.python.org/en/latest/tutorials/installing-packages/) as **admin**\r\n\r\n```bash\r\npip uninstall caioh-nvml-gpu-control\r\n```\r\n\r\n### Linux\r\n\r\nUninstall the package by running [pipx](https://github.com/pypa/pipx) command as **root**\r\n\r\n```bash\r\nsudo pipx uninstall --global caioh-nvml-gpu-control\r\n```\r\n\r\n## How to use\r\n\r\n> [!NOTE]\r\n> Some commands require admin/root privileges to run, so run it with something like `sudo` (Linux) or in an admin prompt (Windows). Services already run with the highest privileges, so there is no need to prefix the command with `sudo`.\r\n\r\n> [!TIP]\r\n> You can start the program with `chnvml` if the Scripts directory is in the PATH or use `python -m caioh_nvml_gpu_control`.\r\n\r\n* You must first list all cards that are connected, so you can get the name or UUID\r\n\r\n```bash\r\nchnvml list\r\n```\r\n\r\n* Then you can select a target by name\r\n\r\n```bash\r\nsudo chnvml control -n 'NVIDIA GeForce RTX 4080'\r\n```\r\n\r\n* Or by UUID\r\n\r\n```bash\r\nsudo chnvml control -id GPU-00000000-0000-0000-0000-000000000000\r\n```\r\n\r\n* And the fan speed for each temperature level (**requires admin or root**)\r\n\r\n```bash\r\nsudo chnvml control -n 'NVIDIA GeForce RTX 4080' -sp '10:35,20:50,30:50,35:100'\r\n```\r\n\r\n* You can also set a temperature or a power limit as well (**requires admin or root**)\r\n\r\n```bash\r\nsudo chnvml control -n 'NVIDIA GeForce RTX 4080' -sp '10:35,20:50,30:50,35:100' -tl 65 -pl 280\r\n```\r\n\r\n* You could also use the `--dry-run` for testing! (**no** admin or root)\r\n\r\n```bash\r\nchnvml control -n 'NVIDIA GeForce RTX 4080' -sp '10:35,20:50,30:50,35:100' --dry-run\r\n```\r\n\r\n* You can also revert to the original fan state by runnig the following command or *rebooting the machine*\r\n\r\n```bash\r\nsudo chnvml fan-policy --auto -n 'NVIDIA GeForce RTX 4080'\r\n```\r\n\r\nNote that it does not current support fan curve (or linear progression), so it works on levels. Each level the temperature is verified against the configuration (higher or equal) and then set properly. Also, each temperature associated with speed is ordered automatically. (think of it as a staircase graph)\r\n\r\n```\r\nTemp : speed(%)\r\n\r\n1. 40 : 100 (>=40\u00b0C - 100%)\r\n\r\n2. 30 : 50 (>=30\u00b0C - 50%)\r\n\r\n3. 20 : 30 (>=20\u00b0C - 30%)\r\n\r\n4. Default speed (DS)\r\n\r\n___________________________\r\n\r\n41\u00b0C - 100%\r\n\r\n21\u00b0C - 30%\r\n\r\n19\u00b0C - Default speed\r\n\r\n```\r\n\r\n#### Usage actions and options\r\n\r\n```\r\npython ./nvml_gpu_control.py <ACTION> <OPTIONS>\r\n\r\nACTIONS\r\n help\r\n Display help text\r\n\r\n list\r\n List all available GPUs connected to the system by printing its name and UUID\r\n\r\n control\r\n Allows the use of all controls in a single command/loop. Each setting is enabled by configuring its respective option: fan curve, power and temperature\r\n\r\n fan-info\r\n Shows information about fan speed\r\n\r\n fan-policy <--auto|--manual>\r\n Changes the fan control policy to automatic (vBIOS controlled) or manual. Note that when the fan speed is changed, the NVML library automatically changes this setting to manual. This setting is useful to change the GPU back to its original state\r\n\r\n fan-policy-info\r\n Shows information about the current fan policy\r\n\r\n power-limit-info\r\n Shows information about the power limit of the selected GPU\r\n\r\n thresholds-info\r\n Shows information about temperature thresholds in dregrees Celsius of the selected GPU.\r\n\r\nOPTIONS\r\n\r\n --name OR -n <GPU_NAME>\r\n Select a target GPU by its name. Example: --name \"NVIDIA GeForce RTX 4080\". Note: UUID has preference over name\r\n\r\n --uuid OR -id <GPU_UUID>\r\n Select a target GPU by its Universally Unique IDentifier (UUID). Example: --uuid \"GPU-00000000-0000-0000-0000-000000000000\". Note: UUID has preference over name\r\n\r\n --time-interval OR -ti <TIME_SECONDS>\r\n Time period in seconds to wait before probing the GPU again. Works for all actions that run in a loop\r\n\r\n --retry-interval OR -ri <TIME_SECONDS>\r\n Time period in seconds to wait before trying to issue commands to the GPU again. Works for all actions that run in a loop\r\n\r\n --dry-run OR -dr\r\n Run the program, but don't change/set anything. Useful for testing the behavior of the program\r\n\r\n --speed-pair OR -sp <TEMP_CELSIUS:SPEED_PERCENTAGE,TEMP_CELSIUS:SPEED_PERCENTAGE...>\r\n A comma separated list of pairs of temperature in celsius and the fan speed in % (temp:speed) defining basic settings for a fan curve\r\n\r\n --default-speed OR -ds <FAN_SPEED_PERCENTAGE>\r\n Set a default speed for when there is no match for the fan curve settings\r\n\r\n --manual\r\n Sets the fan policy to manual\r\n\r\n --auto\r\n Sets the fan policy to automatic (vBIOS controlled)\r\n\r\n --power-limit OR -pl <POWER_LIMIT_WATTS>\r\n Sets the power limit of the GPU in watts\r\n\r\n --acoustic-temp-limit OR -tl <TEMPERATURE_CELSIUS>\r\n Sets the acoustic threshold in celsious (note that this is the same temperature limit used by GeForce Experience)\r\n\r\n --single-use OR -su\r\n Makes some actions work only once instead of in a loop\r\n\r\n --verbose OR -V\r\n When there are no settings changes, leg messages are omitted by default. This option enables them back (good for debugging)\r\n\r\n --retry OR -rt\r\n By default the program closes when it encounters an error, but this lets the program try to recover. It could be useful to let the service manaer restart the process\r\n\r\n```\r\n\r\n## Changelog\r\n\r\n### 1.0.0.0\r\n\r\n* Initial pypi release\r\n\r\n### 1.1.0.0\r\n\r\n* Added a new option: --verbose OR -V\r\n\r\n### 2.0.0.0\r\n\r\n* Actions removed: `fan-control`, `power-control`, `temp-control`\r\n\r\n* Action renamed: `control-all` -> `control`\r\n\r\n* Quality of life\r\n * More information on initial log\r\n * Some options aren't automatically ignored anymore\r\n\r\n### 2.1.0.0\r\n\r\n* Added a new option: `--retry OR -rt`\r\n\r\n* The program now halts by default when it encounters an error, allowing the service manager to restart the process\r\n\r\n### 2.1.1.1\r\n\r\n* NVML dependency update: 12.570.86 -> 13.580.65\r\n\r\n* It now reports the NVML version as well\r\n\r\n### 2.1.2.1\r\n\r\n* Temperature thresholds are now removed from initial information logs (it returns NOT_SUPPORTED on Linux 575.64.05, which caused all controls to fail)\r\n\r\n* It now reports the version of the program\r\n",
"bugtrack_url": null,
"license": null,
"summary": "A small program that uses the NVIDIA Management Library to control the GPU independent of OS or display server. This project is not provided or endorsed by NVIDIA",
"version": "2.1.2.1",
"project_urls": {
"Repository": "https://github.com/HackTestes/NVML-GPU-Control"
},
"split_keywords": [
"nvidia",
" gpu",
" nvml",
" fan control",
" power control"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "dfd9fbd11ce511a1f92c0c2fc5edb638bcbd0d5d1bae3f00c65bc7bd3b2193ea",
"md5": "9f475872be73ef3b35faecdbef684b4d",
"sha256": "a3f15b1f372d310a5ff7e044f36129dbd3219c14233ba3b7fd4448c4fe1cb4b2"
},
"downloads": -1,
"filename": "caioh_nvml_gpu_control-2.1.2.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9f475872be73ef3b35faecdbef684b4d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 21826,
"upload_time": "2025-08-06T15:24:04",
"upload_time_iso_8601": "2025-08-06T15:24:04.898936Z",
"url": "https://files.pythonhosted.org/packages/df/d9/fbd11ce511a1f92c0c2fc5edb638bcbd0d5d1bae3f00c65bc7bd3b2193ea/caioh_nvml_gpu_control-2.1.2.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "6fd7965b779dc583f2ce64b272727ccf6375cf63fc3716d4bf3dbeed6249cd07",
"md5": "ea263968f14c1b6d104e843111ad8213",
"sha256": "14a47ab21a358ed891ff56daf37d93078cc88342f8bac2f77bf7634535152668"
},
"downloads": -1,
"filename": "caioh_nvml_gpu_control-2.1.2.1.tar.gz",
"has_sig": false,
"md5_digest": "ea263968f14c1b6d104e843111ad8213",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 26125,
"upload_time": "2025-08-06T15:24:06",
"upload_time_iso_8601": "2025-08-06T15:24:06.150563Z",
"url": "https://files.pythonhosted.org/packages/6f/d7/965b779dc583f2ce64b272727ccf6375cf63fc3716d4bf3dbeed6249cd07/caioh_nvml_gpu_control-2.1.2.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-06 15:24:06",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "HackTestes",
"github_project": "NVML-GPU-Control",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "caioh-nvml-gpu-control"
}