No CMD output
› Forums › Desktop Info › No CMD output
- This topic has 27 replies, 3 voices, and was last updated 11 months, 3 weeks ago by
webmaster.
-
AuthorPosts
-
-
10 April, 2021 at 1:07 am #3878
Nathan_K
ParticipantI’m having an issue lately where my CMD line isn’t resulting in any output. I just get “<n/a>” returned due to no result.
CMD=active:1,interval:5,read-as-csv:1,csv-header:0,file:nvidia-smi.exe,parameters:--query-gpu=utilization.gpu\,temperature.gpu\,memory.used\,memory.total --format=csv\,noheader\,nounits,trim:1,show-window:0,color:22ccee,chart:line2 scale:linear max:100 series1:%1 color1:00ff00,threshold1:1 40 909090,threshold2:1 60 FFBF00,threshold3:1 90 ff0000,text:GPU Usage,display:Usage: %1% Temp: %2C %chart%|Memory: %3 MiB / %4 MiB
Debug logs show the following:
123409-04-21 11:01:10:038 DATA CMD --query-gpu=utilization.gpu,temperature.gpu,memory.used,memory.total --format=csv,noheader,nounits09-04-21 11:01:10:041 DEBUG CMD run, time: 0ms09-04-21 11:01:10:042 DEBUG CMD process09-04-21 11:01:10:043 DATA CMD () TrueIf I run the command from CMD.EXE directly I get the following:
12C:\>nvidia-smi.exe --query-gpu=utilization.gpu,temperature.gpu,memory.used,memory.total --format=csv,noheader,nounits2, 44, 1873, 4096Version: 2.10.2 (was in issue in 2.10.1 as well)
Thanks in advance.
-
10 April, 2021 at 1:03 pm #3879
webmaster
Keymasterweird. almost like it can’t find nvidia-smi.exe.
-
11 April, 2021 at 4:24 am #3880
Nathan_K
ParticipantAgreed. I’ve tried it using “CMD.EXE” and “/C nvidia-smi.exe ……” for the parameters as well. I get the same result. Are you able to replicate the issue at all?
This snippet works fine though and I get the expected output. Perhaps something in the CSV output?
CMD=active:1,interval:3,file:cmd.exe,parameters:/C hostname,trim:1,text:Test CMD,display:%4
-
11 April, 2021 at 4:30 am #3881
Nathan_K
ParticipantSo I just tested my CSV theory with the following snippet, which, if I’m reading your manual correctly, should output the exact thing as the prior snippet (previous reply).
CMD=active:1,interval:3,read-as-csv:1,csv-header:0,file:cmd.exe,parameters:/C hostname,trim:1,text:Test CMD,display:%1
Instead, I get the output of “<n/a>”.
-
12 April, 2021 at 11:00 am #3882
webmaster
KeymasterThe trim option might be messing up the csv parser. Try setting it to 0.
-
12 April, 2021 at 9:53 pm #3883
Nathan_K
ParticipantTried with Trim set to 0. Same result.
-
12 April, 2021 at 9:55 pm #3884
Nathan_K
ParticipantAllow me to clarify on that. Same result of “<n/a>” for the nvidia-smi.exe line, but it does fix the display issue when used with the hostname test I performed.
-
12 April, 2021 at 9:59 pm #3885
Nathan_K
ParticipantSo I tried changing my nvidia-smi.exe line to use cmd.exe with “/C nvidia-smi.exe” instead and the command causes DTI to hang while trying to display the output. Almost like the command isn’t finishing it’s execution.
-
13 April, 2021 at 10:32 am #3886
webmaster
KeymasterI’m hamstrung because I don’t have a box with an nvidia card to test on.
Try running nvidia-smi.exe with no parameters so that it returns it’s standard error message.
CMD=interval:5,file:”C:\Program Files\Nvidia Corporation\NVSMI\nvidia-smi.exe”
Try adding the full path as above.
I notice nvidia-smi wants to be run as Administrator.
-
14 April, 2021 at 11:51 am #3887
Nathan_K
ParticipantSince NVIDIA also installs the .exe into the Windows\System32 path, you can run it without a path on it. Below are the commands I executed, and their output. Also, it does not require Administrator level permissions to be executed.
CMD=interval:5,file:nvidia-smi.exe
Output: Command <n/a>
From a CMD.EXE prompt:
12345678910111213141516171819202122232425262728293031323334353637383940414243C:\>nvidia-smi.exeTue Apr 13 21:47:23 2021+-----------------------------------------------------------------------------+| NVIDIA-SMI 461.40 Driver Version: 461.40 CUDA Version: 11.2 ||-------------------------------+----------------------+----------------------+| GPU Name TCC/WDDM | Bus-Id Disp.A | Volatile Uncorr. ECC || Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. || | | MIG M. ||===============================+======================+======================|| 0 GeForce GTX 105... WDDM | 00000000:01:00.0 On | N/A || 0% 49C P8 N/A / 72W | 807MiB / 4096MiB | 2% Default || | | N/A |+-------------------------------+----------------------+----------------------++-----------------------------------------------------------------------------+| Processes: || GPU GI CI PID Type Process name GPU Memory || ID ID Usage ||=============================================================================|| 0 N/A N/A 1568 C+G ...zilla Firefox\firefox.exe N/A || 0 N/A N/A 1676 C+G Insufficient Permissions N/A || 0 N/A N/A 2040 C+G ...zilla Firefox\firefox.exe N/A || 0 N/A N/A 5260 C+G ...root\Office16\OUTLOOK.EXE N/A || 0 N/A N/A 7480 C+G C:\Windows\explorer.exe N/A || 0 N/A N/A 10184 C+G Insufficient Permissions N/A || 0 N/A N/A 11268 C+G ...Battle.net\Battle.net.exe N/A || 0 N/A N/A 13036 C+G ...s (x86)\Origin\Origin.exe N/A || 0 N/A N/A 13064 C+G Insufficient Permissions N/A || 0 N/A N/A 13644 C+G ...5n1h2txyewy\SearchApp.exe N/A || 0 N/A N/A 14228 C+G ...y\ShellExperienceHost.exe N/A || 0 N/A N/A 14324 C+G ...ekyb3d8bbwe\YourPhone.exe N/A || 0 N/A N/A 14828 C+G ...Battle.net\Battle.net.exe N/A || 0 N/A N/A 14928 C+G ...nputApp\TextInputHost.exe N/A || 0 N/A N/A 15492 C+G ...d\app-0.0.309\Discord.exe N/A || 0 N/A N/A 15736 C+G ...ram Files\LGHUB\lghub.exe N/A || 0 N/A N/A 16704 C+G ...les\reWASD\reWASDTray.exe N/A || 0 N/A N/A 16892 C+G ...86)\Overwolf\Overwolf.exe N/A || 0 N/A N/A 18012 C+G ...qxf38zg5c\Skype\Skype.exe N/A || 0 N/A N/A 18100 C+G ...ropbox\Client\Dropbox.exe N/A || 0 N/A N/A 18808 C+G ...qxf38zg5c\Skype\Skype.exe N/A || 0 N/A N/A 19376 C+G ....0.12\OverwolfBrowser.exe N/A || 0 N/A N/A 20888 C+G ...lPanel\SystemSettings.exe N/A |+-----------------------------------------------------------------------------+ -
15 April, 2021 at 8:47 am #3888
webmaster
Keymasterif you were to redirect that output to a text file from the command line:
C:\>nvidia-smi.exe >nvidia.txt
and open it in notepad.exe what would the text encoding be?
is 461.40 the version of the executable?
-
15 April, 2021 at 10:20 am #3889
Nathan_K
ParticipantThe txt file is formatted UTF-16LE.
As far as the version, 461.40 is the current driver version, but NVIDIA updates the nvidia-smi.exe with each driver update. The file version is 8.17.14.6140, of which you will not the last 5-digits of the file version match the driver version.
-
15 April, 2021 at 10:44 am #3890
webmaster
Keymastertry adding code page to the DTI options:
CMD=interval:5,file:nvidia-smi.exe,code-page:437
-
15 April, 2021 at 10:56 am #3891
Nathan_K
ParticipantDidn’t seem to help. I did some additional testing and this part makes no sense what so ever.
1234CMD=active:1,interval:3,read-as-csv:0,csv-header:0,file:cmd.exe,parameters:/C "C:\Windows\System32\nvidia-smi.exe",trim:1,code-page:437,text:Test CMD,display:%4'Results in the following:‘C:\Windows\System32\nvidia-smi.exe’ is not recognized as an internal or external command,
operable program or batch file.`But, running the same from the CMD prompt (non-elevated) results with:
12345678910111213Wed Apr 14 20:51:42 2021+-----------------------------------------------------------------------------+| NVIDIA-SMI 461.40 Driver Version: 461.40 CUDA Version: 11.2 ||-------------------------------+----------------------+----------------------+| GPU Name TCC/WDDM | Bus-Id Disp.A | Volatile Uncorr. ECC || Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. || | | MIG M. ||===============================+======================+======================|| 0 GeForce GTX 105... WDDM | 00000000:01:00.0 On | N/A || 0% 54C P8 N/A / 72W | 1534MiB / 4096MiB | 35% Default || | | N/A |+-------------------------------+----------------------+----------------------+........ -
15 April, 2021 at 2:22 pm #3892
webmaster
Keymasterdirectory option?
maybe run it via a batch file? I’m clutching at straws now trying to think of ways to understand what’s going on.
-
15 April, 2021 at 11:49 pm #3893
Nathan_K
ParticipantOk, so I created a batch file to test this as you recommended.
Batch file:
12345678910@Echo OffIf Exist "C:\WINDOWS\SYSTEM32\NVIDIA-SMI.EXE" Goto STATUS:: Exit with error codeEcho Unable to locate executable.Exit:STATUSC:\WINDOWS\SYSTEM32\NVIDIA-SMI.EXE --query-gpu=utilization.gpu,temperature.gpu,memory.used,memory.total --format=csv,noheader,nounitsExitOutput when run from CMD directly:
12C:\Users\nxxxxxxxxxxx\AppData\Local\DesktopInfo\scripts>gpu-status.bat4, 58, 1569, 4096Config line:
CMD=active:1,interval:3,read-as-csv:0,csv-header:0,file:cmd.exe,parameters:/C .\scripts\gpu-status.bat,trim:1,text:Test CMD,display:%4
Output from DTI:
Unable to locate executable.
I’m at a complete loss.
-
16 April, 2021 at 9:19 am #3895
webmaster
Keymasterso that tells me that DTI is running the batch file successfully but the process that is running the batch file doesn’t have access to c:\windows\system32.
a couple of things to try:
1. replace nvidia-smi.exe with some other command line tool in system32, say diskperf.exe, driverquery.exe etc. anything that produces a command line output.
2. when running nvidia-smi.exe directly from the DTI CMD item, I would be interested to see the error codes:
CMD=file:c:\windows\system32\nvidia-smi.exe, display:%1 %2 %3 %4
-
16 April, 2021 at 7:51 pm #3897
Nathan_K
ParticipantOutput when run using your snippet above are as follows: 0 2 0
As for putting DISKPERF.EXE into the batch file instead? The output is below:
1234Both Logical and Physical Disk Performance counters on this systemare automatically enabled on demand.For legacy applications using IOCTL_DISK_PERFORMANCE to retrieve raw counters,you can use -Y or -N to forcibly enable or disable. No restart is required.Works perfect. This is making less and less sense as we go along.
-
22 April, 2021 at 8:18 am #3898
Nathan_K
ParticipantSo I’ve got it working, thought it isn’t pretty. While I couldn’t get it to find or read the file in the C:\Windows\System32 path, I managed to get it to read the one in the DriverStore sub-folder. But since that folder name can change, I had to jump through some ugly hoops to get it to work right. My line of config code is below.
CMD=active:1,interval:5,hide-no-result:1,read-as-csv:1,csv-header:0,file:powershell.exe,parameters:-Command "& $($(Get-ChildItem -Path 'C:\Windows\System32\DriverStore' -Include nvidia-smi.exe -Recurse -File).FullName) --query-gpu=utilization.gpu\,temperature.gpu\,memory.used\,memory.total --format=csv\,noheader\,nounits",trim:0,show-window:0,color:22ccee,chart:line2 scale:linear max:100 series1:%1 color1:00ff00,threshold1:1 40 909090,threshold2:1 60 FFBF00,threshold3:1 90 ff0000,text:GPU Usage,display:Usage: %1% Temp: %2C %chart%|Memory: %3 MiB / %4 MiB
I’m getting the output I’m looking for and it’s working fine, but that was not fun.
Attachments:
-
25 April, 2021 at 8:32 am #3902
webmaster
Keymasterwow! nice work.
according to the manual the error codes are:
0 = CreateProcess failed.
2 = Error Code 2 = ERROR_FILE_NOT_FOUNDI don’t know exactly what that means in this case but for some reason the system is blocking you from accessing that exe file in the system32 directory.
-
1 May, 2021 at 6:35 pm #3917
JoeJr
ParticipantHi!
Desktop Info is a wonderful tool, but I have the same problem as the OP.
So, I did some testing, and there is a couple of strange things happening.1. DesktopInfo.exe never tries to read C:\Windows\System32 when looking for the EXE-file.
You can test this by pointing directly to the file (C:\Windows\System32\nvidia-smi.exe) and use a tool, f.ex Process Monitor by Sysinternals to verify this.2. The parameters option does not work in this context.
Using the option just triggers the default screen in nvidia-smi.I copied the file to another directory, and renamed it to be sure, n-smi.exe.
This now works as expected:
CMD=text:GPUtest,interval:5,read-as-csv:1,csv-header:0,file:F:\Test\n-smi.exe --query-gpu=utilization.gpu\,temperature.gpu\,memory.used\,memory.total\,power.draw --format=csv\,noheader\,nounits,display:Usage: %1% Temp: %2C |Memory: %3 MiB / %4 MiB|PowerUse: %5 W,chart:line2 scale:linear max:100 series1:%2 color1:%Green%,threshold1:1 40 909090,threshold2:1 60 FFBF00,threshold3:1 90 ff0000
I also copied the renamed file back to System32, and the same thing happens. DesktopInfo.exe never reads that directory
Kind Regards,
JoeJr -
6 May, 2021 at 10:29 am #3920
webmaster
KeymasterI bet it’s getting redirected to C:\Windows\SysWOW64
-
6 May, 2021 at 3:04 pm #3923
JoeJr
Participant-
6 May, 2021 at 3:17 pm #3925
webmaster
Keymasterhttps://docs.microsoft.com/en-us/windows/win32/winprog64/file-system-redirector
So it looks like I can add a wow option to the CMD item in the same way as the REG item
-
-
6 May, 2021 at 3:30 pm #3927
JoeJr
ParticipantBut, it works when copying the exe file, and version upgrades are easily checked with a script.
So I’m a happy camper.Kind Regards,
JoeJrAttachments:
-
3 June, 2021 at 10:03 am #3952
webmaster
KeymasterInstead of adding a wow option like the REG item, I’ve wrapped the CreateProcess call in Wow64DisableWow64FsRedirection / Wow64RevertWow64FsRedirection calls. This means it will go where it’s told. I’ve done the same for the CONTROL items so things like printmanagement.msc will work properly.
-
3 June, 2021 at 10:41 am #3955
Nathan_K
ParticipantInstead of adding a wow option like the REG item, I’ve wrapped the CreateProcess call in Wow64DisableWow64FsRedirection / Wow64RevertWow64FsRedirection calls. This means it will go where it’s told. I’ve done the same for the CONTROL items so things like printmanagement.msc will work properly.
So we should expect to see v2.10.3 with this change?
-
-
AuthorPosts
- You must be logged in to reply to this topic.