如何在 Windows 上运行 nvidia-smi? [英] How do I run nvidia-smi on Windows?

查看:657
本文介绍了如何在 Windows 上运行 nvidia-smi?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

nvidia-smi 在 Windows 的命令提示符 (CMD) 中执行返回以下错误

nvidia-smi executed in a Command Prompt (CMD) 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.

它位于哪里?CUDA 已经安装.

Where is it located? CUDA is installed already.

推荐答案

Nvidia-SMI默认存储在以下位置

C:\Windows\System32\DriverStore\FileRepository\nvdm*\nvidia-smi.exe

其中 nvdm* 是一个以 nvdm 开头且后面有未知字符数的目录.

Where nvdm* is a directory that starts with nvdm and has an unknown number of characters after it.

注意:较旧的安装可能在 C:\Program Files\NVIDIA Corporation\NVSMI

Note: Older installs may have it in C:\Program Files\NVIDIA Corporation\NVSMI

您可以移动到该目录,然后从那里运行 nvidia-smi.但是,命令提示符窗口不会持久化,因此很难看到信息.此外,在此更改时确定 nvdm* 目录是什么也具有挑战性,并且存在多个这种格式的目录.更复杂的是,与 linux 不同,它不能由命令行在不同的路径中执行.最好找到确切位置并创建一个定期运行它的快捷方式.

You can move to that directory and then run nvidia-smi from there. However, the command prompt window will not persist, making it very difficult to see the information. Additionally it is challenging to determine what the nvdm* directory is as this changes and there are multiple directories of this format. To complicate matters, unlike linux, it can't be executed by the command line in a different path. It's better to find the exact location and create a shortcut that runs it in a periodic manner.

查找您的确切位置

  1. 打开文件资源管理器(任务栏上的文件夹图标,靠近开始/Cortana/任务视图按钮).
  2. 在左侧窗格中,单击此电脑".
  3. 在主查看器中,图标顶部是一个搜索栏.输入 nvidia-smi.exe 并回车.它会在一段时间后出现.
  4. 右键单击并选择打开文件位置"并继续按照以下说明制作桌面快捷方式,或双击运行一次(不推荐,因为它会运行并在完成后关闭窗口,从而很难看到信息).
  1. Open File Explorer (File Folder Icon on your Task Bar, Near Start / Cortana / Task View buttons).
  2. In the left Pane, click 'This PC'.
  3. In the main viewer, just to the top of the Icons, is a search bar. Type nvidia-smi.exe and hit enter. It will come up after some time.
  4. Right-click and choose 'Open File Location' and continue with the below instructions to make a desktop shortcut, or double click to run once (not recommended, as it runs and closes the window once complete, making it hard to see the information).

制作一个运行 nvidia-smi 并定期刷新的快捷方式

  1. 按照查找您的确切位置"下的上述步骤操作.
  2. 右键单击 nvidia-smi.exe(它可能只是在视图窗格中显示 nvidia-smi)并选择创建快捷方式.它可能会告诉您无法在此处创建快捷方式,并询问您是否要将其放在桌面上.打是.
  3. 现在,在桌面上,右键单击刚刚创建的快捷方式,点击属性,然后在快捷方式>目标下修改字符串路径以包含-l <;您希望它刷新的时间>.
  1. Follow the above steps under 'To find your exact location'.
  2. Right click on nvidia-smi.exe (it may just say nvidia-smi in the viewpane) and choose create a shortcut. It will likely tell you that you can't create a shortcut here, and ask if you want to put it on your desktop. Hit yes.
  3. Now, on the desktop, right click on the shortcut you have just created, hit properties, and Under Shortcut > Target modify the string path to include -l < time you want it to refresh >.

例如修改:

C:\Windows\System32\DriverStore\FileRepository\nvdm*\nvidia-smi.exe

C:\Windows\System32\DriverStore\FileRepository\nvdm*\nvidia-smi.exe -l 5

然后点击应用",然后点击确定".

Then hit "Apply", and then "OK".

在本例中,当您打开快捷方式时,它将保持命令提示符打开并允许您观看您的工作,因为 nvidia-smi 每五秒刷新一次.

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.

这篇关于如何在 Windows 上运行 nvidia-smi?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆