{"id":19756308,"url":"https://github.com/shibatch/cputemp","last_synced_at":"2026-03-08T13:33:13.443Z","repository":{"id":201897944,"uuid":"172315238","full_name":"shibatch/cputemp","owner":"shibatch","description":"Daemon for controlling clock frequency to keep CPU below specified temperature","archived":false,"fork":false,"pushed_at":"2024-11-29T11:14:19.000Z","size":41,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-02T15:05:36.701Z","etag":null,"topics":["cpu-frequency","cpu-frequency-scaling","cpu-monitoring","cpu-throttle","cpufreq","daemon","temperature-controller","temperature-monitoring","temperature-sensor"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shibatch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-24T08:46:07.000Z","updated_at":"2025-03-22T03:57:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"4b11aa71-5ba3-4c89-b154-b7df3eac651f","html_url":"https://github.com/shibatch/cputemp","commit_stats":null,"previous_names":["shibatch/cputemp"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/shibatch/cputemp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shibatch%2Fcputemp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shibatch%2Fcputemp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shibatch%2Fcputemp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shibatch%2Fcputemp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shibatch","download_url":"https://codeload.github.com/shibatch/cputemp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shibatch%2Fcputemp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273228080,"owners_count":25067716,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-02T02:00:09.530Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpu-frequency","cpu-frequency-scaling","cpu-monitoring","cpu-throttle","cpufreq","daemon","temperature-controller","temperature-monitoring","temperature-sensor"],"created_at":"2024-11-12T03:15:32.577Z","updated_at":"2026-03-08T13:33:13.377Z","avatar_url":"https://github.com/shibatch.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"## cputemp - A simple tool to keep CPU below specified temperature on Linux computer\n\nOriginal distribution site : https://github.com/shibatch/cputemp\n\n\n### Introduction\n\nSome modern CPUs can reach temperatures near 100 degrees Celsius even\nwhen used at stock clock frequency without overclocking. However, it\nis indeed scary to use a CPU regularly near Tjunction. If possible, I\nwould like to avoid the CPU fan to hum and the high temperature\nexhaust to spout out from the back of my PC.\n\nThere are various theories, but it is said that the safe temperature\nfor regular use of CPUs is about 80 degrees Celsius. If we want to use\nour CPUs below this temperature, the clock frequency must be\nlowered. But how much the frequency should be set to keep the\ntemperature below 80 degrees depends on the ambient temperature. If a\nCPU has many cores, the CPU temperature depends not only on the clock\nfrequency but also on the usage of each core. More to the point, even\nwhen all cores are running at 100% load, the CPU temperature can vary\nconsiderably depending on what kind of code is being executed. Since\nthe CPU cooler is a piece of metal and has a good amount of heat\ncapacity, the CPU temperature will not exceed 80 degrees if the time\nof running at a relatively high clock frequency is short.\n\nThis tool monitors CPU temperature and dynamically changes the clock\nfrequency to keep the CPU below the specified temperature on a Linux\ncomputer. This is basically a simple alternative to thermald, but this\ntool controls the CPU temperature more aggressively than thermald.\n\n\n### How to build\n\n1. Check out the source code from our GitHub repository :\n`git clone https://github.com/shibatch/cputemp`\n\n2. Run make :\n`cd cputemp \u0026\u0026 make`\n\n\n### Synopsis\n\n`cputemp [\u003coptions\u003e]`\n\n\n### Options\n\n`--sensor \u003csensor name\u003e`\n\nSpecifies the name of sensor that gives the CPU temperature.\n\n`--period \u003cseconds\u003e`\n\nSpecifies the interval at which temperature is checked and CPU\nfrequency is controlled.\n\n`--temp \u003ctarget temperature\u003e`\n\nSpecify target CPU temperature.\n\n`--daemon \u003cpid file name\u003e`\n\nStart this tool as a daemon. If this tool is already running as a\ndaemon, it will be restarted with the new setting.\n\n`--kill-daemon \u003cpid file name\u003e`\n\nKill already running daemon.\n\n`--verbose`\n\nTurn on verbose mode.\n\n\n### Description\n\nThis tool monitors temperature obtained by the sensor specified by\nsensor ID every specified period, and control the CPU clock frequency\nso that the temperature is kept below the specified target\ntemperature.\n\nThe CPU clock frequency is controlled by changing the value of\n`/sys/devices/system/cpu/cpu*/cpufreq/scaling_max_freq`. This means\nthat this tool requires the cpufreq driver to honor the value of\nscaling_max_freq in order to work correctly. Some CPUs need kernel\nparameters to be set appropriately for this. For example, you may\nneed to add `amd_pstate=passive` to the kernel parameters to use\nthis tool with AMD CPUs.\n\nTo use this tool, you first need to check which sensor gives the CPU\ntemperature. You can see the list of available sensor IDs by executing\nthe command without an argument, like the following.\n\n```\n$ ./cputemp\nUsage : ./cputemp [\u003coptions\u003e]\n\nThis utility controls the CPU frequency to make its temperature close to the target\n\nOptions :\n  --sensor \u003csensor name\u003e         Specify sensor name\n  --period \u003cseconds\u003e             Specify period\n  --temp \u003ctarget temperature\u003e    Specify target CPU temperature\n  --daemon \u003cpid file name\u003e       Daemonize\n  --kill-daemon \u003cpid file name\u003e  Kill already running daemon\n  --verbose                      Turn on verbose mode\n\nAvailable sensors : nvme (41.85 C), k10temp (58.75 C), mt7921_phy0 (50 C), amdgpu (52 C),\n$\n```\n\nIn the above example, there are 4 sensors, and the sensor ID that\ngives the CPU temperature is k10temp.\n\nThen, you can specify this sensor ID and start the command as\nroot. You can see the verbose output of how the temperature is\ncontrolled by `--verbose` option.\n\n```\n$ sudo ./cputemp --sensor k10temp --temp 80 --verbose\nSensor file name : /sys/class/hwmon/hwmon1/temp1_input\nMax freq : 5881 MHz\nMin freq : 400 MHz\nCur freq : 5039.77 MHz\nCPU freq = 476.98 MHz, scaling_max_freq = 5881 MHz, CPU temp = 64.625 C, target temp = 80 C\nCPU freq = 674.05 MHz, scaling_max_freq = 5881 MHz, CPU temp = 64.5 C, target temp = 80 C\nCPU freq = 564.43 MHz, scaling_max_freq = 5881 MHz, CPU temp = 64.375 C, target temp = 80 C\nCPU freq = 674.05 MHz, scaling_max_freq = 5881 MHz, CPU temp = 64.25 C, target temp = 80 C\nCPU freq = 3524.17 MHz, scaling_max_freq = 5881 MHz, CPU temp = 64.25 C, target temp = 80 C\n^C\n$\n```\n\nYou should be able to observe that the CPU frequency is lowered and\nthe CPU temperature is kept below the specified temperature by\nexecuting some task in another terminal. If you are satisfied with the\nresults, you can copy the executable to /usr/local/bin and start it in\n/etc/rc.local. In this case, `--daemon` option can be specified to\nstart this tool as a daemon.\n\n```\n$ cat /etc/rc.local\n#!/bin/sh\n\n/usr/local/bin/cputemp --sensor k10temp --temp 80 --daemon /var/run/cputemp.pid\n$\n```\n\nInstead of starting cputemp from /etc/rc.local, you can also start it\nusing systemd.\n\nTo do this, edit cputemp.service and copy it to the\n/etc/systemd/system directory :\n`sudo cp cputemp.service /etc/systemd/system/`\n\nNext, reload the service file :\n`sudo systemctl daemon-reload`\n\nThen, start cputemp service :\n`sudo systemctl start cputemp.service`\n\nTo enable cputemp service on every reboot :\n`sudo systemctl enable cputemp.service`\n\nTypically, there is no need to make any special changes to the\nsettings for thermald or cpufreq in order to use cputemp.\n\n\n### License\n\nThe software is distributed under the Zero-Clause BSD, which means\nthat this software is in public domain.\n\nThe fact that this software is released under an open source license\nonly means that you can use the current version of the software for\nfree. If you want this software to be maintained, you need to\nfinancially support the project. Please see\n[CODE_OF_CONDUCT.md](https://github.com/shibatch/nofreelunch?tab=coc-ov-file).\n\nCopyright Naoki Shibata 2024.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshibatch%2Fcputemp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshibatch%2Fcputemp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshibatch%2Fcputemp/lists"}