By FOLDERS, stop gpu auto with games

Message boards : GPUs : By FOLDERS, stop gpu auto with games
Message board moderation

To post messages, you must log in.

AuthorMessage
wyxchari

Send message
Joined: 23 Sep 17
Posts: 10
Spain
Message 86281 - Posted: 23 May 2018, 11:01:53 UTC
Last modified: 23 May 2018, 11:09:21 UTC

I have a computer with GPUGRID in BOINC and I also have many games. Every time I install a game, I have to add the game executable in the BOINC GPU exclusion list. Sometimes it is difficult to find the executable if it is a Steam game, since the link is of the steam://rungameid/359550 type and you have to open the Task Manager and then go to it.

I have made a program that avoids having to add each game and does not need to put anything on the BOINC exclusion list. Just indicate the name of the folder where all the games are, the BOINC location and the nvidia-smi file (ONLY GPU NVIDIA).

GPU_BOINC_Control_Programar.bat
@echo off
schtasks /CREATE /SC MINUTE /TN "GPU_BOINC_Control_Tarea" /TR "c:\path\GPU_BOINC_Control_Ocultar.vbs"

GPU_BOINC_Control_Ocultar.vbs
set objshell = createobject("wscript.shell")
objshell.run "c:\path\GPU_BOINC_Control_Accion.bat",vbhide

GPU_BOINC_Control_Accion.bat
@echo off
tasklist | find "boincmgr.exe">nul
IF not "%ERRORLEVEL%"=="0" goto salir
SET A=0
"C:\Program Files\NVIDIA Corporation\NVSMI\nvidia-smi.exe" --format=csv,noheader --query-compute-apps=name | find "BOINC"
IF "%ERRORLEVEL%"=="0" SET A=1
SET B=0
"C:\Program Files\NVIDIA Corporation\NVSMI\nvidia-smi.exe" --format=csv,noheader --query-compute-apps=name | find "Games"
IF "%ERRORLEVEL%"=="0" SET B=1
IF "%A%"=="1" IF "%B%"=="1" "D:\2 Programas instalados\BOINC\boinccmd.exe" --set_gpu_mode never
IF "%A%"=="0" IF "%B%"=="0" "D:\2 Programas instalados\BOINC\boinccmd.exe" --set_gpu_mode auto
:salir
ID: 86281 · Report as offensive
ProfileJord
Volunteer tester
Help desk expert
Avatar

Send message
Joined: 29 Aug 05
Posts: 15512
Netherlands
Message 86283 - Posted: 23 May 2018, 11:34:47 UTC - in response to Message 86281.  
Last modified: 23 May 2018, 11:39:04 UTC

Which is fine and would work that way for Spanish versions and only if BOINC is installed in the default programs directory.
Better is to figure out how to read the registry at HKEY_LOCAL_MACHINE\SOFTWARE\Space Sciences Laboratory, U.C. Berkeley\BOINC Setup and look what the contents are for INSTALLDIR, then use that to point to boinccmd.exe

For instance:
FOR /F "tokens=2* delims=	 " %%A IN ('REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Space Sciences Laboratory, U.C. Berkeley\BOINC Setup" /v INSTALLDIR') DO SET ID=%%B
will read that from the registry and store it in ID
The code above after delims= consists of a tab first and then a space. It requires both.

If you need the data directory, use:
FOR /F "tokens=2* delims=	 " %%A IN ('REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Space Sciences Laboratory, U.C. Berkeley\BOINC Setup" /v DATADIR') DO SET DD=%%B

ID: 86283 · Report as offensive
wyxchari

Send message
Joined: 23 Sep 17
Posts: 10
Spain
Message 86288 - Posted: 23 May 2018, 15:42:05 UTC - in response to Message 86283.  
Last modified: 23 May 2018, 15:45:37 UTC

Thank you. It would look like this:
GPU_BOINC_Control_Accion.bat
@echo off
tasklist | find "boincmgr.exe">nul
IF not "%ERRORLEVEL%"=="0" goto salir
SET A=0
"C:\Program Files\NVIDIA Corporation\NVSMI\nvidia-smi.exe" --format=csv,noheader --query-compute-apps=name | find "BOINC"
IF "%ERRORLEVEL%"=="0" SET A=1
SET B=0
rem Change GAMES by the games folder. It is not necessary to include the disk or routes.
"C:\Program Files\NVIDIA Corporation\NVSMI\nvidia-smi.exe" --format=csv,noheader --query-compute-apps=name | find "GAMES"
IF "%ERRORLEVEL%"=="0" SET B=1
FOR /F "tokens=2*" %%F IN ('REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Space Sciences Laboratory, U.C. Berkeley\BOINC Setup" /v INSTALLDIR') DO SET ID=%%G
IF "%A%"=="1" IF "%B%"=="1" "%ID%boinccmd.exe" --set_gpu_mode never
IF "%A%"=="0" IF "%B%"=="0" "%ID%boinccmd.exe" --set_gpu_mode auto
:salir
ID: 86288 · Report as offensive

Message boards : GPUs : By FOLDERS, stop gpu auto with games

Copyright © 2024 University of California.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.