nvidia-smi полное имя NVIDIA System Management Interface ,Как следует из названия:Интерфейс управления системой NVIDIA。nvidia-smiОбычно люди просто используют его для проверки использования видеокарт серии NVIDIA./рабочая ситуация(Использование видеопамяти/загрузка видеокарты/рабочие потоки видеокарты)ждать。Как показано ниже:
nvidia-smi.exe
Tue Jan 16 22:43:00 2024
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 537.70 Driver Version: 537.70 CUDA Version: 12.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 NVIDIA GeForce RTX 4060 Ti WDDM | 00000000:01:00.0 On | N/A |
| 32% 30C P8 7W / 160W | 990MiB / 8188MiB | 27% Default |
| | | N/A |
+-----------------------------------------+----------------------+----------------------+
+---------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=======================================================================================|
| 0 N/A N/A 3200 C+G ...ekyb3d8bbwe\StoreExperienceHost.exe N/A |
При ежедневном использовании я просто спрашиваю, доступна ли эта команда.,Используется для определения успешности установки драйвера видеокарты.,Другой — проверить использование только что упомянутой видеокарты.,На прошлой неделе, когда группа мониторинга связалась и развернула мониторинг видеокарты,,При работе с ними,осознавать себяnvidia-smiСлишком мало понимания того, как использовать,я тоже пошла учиться,Провел небольшое исследование, чтобы понять,узнал что-то,Но неожиданное открытие,во внутреннем Интернете nvidia-smiБольшинство представлений просты.,Вот и возникла идея написать статью.
nvidia-smi Не буду объяснять установку.,начатьnvidia-smiзнакомиться。Согласно международной практике вshellСбить nvidia-smi -h
,для просмотра справочной документации.
nvidia-smi -h
NVIDIA System Management Interface -- v546.33
NVSMI provides monitoring information for Tesla and select Quadro devices.
The data is presented in either a plain text or an XML format, via stdout or a file.
NVSMI also provides several management operations for changing the device state.
Note that the functionality of NVSMI is exposed through the NVML C-based
library. See the NVIDIA developer website for more information about NVML.
Python wrappers to NVML are also available. The output of NVSMI is
not guaranteed to be backwards compatible; NVML and the bindings are backwards
compatible.
http://developer.nvidia.com/nvidia-management-library-nvml/
http://pypi.python.org/pypi/nvidia-ml-py/
Supported products:
- Full Support
- All Tesla products, starting with the Kepler architecture
- All Quadro products, starting with the Kepler architecture
- All GRID products, starting with the Kepler architecture
- GeForce Titan products, starting with the Kepler architecture
- Limited Support
- All Geforce products, starting with the Kepler architecture
Приведенное выше определение:
nvsmiпредусмотрено Tesla и select Quadro devices информация мониторинга. Эти данные мониторинга можно получить через простой текст или XML-формат показать,на стандартный выводилидокумент。Также предусмотрены некоторые операции по изменению статуса устройства.。Далее следует некоторая информация оNVSMIиNVMLНекоторые краткие пояснения,Что требует внимания, так это то, что две ссылки,В частности, второй дает информацию оpythonЗнакомство с командами。и последующие действияsupported products。
Здесь описаны все оnvidia-smiОписание,Далее речь пойдет о том, как его использовать. Что-то связанное с командной строкой.
nvidia-smi [OPTION1 [ARG1]] [OPTION2 [ARG2]] ...
-h, --help Print usage information and exit.
LIST OPTIONS:
-L, --list-gpus Display a list of GPUs connected to the system.
-B, --list-excluded-gpus Display a list of excluded GPUs in the system.
SUMMARY OPTIONS:
<no arguments> Show a summary of GPUs connected to the system.
[plus any of]
-i, --id= Target a specific GPU.
-f, --filename= Log to a specified file, rather than to stdout.
-l, --loop= Probe until Ctrl+C at specified second interval.
QUERY OPTIONS:
-q, --query Display GPU or Unit info.
[plus any of]
-u, --unit Show unit, rather than GPU, attributes.
-i, --id= Target a specific GPU or Unit.
-f, --filename= Log to a specified file, rather than to stdout.
-x, --xml-format Produce XML output.
--dtd When showing xml output, embed DTD.
-d, --display= Display only selected information: MEMORY,
UTILIZATION, ECC, TEMPERATURE, POWER, CLOCK,
COMPUTE, PIDS, PERFORMANCE, SUPPORTED_CLOCKS,
PAGE_RETIREMENT, ACCOUNTING, ENCODER_STATS,
SUPPORTED_GPU_TARGET_TEMP, VOLTAGE, FBC_STATS
ROW_REMAPPER, RESET_STATUS
Flags can be combined with comma e.g. ECC,POWER.
Sampling data with max/min/avg is also returned
for POWER, UTILIZATION and CLOCK display types.
Doesn't work with -u or -x flags.
-l, --loop= Probe until Ctrl+C at specified second interval.
-lms, --loop-ms= Probe until Ctrl+C at specified millisecond interval.
SELECTIVE QUERY OPTIONS:
Allows the caller to pass an explicit list of properties to query.
[one of]
--query-gpu Information about GPU.
Call --help-query-gpu for more info.
--query-supported-clocks List of supported clocks.
Call --help-query-supported-clocks for more info.
--query-compute-apps List of currently active compute processes.
Call --help-query-compute-apps for more info.
--query-accounted-apps List of accounted compute processes.
Call --help-query-accounted-apps for more info.
This query is not supported on vGPU host.
--query-retired-pages List of device memory pages that have been retired.
Call --help-query-retired-pages for more info.
--query-remapped-rows Information about remapped rows.
Call --help-query-remapped-rows for more info.
[mandatory]
--format= Comma separated list of format options:
csv - comma separated values (MANDATORY)
noheader - skip the first line with column headers
nounits - don't print units for numerical
values
[plus any of]
-i, --id= Target a specific GPU or Unit.
-f, --filename= Log to a specified file, rather than to stdout.
-l, --loop= Probe until Ctrl+C at specified second interval.
-lms, --loop-ms= Probe until Ctrl+C at specified millisecond interval.
DEVICE MODIFICATION OPTIONS:
[any one of]
-e, --ecc-config= Toggle ECC support: 0/DISABLED, 1/ENABLED
-p, --reset-ecc-errors= Reset ECC error counts: 0/VOLATILE, 1/AGGREGATE
-c, --compute-mode= Set MODE for compute applications:
0/DEFAULT, 1/EXCLUSIVE_THREAD (DEPRECATED),
2/PROHIBITED, 3/EXCLUSIVE_PROCESS
-dm, --driver-model= Enable or disable TCC mode: 0/WDDM, 1/TCC
-fdm, --force-driver-model= Enable or disable TCC mode: 0/WDDM, 1/TCC
Ignores the error that display is connected.
--gom= Set GPU Operation Mode:
0/ALL_ON, 1/COMPUTE, 2/LOW_DP
-lgc --lock-gpu-clocks= Specifies <minGpuClock,maxGpuClock> clocks as a
pair (e.g. 1500,1500) that defines the range
of desired locked GPU clock speed in MHz.
Setting this will supercede application clocks
and take effect regardless if an app is running.
Input can also be a singular desired clock value
(e.g. <GpuClockValue>). Optionally, --mode can be
specified to indicate a special mode.
-m --mode= Specifies the mode for --locked-gpu-clocks.
Valid modes: 0, 1
-rgc --reset-gpu-clocks
Resets the Gpu clocks to the default values.
-lmc --lock-memory-clocks= Specifies <minMemClock,maxMemClock> clocks as a
pair (e.g. 5100,5100) that defines the range
of desired locked Memory clock speed in MHz.
Input can also be a singular desired clock value
(e.g. <MemClockValue>).
-rmc --reset-memory-clocks
Resets the Memory clocks to the default values.
-lmcd --lock-memory-clocks-deferred=
Specifies memClock clock to lock. This limit is
applied the next time GPU is initialized.
This is guaranteed by unloading and reloading the kernel module.
Requires root.
-rmcd --reset-memory-clocks-deferred
Resets the deferred Memory clocks applied.
-ac --applications-clocks= Specifies <memory,graphics> clocks as a
pair (e.g. 2000,800) that defines GPU's
speed in MHz while running applications on a GPU.
-rac --reset-applications-clocks
Resets the applications clocks to the default values.
-pl --power-limit= Specifies maximum power management limit in watts.
Takes an optional argument --scope.
-sc --scope= Specifies the device type for --scope: 0/GPU, 1/TOTAL_MODULE (Grace Hopper Only)
-cc --cuda-clocks= Overrides or restores default CUDA clocks.
In override mode, GPU clocks higher frequencies when running CUDA applications.
Only on supported devices starting from the Volta series.
Requires administrator privileges.
0/RESTORE_DEFAULT, 1/OVERRIDE
-am --accounting-mode= Enable or disable Accounting Mode: 0/DISABLED, 1/ENABLED
-caa --clear-accounted-apps
Clears all the accounted PIDs in the buffer.
--auto-boost-default= Set the default auto boost policy to 0/DISABLED
or 1/ENABLED, enforcing the change only after the
last boost client has exited.
--auto-boost-permission=
Allow non-admin/root control over auto boost mode:
0/UNRESTRICTED, 1/RESTRICTED
-mig --multi-instance-gpu= Enable or disable Multi Instance GPU: 0/DISABLED, 1/ENABLED
Requires root.
-gtt --gpu-target-temp= Set GPU Target Temperature for a GPU in degree celsius.
Requires administrator privileges
[plus optional]
-i, --id= Target a specific GPU.
-eow, --error-on-warning Return a non-zero error for warnings.
UNIT MODIFICATION OPTIONS:
-t, --toggle-led= Set Unit LED state: 0/GREEN, 1/AMBER
[plus optional]
-i, --id= Target a specific Unit.
SHOW DTD OPTIONS:
--dtd Print device DTD and exit.
[plus optional]
-f, --filename= Log to a specified file, rather than to stdout.
-u, --unit Show unit, rather than device, DTD.
--debug= Log encrypted debug information to a specified file.
Device Monitoring:
dmon Displays device stats in scrolling format.
"nvidia-smi dmon -h" for more information.
daemon Runs in background and monitor devices as a daemon process.
This is an experimental feature. Not supported on Windows baremetal
"nvidia-smi daemon -h" for more information.
replay Used to replay/extract the persistent stats generated by daemon.
This is an experimental feature.
"nvidia-smi replay -h" for more information.
Process Monitoring:
pmon Displays process stats in scrolling format.
"nvidia-smi pmon -h" for more information.
NVLINK:
nvlink Displays device nvlink information. "nvidia-smi nvlink -h" for more information.
C2C:
c2c Displays device C2C information. "nvidia-smi c2c -h" for more information.
CLOCKS:
clocks Control and query clock information. "nvidia-smi clocks -h" for more information.
ENCODER SESSIONS:
encodersessions Displays device encoder sessions information. "nvidia-smi encodersessions -h" for more information.
FBC SESSIONS:
fbcsessions Displays device FBC sessions information. "nvidia-smi fbcsessions -h" for more information.
MIG:
mig Provides controls for MIG management. "nvidia-smi mig -h" for more information.
COMPUTE POLICY:
compute-policy Control and query compute policies. "nvidia-smi compute-policy -h" for more information.
BOOST SLIDER:
boost-slider Control and query boost sliders. "nvidia-smi boost-slider -h" for more information.
POWER HINT: power-hint Estimates GPU power usage. "nvidia-smi power-hint -h" for more information.
BASE CLOCKS: base-clocks Query GPU base clocks. "nvidia-smi base-clocks -h" for more information.
GPU PERFORMANCE MONITORING:
gpm Control and query GPU performance monitoring unit. "nvidia-smi gpm -h" for more information.
PCI:
pci Display device PCI information. "nvidia-smi pci -h" for more information.
Please see the nvidia-smi documentation for more detailed information.
Фактически, в большинстве случаев пользователи в основном озабочены выводом некоторой мониторинговой информации. Я исследовал два метода, которые кратко опишу ниже.
Прежде чем запрашивать варианты, давайте кратко поговорим о ключевых моментах, изложенных выше.
LIST OPTIONS
-L, --list-gpus Display a list of GPUs connected to the system.
Распечатать текущую систему GPUS。
Результаты выполнения следующие:
nvidia-smi -L
GPU 0: NVIDIA GeForce RTX 4060 Ti (UUID: GPU-XXXXX)
Опция запроса фактически отображает ключевые атрибуты запрашиваемого графического процессора и всех графических процессоров. Параметры опций запроса следующие:
QUERY OPTIONS:
-q, --query Display GPU or Unit info.
[plus any of]
-u, --unit Show unit, rather than GPU, attributes.
-i, --id= Target a specific GPU or Unit.
-f, --filename= Log to a specified file, rather than to stdout.
-x, --xml-format Produce XML output.
--dtd When showing xml output, embed DTD.
-d, --display= Display only selected information: MEMORY,
UTILIZATION, ECC, TEMPERATURE, POWER, CLOCK,
COMPUTE, PIDS, PERFORMANCE, SUPPORTED_CLOCKS,
PAGE_RETIREMENT, ACCOUNTING, ENCODER_STATS,
SUPPORTED_GPU_TARGET_TEMP, VOLTAGE, FBC_STATS
ROW_REMAPPER, RESET_STATUS
Flags can be combined with comma e.g. ECC,POWER.
Sampling data with max/min/avg is also returned
for POWER, UTILIZATION and CLOCK display types.
Doesn't work with -u or -x flags.
-l, --loop= Probe until Ctrl+C at specified second interval.
-lms, --loop-ms= Probe until Ctrl+C at specified millisecond interval.
Содержимого примерно несколько
-q Распечатать всю информацию -f Вывод в указанный файл, создайте, если недоступен -i Выберите указанный графический процессор, я имеет тип int, где значение i равно -L выше. ВыходGPU iсоответствующийGPU -x Вывод в виде XML-файла -d Содержание выбора выходных атрибутов примерно17атрибуты,вPOWER, UTILIZATION and CLOCKне может быть выведено какXML-файлилитакой же-uВывод вместе -l Контурный выход -lms С точностью до мс
если ты хочешь Распечатать всю информацию,Команда выглядит следующим образом:
nvidia-smi -q
Если вы хотите вывести результат в файл, команда выглядит следующим образом:
nvidia-smi -q -f "D:\test"
Если ты хочешь Вывод в виде XML-файла,Команда выглядит следующим образом:
nvidia-smi -q -x -f "D:\test.xml"
#Если вы хотите вывести его как вставку DTD
nvidia-smi -q -x --dtd -f "D:\test.xml"
Результаты вывода следующие (краткая выдержка):
<?xml version="1.0" ?>
<!DOCTYPE nvidia_smi_log SYSTEM "nvsmi_device_v12.dtd">
<nvidia_smi_log>
<timestamp>Tue Jan 16 21:23:03 2024</timestamp>
<driver_version>537.70</driver_version>
<cuda_version>12.2</cuda_version>
<attached_gpus>1</attached_gpus>
<gpu id="00000000:01:00.0">
<product_name>NVIDIA GeForce RTX 4060 Ti</product_name>
<product_brand>GeForce</product_brand>
Если вы хотите выбрать для печати нулевой блок информации о графическом процессоре:
nvidia-smi -q -i 0
Если вы хотите печатать каждые 10 секунд,
nvidia-smi -q -i 0 -l 10
Если вы хотите печатать каждые 100 мс, команда выглядит следующим образом:
nvidia-smi -q -i 0 -lms 100
Если вы хотите указать определенный атрибут для печати и получить только значение определенного атрибута, пример выглядит следующим образом:
nvidia-smi -q -i 0 -d MEMORY
Результаты вывода следующие:
==============NVSMI LOG==============
Timestamp : Tue Jan 16 21:35:49 2024
Driver Version : 537.70
CUDA Version : 12.2
Attached GPUs : 1
GPU 00000000:01:00.0
FB Memory Usage
Total : 8188 MiB
Reserved : 225 MiB
Used : 790 MiB
Free : 7172 MiB
BAR1 Memory Usage
Total : 8192 MiB
Used : 1 MiB
Free : 8191 MiB
Conf Compute Protected Memory Usage
Total : N/A
Used : N/A
Free : N/A
nvidia-smi -q -i 0 -d UTILIZATION
Вывод следующий:
==============NVSMI LOG==============
Timestamp : Tue Jan 16 21:37:08 2024
Driver Version : 537.70
CUDA Version : 12.2
Attached GPUs : 1
GPU 00000000:01:00.0
Utilization
Gpu : 4 %
Memory : 4 %
Encoder : 0 %
Decoder : 0 %
JPEG : 0 %
OFA : 0 %
GPU Utilization Samples
Duration : 14.27 sec
Number of Samples : 71
Max : 15 %
Min : 3 %
Avg : 5 %
Memory Utilization Samples
Duration : 14.27 sec
Number of Samples : 71
Max : 10 %
Min : 1 %
Avg : 3 %
ENC Utilization Samples
Duration : 14.27 sec
Number of Samples : 71
Max : 0 %
Min : 0 %
Avg : 0 %
DEC Utilization Samples
Duration : 14.27 sec
Number of Samples : 71
Max : 0 %
Min : 0 %
Avg : 0 %
nvidia-smi -q -i 0 -d PIDS
Результаты вывода следующие (результаты немного велики и перечислены только 2 процесса):
==============NVSMI LOG==============
Timestamp : Tue Jan 16 21:38:01 2024
Driver Version : 537.70
CUDA Version : 12.2
Attached GPUs : 1
GPU 00000000:01:00.0
Processes
GPU instance ID : N/A
Compute instance ID : N/A
Process ID : 1724
Type : C+G
Name :
Used GPU Memory : Not available in WDDM driver model
GPU instance ID : N/A
Compute instance ID : N/A
Process ID : 3200
Type : C+G
Name : C:\Program Files\WindowsApps\Microsoft.StorePurchaseApp_12008.1001.1.0_x64__8wekyb3d8bbwe\StoreExperienceHost.exe
Used GPU Memory : Not available in WDDM driver model
GPU instance ID : N/A
Compute instance ID : N/A
Process ID : 3292
Type : C+G
Name : E:\Program Files\Typora\Typora.exe
Used GPU Memory : Not available in WDDM driver model
GPU instance ID : N/A
Compute instance ID : N/A
Process ID : 4616
Type : C+G
Name : C:\Program l
nvidia-smi -q -i 0 -d COMPUTE
nvidia-smi -q -i 0 -d TEMPERATURE
Вывод следующий:
==============NVSMI LOG==============
Timestamp : Tue Jan 16 21:39:58 2024
Driver Version : 537.70
CUDA Version : 12.2
Attached GPUs : 1
GPU 00000000:01:00.0
Temperature
GPU Current Temp : 29 C
GPU T.Limit Temp : 53 C
GPU Shutdown T.Limit Temp : -7 C
GPU Slowdown T.Limit Temp : -2 C
GPU Max Operating T.Limit Temp : 0 C
GPU Target Temperature : 83 C
Memory Current Temp : N/A
Memory Max Operating T.Limit Temp : N/A
Если вы хотите указать некоторые атрибуты, вы можете передать ,соединить,Например MEMORY,TEMPERATURE,UTILIZATION,PIDS,в Команда выглядит следующим образом:
nvidia-smi -q -i 0 -d MEMORY,UTILIZATION,PIDS,TEMPERATURE
Результаты вывода следующие (PIDS сохраняет только один элемент, который слишком велик):
==============NVSMI LOG==============
Timestamp : Tue Jan 16 21:43:17 2024
Driver Version : 537.70
CUDA Version : 12.2
Attached GPUs : 1
GPU 00000000:01:00.0
FB Memory Usage
Total : 8188 MiB
Reserved : 225 MiB
Used : 784 MiB
Free : 7178 MiB
BAR1 Memory Usage
Total : 8192 MiB
Used : 1 MiB
Free : 8191 MiB
Conf Compute Protected Memory Usage
Total : N/A
Used : N/A
Free : N/A
Utilization
Gpu : 7 %
Memory : 6 %
Encoder : 0 %
Decoder : 0 %
JPEG : 0 %
OFA : 0 %
GPU Utilization Samples
Duration : 14.17 sec
Number of Samples : 71
Max : 12 %
Min : 3 %
Avg : 4 %
Memory Utilization Samples
Duration : 14.17 sec
Number of Samples : 71
Max : 20 %
Min : 3 %
Avg : 5 %
ENC Utilization Samples
Duration : 14.17 sec
Number of Samples : 71
Max : 0 %
Min : 0 %
Avg : 0 %
DEC Utilization Samples
Duration : 14.17 sec
Number of Samples : 71
Max : 0 %
Min : 0 %
Avg : 0 %
Temperature
GPU Current Temp : 29 C
GPU T.Limit Temp : 53 C
GPU Shutdown T.Limit Temp : -7 C
GPU Slowdown T.Limit Temp : -2 C
GPU Max Operating T.Limit Temp : 0 C
GPU Target Temperature : 83 C
Memory Current Temp : N/A
Memory Max Operating T.Limit Temp : N/A
Processes
GPU instance ID : N/A
Compute instance ID : N/A
Process ID : 1724
Type : C+G
Name :
Used GPU Memory : Not available in WDDM driver model
GPU instance ID : N/A
Compute instance ID : N/A
Process ID : 3200
Type : C+G
Name : C:\Program Files\WindowsApps\Microsoft.StorePurchaseApp_12008.1001.1.0_x64__8wekyb3d8bbwe\StoreExperienceHost.exe
Used GPU Memory : Not available in WDDM driver model
GPU instance ID : N/A
Compute instance ID : N/A
Process ID : 3292
Type : C+G
Name : E:\Program Files\Typora\Typora.exe
Used GPU Memory : Not available in WDDM driver model
GPU instance ID : N/A
Compute instance ID : N/A
Process ID : 4616
Type : C+G
Name : C:\Program
Name :
В этом случае, если вы хотите выполнить исторический мониторинг GPU-0, выполните мониторинг MEMORY,TEMPERATURE,UTILIZATION,PIDSЭти свойства,5sдлина одного шага,Команду можно задать так:
nvidia-smi -q -i 0 -d MEMORY,UTILIZATION,TEMPERATURE,PIDS -l 5 -f "D:/monitor.log"
Но разбор файла придётся делать самостоятельно.
Лично я все еще предпочитаю это SELECTIVE QUERY OPTIONS,в Детализация запроса относительно подробная.,Это также удобнее,Приведенный выше запрос также относительно прост.。Ниже рассказывается оSELECTIVE QUERY OPTIONSнекоторые команды:
SELECTIVE QUERY OPTIONS:
Allows the caller to pass an explicit list of properties to query.
[one of]
--query-gpu Information about GPU.
Call --help-query-gpu for more info.
--query-supported-clocks List of supported clocks.
Call --help-query-supported-clocks for more info.
--query-compute-apps List of currently active compute processes.
Call --help-query-compute-apps for more info.
--query-accounted-apps List of accounted compute processes.
Call --help-query-accounted-apps for more info.
This query is not supported on vGPU host.
--query-retired-pages List of device memory pages that have been retired.
Call --help-query-retired-pages for more info.
--query-remapped-rows Information about remapped rows.
Call --help-query-remapped-rows for more info.
[mandatory]
--format= Comma separated list of format options:
csv - comma separated values (MANDATORY)
noheader - skip the first line with column headers
nounits - don't print units for numerical
values
[plus any of]
-i, --id= Target a specific GPU or Unit.
-f, --filename= Log to a specified file, rather than to stdout.
-l, --loop= Probe until Ctrl+C at specified second interval.
-lms, --loop-ms= Probe until Ctrl+C at specified millisecond interval.
Общее содержание следующее:
--query-gpu Информация о графическом процессоре --query-supported-locks Часы, поддерживаемые графическим процессором --query-compute-apps обрабатывает информацию --query-accounted-apps / --query-retired-pages / --query-remapped-rows Графический расчет/страницы памяти устройства/сопоставление --format настройки формата вывода csv/noheader/nounits, разделенные запятыми/без первой строки/без отображения единиц измерения -i/-f/-l/-lms указывает графический процессор/выход как файл/цикл(ы)/цикл(мс)
Судя по тому, что было сказано в начале Использование памяти графического процессора и использование памяти графического процессора и информация, связанная с процессом, только сосредоточьтесь на --query-gpu
и --query-compute-apps
Эти два варианта,Следуйте подсказкамCall --help-query-gpu for more info
и --help-query-compute-apps
Получить дополнительную информацию。
Подробная информация выводится следующей командой:
nvidia-smi --help-query-gpu
Поскольку контента слишком много, я не буду его здесь публиковать. Вот несколько примеров:
Если вы хотите вывести gpu_name или имя, команда выглядит следующим образом:
nvidia-smi --query-gpu=gpu_name --format=noheader
Вывод следующий:
NVIDIA GeForce RTX 4060 Ti
Если вы хотите вывести свойства, связанные с температурой, соответствующими атрибутами являются:
"temperature.gpu"
Core GPU temperature. in degrees C.
"temperature.gpu.tlimit"
GPU T.Limit temperature. in degrees C.
"temperature.memory"
HBM memory temperature. in degrees C.
Команда выглядит следующим образом:
nvidia-smi --query-gpu=temperature.gpu,temperature.gpu.tlimit,temperature.memory --format=csv
Вывод следующий:
temperature.gpu, temperature.gpu.tlimit, temperature.memory
30, 53, N/A
Если вы хотите вывести некоторые свойства, связанные с видеопамятью, соответствующими свойствами являются:
"memory.total"
Total installed GPU memory.
"memory.reserved"
Total memory reserved by the NVIDIA driver and firmware.
"memory.used"
Total memory allocated by active contexts.
"memory.free"
Total free memory.
Команда выглядит следующим образом:
nvidia-smi --query-gpu=memory.total,memory.reserved,memory.used,memory.free --format=csv
Вывод следующий:
memory.total [MiB], memory.reserved [MiB], memory.used [MiB], memory.free [MiB]
8188 MiB, 225 MiB, 1032 MiB, 6930 MiB
Если первая строка не нужна,Команда выглядит следующим образом:
nvidia-smi --query-gpu=memory.total,memory.reserved,memory.used,memory.free --format=csv,noheader
Вывод следующий:
8188 MiB, 225 MiB, 1031 MiB, 6931 MiB
Если юниты не нужны, Команда выглядит следующим образом:
nvidia-smi --query-gpu=memory.total,memory.reserved,memory.used,memory.free --format=csv,noheader,nounits
Вывод следующий:
8188, 225, 1044, 6918
Если вы хотите вывести свойства, связанные с использованием видеокарты, соответствующие свойства будут следующими:
Section about utilization properties
Utilization rates report how busy each GPU is over time, and can be used to determine how much an application is using the GPUs in the system.
Note: On MIG-enabled GPUs, querying the utilization of encoder, decoder, jpeg, ofa, gpu, and memory is not currently supported.
"utilization.gpu"
Percent of time over the past sample period during which one or more kernels was executing on the GPU.
The sample period may be between 1 second and 1/6 second depending on the product.
"utilization.memory"
Percent of time over the past sample period during which global (device) memory was being read or written.
The sample period may be between 1 second and 1/6 second depending on the product.
"utilization.encoder"
Percent of time over the past sample period during which one or more kernels was executing on the Encoder Engine.
The sample period may be between 1 second and 1/6 second depending on the product.
"utilization.decoder"
Percent of time over the past sample period during which one or more kernels was executing on the Decoder Engine.
The sample period may be between 1 second and 1/6 second depending on the product.
"utilization.jpeg"
Percent of time over the past sample period during which one or more kernels was executing on the Jpeg Engine.
The sample period may be between 1 second and 1/6 second depending on the product.
"utilization.ofa"
Percent of time over the past sample period during which one or more kernels was executing on the Optical Flow Accelerator Engine.
The sample period may be between 1 second and 1/6 second depending on the product.
Команда выглядит следующим образом:
nvidia-smi --query-gpu=utilization.gpu,utilization.memory,utilization.encoder,utilization.decoder,utilization.jpeg,utilization.ofa --format=csv
Вывод следующий:
utilization.gpu [%], utilization.memory [%], utilization.encoder [%], utilization.decoder [%], utilization.jpeg [%], utilization.ofa [%]
23 %, 10 %, 0 %, 0 %, 0 %, 0 %
Среди них -f, -i.-l, -lms не объяснены, а метод использования такой же, как указано выше.
Подробные инструкции по командам для использования информации о процессах системы графического процессора приведены ниже:
nvidia-smi --help-query-compute-apps
List of valid properties to query for the switch "--query-compute-apps":
Section about Active Compute Processes properties
List of processes having compute context on the device.
"timestamp"
The timestamp of when the query was made in format "YYYY/MM/DD HH:MM:SS.msec".
"gpu_name"
The official product name of the GPU. This is an alphanumeric string. For all products.
"gpu_bus_id"
PCI bus id as "domain:bus:device.function", in hex.
"gpu_serial"
This number matches the serial number physically printed on each board. It is a globally unique immutable alphanumeric value.
"gpu_uuid"
This value is the globally unique immutable alphanumeric identifier of the GPU. It does not correspond to any physical label on the board.
"pid"
Process ID of the compute application
"process_name" or "name"
Process Name
"used_gpu_memory" or "used_memory"
Amount memory used on the device by the context. Not available on Windows when running in WDDM mode because Windows KMD manages all the memory not NVIDIA driver.
Связанный Команда выглядит следующим образом:
nvidia-smi --query-compute-apps=timestamp,gpu_name,gpu_bus_id,gpu_serial,gpu_uuid,pid,process_name,used_gpu_memory --format=csv
Вывод следующий (сохраняется только 3 процесса):
timestamp, gpu_name, gpu_bus_id, gpu_serial, gpu_uuid, pid, process_name, used_gpu_memory [MiB]
2024/01/16 22:40:15.735, NVIDIA GeForce RTX 4060 Ti, 00000000:01:00.0, [N/A], GPU-3fd9292f-3024-fbdb-4596-5c5560b91654, 1724, [Insufficient Permissions], [N/A]
2024/01/16 22:40:15.735, NVIDIA GeForce RTX 4060 Ti, 00000000:01:00.0, [N/A], GPU-3fd9292f-3024-fbdb-4596-5c5560b91654, 11116, C:\Windows\SystemApps\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\StartMenuExperienceHost.exe, [N/A]
2024/01/16 22:40:15.735, NVIDIA GeForce RTX 4060 Ti, 00000000:01:00.0, [N/A], GPU-3fd9292f-3024-fbdb-4596-5c5560b91654, 8584, C:\Windows\explorer.exe, [N/A]
2024/01/16 22:40:15.735, NVIDIA GeForce RTX 4060 Ti, 00000000:01:00.0, [N/A], GPU-3fd9292f-3024-fbdb-4596-5c5560b91654, 11956, C:\Program Files\WindowsApps\Microsoft.YourPhone_1.22022.147.0_x64__8wekyb3d8bbwe\YourPhone.exe, [N/A]
2024/01/16 22:40:15.735, NVIDIA GeForce RTX 4060 Ti, 00000000:01:00.0, [N/A], GPU-3fd9292f-3024-fbdb-4596-5c5560b91654, 15612, [Insufficient Permissions], [N/A]
Отображаются временная метка, модель графического процессора, bus_id, серийный номер, uuid, pid, имя процесса и объем памяти, используемый процессом.
Примечание: только one --query-* switch can be used at a time.Эти команды запросатакой же Одновременно можно использовать только один。
Пожалуйста, обратите внимание на версию, использованную в этом сообщении блога.,В командах, соответствующих разным версиям, могут быть некоторые различия.,может быть основано на-h
Команда для запроса подробного использования。В этом сообщении блога представлены только мои взгляды наnvidia-smiпонимание и использование,Если неттакой же Мнения и советы приветствуются。Следующий превью поста в блоге будет посвященоpython http://pypi.python.org/pypi/nvidia-ml-py/Как пользоваться и звонить。