问题
nvidia-smi executed in a command prompt in windows returns the following error
C:\Users>nvidia-smi
'nvidia-smi' is not recognized as an internal or external command,
operable program or batch file.
Where is it located? CUDA is installed already.
回答1:
Nvidia-SMI is stored by default in the following location:
C:\Program Files\NVIDIA Corporation\NVSMI
You can move to that directory and then run nvidia-smi from there. Unlike linux, it can't be executed by the command line in a different path.
What might be easier to do is to open that directory in Windows Explorer, create a short cut of nvidia-smi.exe and put it on your desktop. Then, right click on it, hit properties, and Under Shortcut > Target modify the string path to include -l < time you want it to refresh >.
For example, modify:
"C:\Program Files\NVIDIA Corporation\NVSMI\nvidia-smi.exe"
to
"C:\Program Files\NVIDIA Corporation\NVSMI\nvidia-smi.exe" -l 5
Then hit "Apply", and then "OK".
In this example, when you open the shortcut, it will keep the command prompt open and allow you to watch your work as nvidia-smi refreshes every five seconds.
回答2:
You can add "C:\Program Files\NVIDIA Corporation\NVSMI" to PATH and than restart console.
System Properties > Advanced > Environment Variables > System Variables -> Path -> Edit > New > insert folder path with nvidia-smi
来源:https://stackoverflow.com/questions/57100015/how-do-i-run-nvidia-smi-on-windows