When using TensorFlow for deep learning, insufficient video memory often occurs, so we hope to be able to check the GPU usage at any time. If you have an Nvidia GPU, you can do it with just one line of command on the command line. 1. Display current GPU usage Nvidia comes with a command line tool called nvidia-smi, which displays video memory usage: $ nvidia-smi Output: 2. Periodically output GPU usage But sometimes we want to know not only the GPU usage at a fixed moment, but also its trend. In this case, we want to output it periodically, such as updating the display every 10 seconds. At this time, you need to use the watch command to periodically execute the nvidia-smi command. Understand the functions of watch: $ whatis watch watch(1) - execute a program periodically, showing output fullscreen Function: Execute a command periodically and display the output. The basic usage of watch is: $ watch [options] command The most commonly used parameter is -n, which specifies how many seconds to execute the command. Monitor video memory: We set it to display the video memory status every 10 seconds: $ watch -n 10 nvidia-smi The display is as follows: In this way, as long as the command line window is open, you can refresh it every ten seconds. Isn’t it convenient? If we want to periodically perform other command line operations, we can simply replace the following nvidia-smi. So Cool ! The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Summary of Mysql common benchmark commands
>>: How to calculate the frame rate FPS of web animations
Preface The method of configuring IP addresses in...
Disk quota is the storage limit of a specified di...
Ping www.baidu.com unknown domain name Modify the...
Detailed explanation of Linux LVM logical volume ...
It is very simple to build a go environment under...
<br />Tips for making web table frames. ----...
Table of contents 1. Array deconstruction 2. Obje...
1. What is Refs is called Resilient File System (...
Table of contents Listener 1.watchEffect 2.watch ...
1. The ul tag has a padding value by default in Mo...
1. MySQL's own stress testing tool - Mysqlsla...
Now 2016 server supports multi-site https service...
Table of contents Scenario Try to solve solve Sce...
After installing a centos8 service under vmware a...
1. Install Apache $ sudo apt update && su...