# AmdFan
![Python package](https://github.com/mcgillij/amdfan/workflows/Python%20package/badge.svg)
[![Downloads](https://static.pepy.tech/personalized-badge/amdfan?period=total&units=international_system&left_color=blue&right_color=green&left_text=PyPi%20Downloads)](https://pepy.tech/project/amdfan)
Is a fork of amdgpu-fan, with security updates and added functionality.
This is intended for stand-alone GPU's and not integrated APU's.
## Why fork?
* alternatives abandoned
* lacking required features
* security fixes not addressed
* basic functionality not working
### Amdgpu_fan abandoned
As of a couple years ago, and is no longer applying any security fixes to their project or improvements. There were also some bugs that bothered me with the project when I tried to get it up and running.
Features missing
There are a number of features that I wanted, but were not available.
* Thresholds allow temperature range before changing fan speed
* Frequency setting to allow better control
* Monitoring to be able to see real-time fan speeds and temperature
### Security Fixes
There are some un-addressed pull requests for some recent YAML vulnerabilities that are still present in the old amdgpu_fan project, that I’ve addressed in this fork.
### Basic functionality
Setting the card to system managed using the amdgpu_fan pegs your GPU fan at 100%, instead of allowing the system to manage the fan settings. I fixed that bug as well in this release.
These are all addressed in Amdfan, and as long as I’ve still got some AMD cards I intend to at least maintain this for myself. And anyone’s able to help out since this is open source. I would have liked to just contribute these fixes to the main project, but it’s now inactive.
# Documentation
```help
Usage: amdfan [OPTIONS] COMMAND [ARGS]...
Options:
-v, --version Show the version and exit.
--help Show this message and exit.
Commands:
daemon Run the controller as a service
manage Run the fan controller
monitor View the current temperature and speed
print-default Convenient defaults
set Manually override the fan speed
```
Each subcommand supports `--help` too, to get more details.
## Controlling the fans
There are two ways to control your fans with Amdfan. Note that in order to control the fans, you will likely need to run either approach as root.
The recommended way is through a system service started at boot. This will control the fans based on the detected temperature at a given interval.
In case you don't want to use a service, you may also control the fans manually. While this is only advised to do when first setting up your configuration, keep in mind you can also use it to temporarily take control away from the daemon until you revert the fan speed back to `auto`.
![screenshot](https://raw.githubusercontent.com/mcgillij/amdfan/main/images/manual.png)
## Monitor
You can use Amdfan to monitor your AMD video cards using the `monitor` flag. This does not require root privileges, usually.
![screenshot](https://raw.githubusercontent.com/mcgillij/amdfan/main/images/screenshot.png)
## Configuration
Running `amdfan print-default --configuration` will dump out the default configuration that would get generated for `/etc/amdfan.yml` when you first run it as a service. If a value is not specified, it will use a default value if possible.
The following config is probably a reasonable setup:
``` bash
speed_matrix:
- [4, 4]
- [30, 33]
- [45, 50]
- [60, 66]
- [65, 69]
- [70, 75]
- [75, 89]
- [80, 100]
threshold: 4
frequency: 5
# cards:
# - card0
```
If a configuration file is not found, a default one will be generated. If you want to make any changes to the default config before running the daemon, run `amdfan print-default --configuration | sudo tee /etc/amdfan.yml` and do your changes from there.
- `speed_matrix` (required): a list of thresholds `[temperature, speed]` which are interpolated to calculate the fan speed.
- `threshold` (default `0`): allows for some leeway in temperatures, as to not constantly change fan speed
- `frequency` (default `5`): how often (in seconds) we wait between updates
- `cards` (required): a list of card names (from `/sys/class/drm`) which we want to control.
Note! You can send a **SIGHUP** signal to the daemon to request a reload of the config without restarting the whole service. Additionally, if you're using a pidfile, you can send a signal to reload the config with `amdfan daemon --signal=reload`
# Install
Users: Use your package manager to install the package. It's available on Arch Linux and Gentoo. For other distributions, please request a maintainer to bring the package to your system, or read the installation notes at your own warranty.
Maintainers: Check the [installation notes](INSTALL.md).
Raw data
{
"_id": null,
"home_page": "https://mcgillij.dev/pages/amdfan.html",
"name": "amdfan",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.11",
"maintainer_email": null,
"keywords": "fan, gpu, temp, monitor, amd",
"author": "mcgillij",
"author_email": "mcgillivray.jason@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/c3/a0/d1b291e6aae8871030fa5c6efdfa7f004797e7454ad432f9e43c73b52354/amdfan-0.2.3.tar.gz",
"platform": null,
"description": "# AmdFan\n![Python package](https://github.com/mcgillij/amdfan/workflows/Python%20package/badge.svg)\n[![Downloads](https://static.pepy.tech/personalized-badge/amdfan?period=total&units=international_system&left_color=blue&right_color=green&left_text=PyPi%20Downloads)](https://pepy.tech/project/amdfan)\n\nIs a fork of amdgpu-fan, with security updates and added functionality.\nThis is intended for stand-alone GPU's and not integrated APU's.\n\n## Why fork?\n\n* alternatives abandoned\n* lacking required features\n* security fixes not addressed\n* basic functionality not working\n\n### Amdgpu_fan abandoned\n\nAs of a couple years ago, and is no longer applying any security fixes to their project or improvements. There were also some bugs that bothered me with the project when I tried to get it up and running.\nFeatures missing\n\nThere are a number of features that I wanted, but were not available.\n\n* Thresholds allow temperature range before changing fan speed\n* Frequency setting to allow better control\n* Monitoring to be able to see real-time fan speeds and temperature\n\n### Security Fixes\n\nThere are some un-addressed pull requests for some recent YAML vulnerabilities that are still present in the old amdgpu_fan project, that I\u2019ve addressed in this fork.\n\n### Basic functionality\n\nSetting the card to system managed using the amdgpu_fan pegs your GPU fan at 100%, instead of allowing the system to manage the fan settings. I fixed that bug as well in this release.\n\nThese are all addressed in Amdfan, and as long as I\u2019ve still got some AMD cards I intend to at least maintain this for myself. And anyone\u2019s able to help out since this is open source. I would have liked to just contribute these fixes to the main project, but it\u2019s now inactive.\n\n# Documentation\n\n```help\nUsage: amdfan [OPTIONS] COMMAND [ARGS]...\n\nOptions:\n -v, --version Show the version and exit.\n --help Show this message and exit.\n\nCommands:\n daemon Run the controller as a service\n manage Run the fan controller\n monitor View the current temperature and speed\n print-default Convenient defaults\n set Manually override the fan speed\n```\n\nEach subcommand supports `--help` too, to get more details.\n\n## Controlling the fans\n\nThere are two ways to control your fans with Amdfan. Note that in order to control the fans, you will likely need to run either approach as root. \n\nThe recommended way is through a system service started at boot. This will control the fans based on the detected temperature at a given interval.\n\nIn case you don't want to use a service, you may also control the fans manually. While this is only advised to do when first setting up your configuration, keep in mind you can also use it to temporarily take control away from the daemon until you revert the fan speed back to `auto`.\n\n![screenshot](https://raw.githubusercontent.com/mcgillij/amdfan/main/images/manual.png)\n\n\n## Monitor\n\nYou can use Amdfan to monitor your AMD video cards using the `monitor` flag. This does not require root privileges, usually.\n\n![screenshot](https://raw.githubusercontent.com/mcgillij/amdfan/main/images/screenshot.png)\n\n\n## Configuration\n\nRunning `amdfan print-default --configuration` will dump out the default configuration that would get generated for `/etc/amdfan.yml` when you first run it as a service. If a value is not specified, it will use a default value if possible.\n\nThe following config is probably a reasonable setup:\n``` bash\nspeed_matrix:\n- [4, 4]\n- [30, 33]\n- [45, 50]\n- [60, 66]\n- [65, 69]\n- [70, 75]\n- [75, 89]\n- [80, 100]\n\nthreshold: 4\nfrequency: 5\n\n# cards:\n# - card0\n```\n\nIf a configuration file is not found, a default one will be generated. If you want to make any changes to the default config before running the daemon, run `amdfan print-default --configuration | sudo tee /etc/amdfan.yml` and do your changes from there.\n\n- `speed_matrix` (required): a list of thresholds `[temperature, speed]` which are interpolated to calculate the fan speed.\n- `threshold` (default `0`): allows for some leeway in temperatures, as to not constantly change fan speed\n- `frequency` (default `5`): how often (in seconds) we wait between updates\n- `cards` (required): a list of card names (from `/sys/class/drm`) which we want to control.\n\nNote! You can send a **SIGHUP** signal to the daemon to request a reload of the config without restarting the whole service. Additionally, if you're using a pidfile, you can send a signal to reload the config with `amdfan daemon --signal=reload`\n\n# Install\n\nUsers: Use your package manager to install the package. It's available on Arch Linux and Gentoo. For other distributions, please request a maintainer to bring the package to your system, or read the installation notes at your own warranty.\n\nMaintainers: Check the [installation notes](INSTALL.md).\n\n",
"bugtrack_url": null,
"license": "GPL-2.0-only",
"summary": "Fan monitor and controller for AMD gpus in Linux",
"version": "0.2.3",
"project_urls": {
"Documentation": "https://mcgillij.dev/pages/amdfan.html",
"Homepage": "https://mcgillij.dev/pages/amdfan.html",
"Repository": "https://github.com/mcgillij/amdfan"
},
"split_keywords": [
"fan",
" gpu",
" temp",
" monitor",
" amd"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "141deb5c7389df90c5a43b7c4cbcdc89f09a91ad227059d22cf30ac18eacc82c",
"md5": "5d4104a74e38d52fe2e43c1b27ad410a",
"sha256": "04791c2c783284dde2a83b26bc6b3dece1ad4e12c77f02711e24d158a1a64b44"
},
"downloads": -1,
"filename": "amdfan-0.2.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5d4104a74e38d52fe2e43c1b27ad410a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.11",
"size": 18981,
"upload_time": "2024-07-31T21:57:10",
"upload_time_iso_8601": "2024-07-31T21:57:10.963981Z",
"url": "https://files.pythonhosted.org/packages/14/1d/eb5c7389df90c5a43b7c4cbcdc89f09a91ad227059d22cf30ac18eacc82c/amdfan-0.2.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c3a0d1b291e6aae8871030fa5c6efdfa7f004797e7454ad432f9e43c73b52354",
"md5": "b9e09a7885b225fcdd63e02b6ebeb03e",
"sha256": "4e231e86043ccdd3525ee240342165279f4a480c47e892f8da1a62788720c216"
},
"downloads": -1,
"filename": "amdfan-0.2.3.tar.gz",
"has_sig": false,
"md5_digest": "b9e09a7885b225fcdd63e02b6ebeb03e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.11",
"size": 18350,
"upload_time": "2024-07-31T21:57:13",
"upload_time_iso_8601": "2024-07-31T21:57:13.111822Z",
"url": "https://files.pythonhosted.org/packages/c3/a0/d1b291e6aae8871030fa5c6efdfa7f004797e7454ad432f9e43c73b52354/amdfan-0.2.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-31 21:57:13",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "mcgillij",
"github_project": "amdfan",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "amdfan"
}