GPU: nvidia-smi or alternativ
› Forums › Desktop Info › GPU: nvidia-smi or alternativ
Tagged: cmd, gpu, monitoring, nvidia-smi
- This topic has 6 replies, 2 voices, and was last updated 2 years ago by
Glenn.
-
AuthorPosts
-
-
2 November, 2020 at 11:53 pm #3511
Hello,
I am very impressed with the program “DesktopInfo”. I’ve done some work with it, but I’m not a hardcore programmer. I’m currently stuck at the problem that I want to read the GPU data.
It should be best if its generic for NVDIDA, AMD and INTEL. I currently only have NVIDIA, so I’m just testing it with that.“DesktopInfo” can not natively read GPU data (or i dont know how). So I need a workaroud. I was able to read some data via
nvidia-smi
and the CMD window.
Actually I could read my most important data whit this:#nvidia-smi --query-gpu=temperature.gpu, fan.speed, utilization.gpu, utilization.memory, pstate, memory.total, memory.used --format=csv
But I have no idea how i can use it with CMD commands in “DesktopInfo” i tried different cases but everything failed.
Can someone help and maybe has something ready?
Regards David
-
3 November, 2020 at 8:41 pm #3514
post what you’ve tried so far.
-
8 November, 2020 at 10:25 pm #3520
Hello Glenn,
unfortunately, I have to say that I haven’t been able to continue working here since last week.
Below is the code for desktopinfo.ini.
In the section # GPUTYPE i tried the different commands itself without cmd and also with cmd commands.In the cmd file, there is noting special, some few tries. In a nativ command window the command
nvidia-smi --query-gpu=temperature.gpu --format=csv
show me the tempreture (as example). But i cant include it in the script with
CMD=...
All important information for GPU monitoring could be
#nvidia-smi --query-gpu=temperature.gpu, fan.speed, utilization.gpu, utilization.memory, pstate, memory.total, memory.used --format=csv"
I am a little confused that no one has ever tried this before or that it has worked and that is why no one here has asked for help.
If we can solved the GPU monitoring information into your “DesktopInfo”, it would be perfect. My next step would then be to implement it with AMD and INTEL. This should also be implemented in your sample code when we get it running.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394# Sample configuration file# See the manual for a full description of all options[options]# size and positiontop=0right=0width=235monitor-num=2allowdrag=0nav=0formcolor=000000transparency=50column1width=65# fontfont-face=Arialfont-size=8# logginglog=desktopinfo.loglog-level=error#miscdesktopinfo64=1ignore-setting-change=1# to use a language file, copy the 'sample-languages' folder to 'languages',# un-comment the following line and change it to your desired language# language=languages\german.ini[screen-saver]font-face=Comic Sans MSfont-size=16centerv=1centerh=1[items]# colorsset=key:White,value:#ffffffset=key:Grey,value:#909090set=key:Cyan,value:#00ffffset=key:Magenta,value:#ff00ffset=key:Green,value:#00ff00set=key:Orange,value:#ffd000set=key:Yellow,value:#ffff00set=key:Silver,value:#d0d0d0set=key:Blue,value:#0000f0set=key:Red,value:#ff0000# page 1PAGE=1PAGE-TITLE=OverviewCOLOR=%Cyan%# Date/TimeCOMMENT= font-size:120%, color:#ffffff, style:iwb,text:Daves Overview V01DATETIME= font-size:100%, color:#b0ffb0, interval:30,display:%9 %10BOOTTIME= font-size:100%, color:#b0ffb0, active:1,interval:0HOST= font-size:100%, color:#b0ffb0, interval:0# CPUTYPECOMMENT= font-size:120%, color:#ffffff, style:iwb,text:CPU UsageCPUTYPE= row-text:CPU Type,font-size:100%, color:#b0ffb0WMI= font-size:100%, color:#b0ffb0, interval:1,text:CPU Info,namespace:root\cimv2,query:Win32_Processor,display:Cores: %NumberOfCores%|Speed: %MaxClockSpeed%MHz|Current: %CurrentClockSpeed%MHz#CPU TemperaturCORETEMP= row-text:Temp: CPU, font-size:100%, color:#d0d0d0, interval:1, threshold2:1 70 #EE9900,threshold1:1 80 #ff0000,chart:line2 height:2 scale:linear max:100 series1:1 color1:#00ff00,display:%1%2 %chart%#CPU UsageCPUUSAGE= row-text:CPU %1, font-size:100%, color:#d0d0d0, interval:1, threshold2:2 55 #EE9900,threshold1:2 95 #ff0000,chart:line2 scale:linear max:100 series1:2 color1:00ff00 row-id:1, display:%2[3.0d]% %chart%#RAM UsagePHYSICALRAM=row-text:RAM, font-size:100%, color:#d0d0d0, interval:30,threshold2:3 75 #EE9900,threshold1:3 90 #ff0000,chart:line2 height:2 scale:linear max:100 series1:3 color1:#00ff00,display:%1[3.1b]B / %2[3.1b]B (%3% used),# GPUTYPECOMMENT= font-size:120%, color:#ffffff, style:iwb,text:GPU UsageDISPLAYCONTROLLER=row-text:GPU Type,color:#b0ffb0#CMD=active:1,file:powershell.exe,directory:D:\Downloads\DesktopInfo290\nvidia-smi.bat#CMD=active:1,interval:3,file:cmd.exe,parameters:nvidia-smi, chart:line linear 100 4 00ff00,display:%4,text:GPU Usage,color:FFFFFF#nvidia-smi --query-gpu=temperature.gpu, fan.speed, utilization.gpu, utilization.memory, pstate, memory.total, memory.used --format=csv# HDD / DisksCOMMENT= font-size:120%, color:#ffffff, style:iwb,text:HDD & DisksLOGICALDRIVES=row-text:Drive %1: | %3, font-size:100%, color:#b0ffb0, interval:60, diskio:0, chart:bar2 scale:linear max:100 series1:7 threshold:75 color1:#d0d0d0 color2:#EE9900 color3:#ff0000,threshold2:7 75 #EE9900, threshold1:7 90 #ff0000, display:%6[1.0B]B / %5[1.0B]B (%7[1.1f]% used)|%chart%|# UTILITYCOLOR=%Cyan%COMMENT= font-size:120%, color:#ffffff, style:iwb,text:UtilityWMI=text:Bios,namespace:root\cimv2,query:Win32_Bios,display:%Caption%-
This reply was modified 2 years ago by
Bazokaa.
-
This reply was modified 2 years ago by
-
9 November, 2020 at 12:51 am #3523
I added a screenshot. I will replace the gadgets CPU Usage and GPU Meter.
The operator should understand this at first sight. It should no longer be so colourful and childish. In the end just professional 🙂Attachments:
-
9 November, 2020 at 6:37 am #3525
it looks like this is the code in question:
1234#CMD=active:1,file:powershell.exe,directory:D:\Downloads\DesktopInfo290\nvidia-smi.bat#CMD=active:1,interval:3,file:cmd.exe,parameters:nvidia-smi, chart:line linear 100 4 00ff00,display:%4,text:GPU Usage,color:FFFFFF#nvidia-smi --query-gpu=temperature.gpu, fan.speed, utilization.gpu, utilization.memory, pstate, memory.total, memory.used --format=csvnotice how in the first line you fully qualify the batch file including extension but you haven’t done that in the second line.
You didn’t post the batch file so I can’t comment on that. Your screen shot doesn’t show the CMD item in question, you commented it out. I don’t have a computer with an nvidia card so I can’t test it here.
what is the output when you run the batch file from the command line?
-
9 November, 2020 at 7:06 pm #3526
Dear Glenn thank you.
the two lines was for testing (relativ / absolut path) and where the sub skript could be startetd from.
I habe two batch files for testing. I would prefer the first one, but in the end it doesn’t matter, the main thing is that it works then.
1. nvidia-smi.cmd:
nvidia-smi --query-gpu=temperature.gpu,fan.speed,utilization.gpu,utilization.memory,pstate, memory.total,memory.used,memory.free --format=csv
The output is:
12temperature.gpu, fan.speed [%], utilization.gpu [%], utilization.memory [%], memory.total [MiB], memory.used [MiB], memory.free [MiB], pstate56, 0 %, 11 %, 4 %, 6144 MiB, 541 MiB, 5603 MiB, P0here would be all important information for available.
2. get-nvidia-usage.cmd:
123456789for /f "tokens=1* delims= " %%i in ('C:\Windows\System32\nvidia-smi.exe -q ^| findstr /r /c:"^ *Gpu *:"') do (echo %%i)for /f "tokens=1* delims= " %%i in ('nvidia-smi.exe -q ^| findstr /r /c:"^ *Gpu *:"') do (echo %%i %%j)for /f "tokens=1* delims= " %%i in ('nvidia-smi.exe -q ^| findstr /r /c:"^ *Memory :*"') do (echo %%i %%j)for /f "tokens=1* delims= " %%i in ('nvidia-smi.exe -q ^| findstr /r /c:"^ *Total*:*"') do (echo %%i %%j)for /f "tokens=1* delims= " %%i in ('nvidia-smi.exe -q ^| findstr /r /c:"^ *Used*:*"') do (echo %%i %%j)for /f "tokens=1* delims= " %%i in ('nvidia-smi.exe -q ^| findstr /r /c:"^ *Free*:*"') do (echo %%i %%j)for /f "tokens=1* delims= " %%i in ('nvidia-smi.exe -q ^| findstr /r /c:"^ *Fan Speed *:"') do (echo %%i %%j)for /f "tokens=1* delims= " %%i in ('nvidia-smi.exe -q ^| findstr /r /c:"^ *GPU Current Temp *:"') do (echo %%i %%j)for /f "tokens=1* delims= " %%i in ('nvidia-smi.exe -q ^| findstr /r /c:"^ *Performance State *:"') do (echo %%i %%j)the output would be:
12345678910111213141516171819202122232425262728293031GpuGpu : 11 %Memory : 4 %Memory Current Temp : N/AMemory Max Operating Temp : N/AMemory : 4006 MHzMemory : N/AMemory : N/AMemory : 4004 MHzTotal : 6144 MiBTotal : 256 MiBTotal : N/ATotal : N/ATotal : N/ATotal : N/AUsed : 545 MiBUsed : 229 MiBUsed GPU Memory : Not available in WDDM driver modelUsed GPU Memory : Not available in WDDM driver modelUsed GPU Memory : Not available in WDDM driver modelUsed GPU Memory : Not available in WDDM driver modelUsed GPU Memory : Not available in WDDM driver modelUsed GPU Memory : Not available in WDDM driver modelUsed GPU Memory : Not available in WDDM driver modelUsed GPU Memory : Not available in WDDM driver modelUsed GPU Memory : Not available in WDDM driver modelFree : 5599 MiBFree : 27 MiBFan Speed : 0 %GPU Current Temp : 61 CPerformance State : P0but Im not very happy about this. There some lines where the names are not unique and i dont know how to filter it.
With this command
CMD= font-size:100%, color:#d0d0d0,row-text:GPU Usage,active:1,interval:1,hide-no-result:1,file:cmd.exe,parameters:/C nvidia-smi.cmd,trim,show-window:0,chart:line scale:linear max:100 series1:4 00ff00,display: Nr4: %4.2 %chart%
I get (maybe) useful datas. Also a screenshot from the gui.-
This reply was modified 2 years ago by
Bazokaa.
-
This reply was modified 2 years ago by
-
-
9 November, 2020 at 8:31 pm #3531
You’re getting closer to it. the third screenshot is showing the cmd output.
Put a ‘@’ in front of the command in the nvidia-smi.cmd file:
@nvidia-smi --query-gpu=temperature.gpu,fan.speed,utilization.gpu,utilization.memory,pstate, memory.total,memory.used,memory.free --format=csv
that will stop the echo of the command line to the output.
You won’t get a chart out of this. DTI has no idea where to look for the data in the output. The only way to get a chart is to make the cmd return a single number, no words, just a single value.
It might be an interesting exercise to see if I can access the NVML api……
-
This reply was modified 2 years ago by
Glenn.
-
This reply was modified 2 years ago by
-
-
AuthorPosts
- The topic ‘GPU: nvidia-smi or alternativ’ is closed to new replies.