Linux monitors video card usage and linux monitors video card usage
When using GPU for computing, such as running Deep Learning code, we may want to be able to detect the usage of video memory in real time, But Linux generally does not have to monitor existing tools. Nvidia comes with an nvidia-smi command line tool that displays the usage of the video memory, but we cannot enter this command every 10 s. In this case, you need to use the watch command.
Watch command Introduction
What does watch do? Let's see what the system says.
1 $ whatis watch2 watch (1)-execute a program periodically, showing output fullscreen
The function is clear. Execute a command periodically and display the output in full screen.
The basic usage of watch is
1 watch [options] command
The most common parameter is-n, which is followed by the number of seconds to run the command.
Monitor video memory
We set to display the video memory every 10 s.
Watch-n 10 nvidia-smi
The result is as follows:
Still very clear
Let Linux tell jokes and Tang poetry?
The small software fortune will randomly say a proverb, famous saying, movie lines and so on each execution. Of course, they are all in English.
Similarly, fortune-zh displays a Tang poem each time it is executed.
If you have free time, you can ask Linux to talk about Tang poetry.
Watch-n 30 fortune-zh