CLI-based Linux Task Managers for CPU and GPU monitoring: A Brief Overview

If you are a Linux user, you may be familiar with the concept of task managers. These are tools that allow you to monitor and manage the processes running on your system, such as CPU or GPU usage, memory consumption, disk I/O, network activity, and more. Task managers can help you identify and troubleshoot performance issues, optimize resource allocation, and kill unwanted or unresponsive processes.

CLI-based Linux Task managers for GPU monitoring

There are many task managers available for Linux users, both graphical and command-line based. In this post, we will focus on some of the best CLI-based Linux task managers that you can use on your terminal without loading a GUI. These tools are especially useful for server admins who need to access their systems remotely via SSH or for users who prefer a minimalist and efficient approach.

CLI-based Linux task managers for CPU monitoring

  • top: This is one of the most common and widely used task managers for Linux. It comes preinstalled on almost all Linux distributions and provides a real-time overview of your system's processes, sorted by CPU usage by default. You can also sort by other criteria such as memory usage or process ID (PID). You can use various keyboard commands to interact with the top, such as changing the refresh interval (s), toggling color mode (z), filtering processes by the user (u), or killing a process (k). You can also adjust the priority (niceness) of running processes with the renice command.

  • htop: This is an enhanced version of top that offers more features and functionality. It has a more user-friendly interface that displays additional information such as load average, uptime, swap usage, etc. It also supports mouse interaction and allows you to scroll horizontally and vertically through the list of processes. You can customize htop's appearance and behavior with various options such as hiding kernel threads (K), showing tree view (t), displaying CPU cores separately (1), etc. You can also use htop to perform actions on multiple processes at once by selecting them with spacebar and then pressing F9 to kill them or F7/F8 to change their niceness.

  • glances: This is a cross-platform task manager written in Python that uses open architecture to support custom plugins. It shows a comprehensive dashboard of your system's status, including CPU, memory, disk, network, sensors, file system, docker containers, processes, alerts, etc. You can switch between different views with keyboard shortcuts such as c for CPU view or m for memory view. You can also filter processes by name (/) or sort them by various criteria (+/-). Glances has several modes of operation such as standalone mode (-s), client-server mode (-c/-s), web server mode (-w), or curses mode (-C).

  • atop: This is another advanced task manager that monitors your system's resources and logs them for later analysis. It shows detailed information about your system's components such as CPU type, frequency scaling governor,cache size,memory configuration,disk layout,network interfaces,etc.It also displays per-process statistics such as resource consumption, open files, network connections, etc. You can use atop to compare current data with historical data using keys like t/T for time travel or b/B for backward/forward browsing. You can also use atop to detect anomalies or bottlenecks in your system's performance using keys like g/G for global/local problems or z/Z for zooming in/out.
CLI-based Linux task managers for CPU monitoring


CLI-based Linux Task managers for GPU monitoring

  • nvtop: This is a top-like tool that shows information about Nvidia GPUs using the NVIDIA Management Library (NVML). It displays statistics such as GPU name, temperature, fan speed, memory usage, power consumption, utilization rates, processes running on the GPU, and more. It also has a graphical mode that shows graphs of some metrics over time. You can install nvtop from your distribution's repositories or compile it from the source.
  • gpustat: This is a simple tool that shows information about Nvidia GPUs using NVML or nvidia-smi (a command-line utility that comes with Nvidia drivers). It displays statistics such as GPU name, index number (useful for CUDA applications), temperature, fan speed, memory usage (total and free), utilization rates (GPU and memory), power consumption (drawn and limit), processes running on the GPU (PID and name), CUDA version installed on each device. You can install gpustat using pip (pip install gpustat) or clone it from GitHub.
  • s-tui: This is a terminal user interface tool that shows information about your CPU frequency, temperature, utilization, power consumption, and more. It also supports showing information about AMD GPUs using rocm-smi (a command-line utility that comes with ROCm drivers). It displays statistics such as GPU name, temperature, fan speed, memory usage, power consumption, utilization rates, clock speeds, voltage levels. You can install s-tui using pip (pip install s-tui) or clone it from GitHub.

These are just some examples of CLI-based Linux task managers that you can use on your terminal. There are many more tools available that cater to different needs and preferences. Some other notable ones include nmon, iotop , dstat , bashtop , bpytop , etc.

CLI-based Linux task managers are powerful and versatile tools that can help you monitor and manage your system's processes efficiently and effectively without relying on a GUI.  They consume fewer system resources and load much faster than graphical ones and offer more flexibility and customization options. If you are a server admin or a user who likes command-line tools, you should definitely give them a try!

Next Post Previous Post
No Comment
Add Comment
comment url