GPUMGR es un administrador de GPU para Linux que permite la gestión fácil de la línea de comandos/interfaz web de los límites de alimentación de GPU, relojes, velocidades del ventilador y más. GPUMGR es sucesor espiritual multimilabultural de AMDPWRMAN.
GPUMGR es una herramienta de Linux para ver y administrar GPU (potencia, ventilador, relojes) tanto desde el shell como desde una interfaz web (WIP).
Reescrito en JS (NodeJS) para facilitar la codificación y mantener las cosas, especialmente alrededor de agregar otros proveedores de GPU. También nos permite tener una mejor solución de demonio (que un script de shell) y una interfaz web.
Dado que ya no es solo un script de shell, obviamente hay más dependencias: actualmente, casi solo una versión reciente de NodeJS (10.7.0+). ¡El rendimiento también es mejor! amdpwrman show 0 en mi sistema toma 0m0.548s : ejecutar GPUMGR del binario empacado es ~ 25% más rápido que AMDPWRMAN a 0m0.0398s .
Si está utilizando la versión binaria, solo debe necesitar sus controladores de GPU y lo que viene con ellos.
La versión de origen requiere NodeJS 10.7.0+, NPM 6.0.0+. El edificio requiere PKG .
Las GPU AMD necesitan los controladores AMDGPU o AMDGPU-Pro, principalmente interfaces con SYSF .
Las GPU NVIDIA necesitan los conductores oficiales de Nvidia, en su mayoría interfaces con Nvidia-SMI y Nvidia-Settings . Lo más probable es que cambie los relojes X, ya que no soy consciente de una forma de hacerlo aparte de los ajustes de Nvidia y eso requiere X.
También hay una verison binaria compilada/empaquetada para Linux en Bin/ , esto ha sido compilado/"empaquetado" con PKG y simplemente está allí, por lo que tiene una opción rápida para ponerse en funcionamiento sin tener que instalar NodeJ o ninguna dependencia.
¿No confías en el binario? ¡Ningún problema! Puede simplemente ejecutar el script directamente o construirlo usted mismo; Ejecute build.sh o npm run build con PKG instalado y su binario aparecerá en bin/ - técnicamente, no necesita NodeJS instalados para hacer la compilación incluso cuando PKG descargará los binarios apropiados; Sin embargo, la instalación de PKG requiere NPM que requiere NodeJs ...? Sin embargo, puede construir fácilmente para otras versiones de NodeJ de lo que ha instalado.
Desea ejecutar npm ci para descargar los paquetes NPM apropiados si desea ejecutar desde la fuente o la compilación. npm run build también construirá un binario para usted.
Para descargar:
git clone https://github.com/Shaped/gpumgr.git
cd gpumgr
npm ci
Una vez hecho esto, puede ejecutar el script directamente o construir el binario con build.sh .
Para ejecutar directamente:
cd src
chmod 755 ./gpumgr.js
./gpumgr.js
Para construir y ejecutar:
npm install pkg
./build.sh
cd bin
chmod 755 ./gpumgr
./gpumgr
El uso es bastante similar al de AMDPWRMAN, casi idéntico desde la línea de comando.
Puede llamar al script directamente y el shebang llamará a nodejs.
Si no tiene NodeJS, puede descargar la versión binaria, que es simplemente este script preempaquetado con PKG con los NodeJ requeridos y las dependencias para ejecutar.
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