1. Display current GPU usage
Nvidia has a Nvidia-smi command-line tool that displays video memory usage:
$ nvidia-smi
1 1
Output:
2. Periodic output GPU usage
But sometimes we want to not only know the GPU usage at that fixed moment, we want to keep it going, we want to output periodically, like updating the display every 10s. At this point, you need to use the Watch command to periodically execute the NVIDIA-SMI command.
Learn about the watch features:
$ whatis Watch
Watch (1) -Execute a program periodically, showing output fullscreen
1 2 1 2
Function: Periodically executes a command and displays the output.
The basic usage of watch is:
$ watch [options] command
1 1
The most commonly used parameter is-n, followed by how many seconds to execute a command.
Monitoring memory: We set the video memory for every 10s display:
$ watch-n Nvidia-smi
1 1
The display is as follows:
This way, as long as the command line window, you can refresh every 10 seconds, is not very convenient.
If we want to perform other command-line operations periodically, then we can simply replace the rear nvidia-smi, so cool!
Reprint Address: http://blog.csdn.net/jasonzzj/article/details/52649174
The following are as follows: The main parameters are temperature, memory usage, GPU share, as shown in the red box.
Reprint Address: http://blog.csdn.net/vbskj/article/details/52194372