GPUMGR是Linux的GPU Manager,允许使用GPU功率限制,时钟,风扇速度等的命令行/Web接口管理。 Gpumgr是AMDPWRMAN的多元文化精神继任者。
GPUMGR是用于从外壳和Web界面(WIP)查看和管理GPU(Power,fan,Clocks)的Linux工具。
在JS(nodejs)中重新编写,以使事物更易于编码和维护,尤其是在添加其他GPU供应商时。还允许我们拥有更好的守护程序解决方案(比Shell脚本)和Web界面。
由于它不再只是一个壳脚本,因此显然还有更多的依赖关系:当前,几乎只是Nodejs(10.7.0+)的最新版本。性能也更好!我系统上的amdpwrman show 0取0m0.548s从包装二进制中运行GPUMGR的速度比AMDPWRMAN在0m0.0398s上快25%。
如果您使用的是二进制版本,则只需要您的GPU驱动程序以及它们随附的内容。
源版本需要NodeJS 10.7.0+,NPM 6.0.0+。建筑物需要PKG 。
AMD GPU需要AMDGPU或AMDGPU-PRO驱动程序,主要是与SYSF的接口。
Nvidia GPU需要官方的NVIDIA驱动程序,主要是与Nvidia-Smi和Nvidia-Settings的接口。更换时钟很可能需要x,因为我不知道除了nvidia-settings之外,还需要做到这一点,这需要X。
还有一个用于bin/ linux的二进制编译/包装的经验,它已与pkg进行了编译/“打包”,并且简单地在那里,因此您可以快速启动和运行,而无需安装nodejs或任何依赖关系。
不信任二进制吗?没问题!您可以轻松地直接运行脚本或自己构建脚本; run build.sh或npm run build使用PKG安装,您的二进制文件将在bin/ - 从技术上讲,即使PKG会下载适当的二进制文件,您也不需要安装nodejs进行构建;但是,安装PKG需要NPM,它需要Nodejs ..?不过,您可以轻松地为Nodejs构建比安装的版本。
如果要从源或构建运行,则需要运行npm ci下载适当的NPM软件包。 npm run build还将为您构建二进制文件。
下载:
git clone https://github.com/Shaped/gpumgr.git
cd gpumgr
npm ci
完成此操作后,您可以直接运行脚本或使用build.sh构建二进制文件。
直接运行:
cd src
chmod 755 ./gpumgr.js
./gpumgr.js
建造和运行:
npm install pkg
./build.sh
cd bin
chmod 755 ./gpumgr
./gpumgr
用法与AMDPWRMAN的使用非常相似 - 与命令行几乎相同。
您可以直接调用脚本,Shebang将调用Nodejs。
如果您没有nodejs,则可以下载二进制版本,该版本简单地用PKG预先包装,并带有所需的nodejs和depentencies才能运行。
gpumgr v0.0.8-alpha
gpumgr shows statistics and manipulates power limit settings for GPUs on
Linux through various interfaces provided by manufacturer's drivers, for
example, using the sysfs interface to interact with the amdgpu driver.
The original script (amdpwrman) was designed to be simple, easy to use and have
no dependencies, however, BASH scripting is kind of a pain so I decided to
rewrite this as a NodeJS app with an included (optional to use) web interface.
There will be an easy to use binary distribution of this, or you can just clone
the repo and run or build the script yourself.
Most commands will execute the command and exit. For example, using
'./gpumgr fan 50% 0' to set fan speed to 50% for GPU 0, gpumgr will simply set
it once and exit.
If you want fan speed monitoring or curve control or to use the web interface,
you must start the daemon. Once the daemon is running, you can manage settings
for your GPUs at http://127.0.0.1:1969 - or on whatever port you specified.
Usage:
gpumgr.js [command] <gpu> <options>
If <gpu> is omitted from any command, GPU0 is assumed.
<gpu> can be a comma separated list of GPU numbers.
<gpu> can be set to 'all' to affect ALL GPUs
<gpu> can be set to 'amd' to affect all AMD GPUs
<gpu> can be set to 'nvidia' to affect all Nvidia GPUs
<gpu> can be set to 'intel' to affect all Intel GPUs
Commands with no options or only GPU specified:
help | --help | -h Display this help message.
list <gpu> List available GPUs and their GPU#.
show <gpu> Show detailed statistics for <gpu>.
status <gpu> Same as above.
power <percent> <gpu> Set <gpu>'s power target to <percent>.
power reset <gpu> Reset default power limit for <gpu>.
recover <gpu> Attempt driver recovery mechanism for <gpu>.
fan enable <gpu> Enable manual fan control for <gpu>.
fan disable <gpu> Disable manual fan control for <gpu>.
fan [percent] <gpu> Set <gpu>'s fan speed to <percent>.
start <options> Starts the gpumgr.js service.
restart Soft Restarts the gpumgr.js service.
stop Stops the gpumgr.js service.
force restart Fully Restarts the gpumgr.js service.
force stop Kills the gpumgr.js service.
Options for Commands with Options:
[any] Any command with color output
-g | --no-colors Disable ANSI Color formatting
start Starts the gpumgr.js background service.
--port <number> Set which ipv4 port to listen on.
(eg. 1969, default is 4242)
--host <ip> Set which ipv4 host to listen on.
(eg. 0.0.0.0 or 127.0.0.1)
Examples:
gpumgr.js show nvidia Show status of all Nvidia GPUs
gpumgr.js list Intel List all Intel GPU#s
sudo gpumgr.js fan enable 0 Enable manual fan control for GPU0
sudo gpumgr.js fan disable all Enable auto fan control for all GPUs
sudo gpumgr.js fan 100% 0 Set GPU0 fan speed to 100%
sudo gpumgr.js start --port 4200 Start the background service on port 4200
0.01a - 12/07/21 - the beginning, able to show stats for AMD GPUs
0.02a - 12/08/21 - able to show some stats for nvidia GPUs as well
0.03a - 12/08/21 - service structure started
0.04a - 12/09/21 - fan control for amdgpu enabled
0.05a - 12/09/21 - some tidying up, build.sh updated for making release easier for me
0.0.6-alpha - 12/10/21 - more tidying up for build stuff, version numbering now npm friendly
0.0.7-alpha - 12/10/21 - basic power and fan management for both AMD and NVIDIA now working
0.0.8-alpha - 12/10/21 - added a splash of color, ability to disable colors and the missing 'list' command