Nvidia GPU Monitoring Tools

This topic has already been partly discussed (Thread getting-more-information-about-the-gpu-and-libraries-loaded.80906), but for fellow users with a dedicated Nvidia GPU, I wanted to share my experience with the various GUI and CLI monitoring tools that I find useful as well as instructions on how to install them. This is my first attempt at a guide of this type, so please be forgiving of any errors or imperfections!

I am running 13.2-RELEASE with Nvidia Driver v525.116.03 and a Nvidia GTX 1660Ti, but these should work on any reasonably recent OS version and card.

Currently, I use four different CLI and GUI tools to monitor GPU usage:
  1. nvidia-smi - installed with Nvidia driver (x11/nvidia-driver)
  2. nvidia-settings (x11/nvidia-settings)
  3. nvtop - compiled from source, see below
  4. nvitop - Python package installable using devel/py-pip
Each of these has its own pros and cons, which I'll describe in the sections below.

nvidia-settings
x11/nvidia-settings has quite a few useful features, but as a GUI app, it is not really suitable as a monitoring tool for remote servers.

nvidia-smi
The ordinary behaviour of nvidia-smi is to output GPU info only once upon invocation, which is not ideal for continuous monitoring. In my case, the -l flag, which is intended to serve as a kind of solution for this, caused the output to print repeatedly to the console. Therefore, I've found it's better to combine nvidia-smi with misc/gnu-watch, e.g.:
Code:
gnu-watch -n 0.5 nvidia-smi

nvtop
The current version of nvtop, my usual go-to tool for monitoring Nvidia GPUs on Linux (partly because of its obvious similarities to htop), does not compile on FreeBSD. Adding support for AMD GPUs in recent versions entailed introducing Linuxisms to the code (e.g., the kcmp syscall - see https://github.com/Syllo/nvtop/issues/159). Through some trial and error, I found that I could compile on my system after checking out commit 39db844. Per-process RAM and CPU usage are not displayed because of some assumptions about the structure of Linux /proc/*/stat files, but otherwise everything functions as expected. Note that procfs must be enabled. Maybe it would be possible to re-write parts of it against libprocstat(3)() (if that would be the right approach?), but I current do not have the time and probably also not the expertise to attempt this.

nvitop
nvitop also outputs a very information-rich and configurable TUI, albeit without nvtop's visual similarity with htop. Though I believe nvitop was originally developed for Linux, I have experienced no compatibility issues with the FreeBSD Nvidia driver. It may well be the most complete GPU monitoring tool that works "off-the-shelf" on FreeBSD.

Hope this is maybe helpful for someone, and will be glad to answer any questions that might come up.
 
Howdy

Thanks for the very helpful information.
Since you have extended knowledge with Nvidia cards, I have a question:

I want to use FreeBSD-14 with Nvidia GPU Quadro K4000 to create videos in Kdenlive.
In gerneral, it works.

The problem I have is, that the GPU acceleration is not recognized in Kdenlive by the setup-wizzard.
If I do "nvidia-smi" in the shell, I see that the GPU is working perfectly.
Is there an additional driver missing?

Thanks for any hint.
 
Hi, it has been a few months since I checked this post so I apologize for the delay and hope that maybe I can still help.

I don't know about multimedia/kdenlive specifically, but a lot of video encoding/decoding software uses VA-API for hardware acceleration.

Have you checked out multimedia/libvdpau, multimedia/libva-vdpau-driver, multimedia/libvdpau-va-gl?

Unfortunately, the Nvidia FreeBSD driver is missing some features from the Linux Nvidia driver such as nvenc or CUDA. In that case you can use the Linux ABI (Linuxulator), ideally a with debootstrap environment, making sure that the installed Linux Nvidia driver/libraries version matches the FreeBSD one.
 
As an aside, here is another GUI tool for Nvidia monitoring:
5. qnvsm (compiles with Qt and runs on Nvidia systems:)
 
Back
Top