From 542d14c82a00a2e90fcd22ae4e1b774a5dbfed34 Mon Sep 17 00:00:00 2001 From: mcgillij Date: Sun, 21 Feb 2021 17:18:44 -0400 Subject: [PATCH 1/2] update the readme --- README.md | 66 +++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 49 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 707f0cc..3a26261 100644 --- a/README.md +++ b/README.md @@ -66,19 +66,10 @@ Also allows you to revert the fan control to the systems default behavior by usi This will dump out the default configuration that would get generated for `/etc/amdfan.yml` when you first run it as a service. This allows you to configure the settings prior to running it as a daemon if you wish. -## Service - -This is just a convenience method for dumping out the `amdfan.service` that would get installed if you used a package manager to install amdfan. Useful if you installed the module via `pip`, `pipenv` or `poetry` vs using the package manager version. - - - -## Note - -You will need to ```sudo``` to apply any changes to the fan speeds, but you can monitor them with regular user permissions. - -# Config File example +Running `amdfan --configuration` will output the following block to STDOUT. -``` yaml +``` bash +#Fan Control Matrix. # [,] speed_matrix: - [4, 4] @@ -95,19 +86,52 @@ speed_matrix: # Optional configuration options # # Allows for some leeway +/- temp, as to not constantly change fan speed -# threshold: 2 +# threshold: 4 # # Frequency will change how often we probe for the temp # frequency: 5 # +# While frequency and threshold are optional, I highly recommend finding +# settings that work for you. I've included the defaults I use above. +# # cards: # can be any card returned from `ls /sys/class/drm | grep "^card[[:digit:]]$"` # - card0 ``` +You can use this to generate your configuration by doing ``amdfan --configuration > amdfan.yml``, you can then modify the settings and place it in ``/etc/amdfan.yml`` for when you would like to run it as a service. + +## Service -## Running the systemd service +This is just a convenience method for dumping out the `amdfan.service` that would get installed if you used a package manager to install amdfan. Useful if you installed the module via `pip`, `pipenv` or `poetry`. -To run the service, if you installed amdfan using the AUR package, you can run the following commands to **start/enable** the service. +Running `amdfan --service` will output the following block to STDOUT. + +``` bash +[Unit] +Description=amdfan controller + +[Service] +ExecStart=/usr/bin/amdfan --daemon +Restart=always + +[Install] +WantedBy=multi-user.target +``` + +# Note + +You will need to ```sudo``` to apply any changes to the fan speeds, but you can monitor them with regular user permissions. + +## Installing the systemd service +If you installed via the AUR, the service is already installed, and you just need to *start/enable* it. If you installed via pip/pipenv or poetry, you can generate your systemd service file with the following command. + +``` bash +amdfan --service > amdfan.service && sudo mv amdfan.service /usr/lib/systemd/system/ +``` + +## Starting the systemd service + +To run the service, you can run the following commands to **start/enable** the service. ``` bash sudo systemctl start amdfan @@ -127,10 +151,12 @@ You can check the systemd service status with the following command: systemctl status amdfan ``` -## Building Python package +# Building Python package Requires Poetry to be installed -``` bash +``` bash +git clone git@github.com:mcgillij/amdfan.git +cd amdfan/ poetry build ``` @@ -142,3 +168,9 @@ Building the Arch package assumes you already have a chroot env setup to build p poetry build makechrootpkg -c -r $HOME/$CHROOT ``` + +## Installing the Arch package + +``` bash +sudo pacman -U --asdeps amdfan-0.1.6-1-any.pkg.tar.zst +``` From 0060f74853c1d5916fd808a48cca10afd7252c21 Mon Sep 17 00:00:00 2001 From: mcgillij Date: Sun, 21 Feb 2021 17:31:02 -0400 Subject: [PATCH 2/2] updates --- README.md | 56 +++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 44 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 3a26261..a7e3b93 100644 --- a/README.md +++ b/README.md @@ -120,7 +120,28 @@ WantedBy=multi-user.target # Note -You will need to ```sudo``` to apply any changes to the fan speeds, but you can monitor them with regular user permissions. +Monitoring fan speeds and temperatures can run with regular user permissions. +`root` permissions are required for changing the settings / running as a daemon. + +# Recommended settings + +Below is the settings that I use on my machines to control the fan curve without too much fuss, but you should find a frequency and threshold setting that works for your workloads. + +`/etc/amdfan.yml` +``` bash +speed_matrix: +- [4, 4] +- [30, 33] +- [45, 50] +- [60, 66] +- [65, 69] +- [70, 75] +- [75, 89] +- [80, 100] + +threshold: 4 +frequency: 5 +``` ## Installing the systemd service If you installed via the AUR, the service is already installed, and you just need to *start/enable* it. If you installed via pip/pipenv or poetry, you can generate your systemd service file with the following command. @@ -151,26 +172,37 @@ You can check the systemd service status with the following command: systemctl status amdfan ``` -# Building Python package -Requires Poetry to be installed - -``` bash -git clone git@github.com:mcgillij/amdfan.git -cd amdfan/ -poetry build -``` -## Building Arch package +## Building Arch AUR package Building the Arch package assumes you already have a chroot env setup to build packages. ```bash -poetry build +git clone https://aur.archlinux.org/amdfan.git +cd amdfan/ makechrootpkg -c -r $HOME/$CHROOT ``` ## Installing the Arch package ``` bash -sudo pacman -U --asdeps amdfan-0.1.6-1-any.pkg.tar.zst +sudo pacman -U --asdeps amdfan-*-any.pkg.tar.zst +``` + +# Installing from PyPi +You can also install amdfan from pypi using something like poetry. + +``` bash +poetry init +poetry add amdfan +poetry run amdfan --help +``` + +# Building Python package +Requires [poetry](https://python-poetry.org/) to be installed + +``` bash +git clone git@github.com:mcgillij/amdfan.git +cd amdfan/ +poetry build ```