NVTOP with DGX Spark unified memory support

For those interested, they’ve added support for DGX Spark’s unified memory to nvtop. It’s not available in a release yet, but for those interested, I built it and attached the binaries, simply extract them to a directory on your path and make sure you have no other copies of nvtop installed.

Alternatively you can just build the latest code yourself. I had to install the following dependencies to get it built:

sudo apt-get install libncurses5-dev libncursesw5-dev

Also, for some reason it kept wanting to add in AMD and every other GPU support even with me passing the command line flags to exclude them, so I ended up editing the CMakeLists.txt file to turn off anything that’s not NVIDIA related. Other than that it was a fairly straightforward build.

It is a little weird in that it only shows GPU memory, by that I mean, anything allocated by the CPU is excluded from the displayed figures in nvtop, so your total VRAM keeps changing based on what your CPU has already allocated, which I guess makes sense as nvtop is meant to show GPU memory only, not system memory, still, I did find that a bit strange, but it’s fine once you get used to it…

nvtop_for_dgx_spark.zip (58.6 KB)

5 Likes

Super helpful, tyvm for sharing!

1 Like

Works great. I hope you’re not a spy.

1 Like

I was also able to build it locally. Steps below:

git clone https://github.com/Syllo/nvtop.git
cd nvtop
mkdir -p build
cd build
sudo apt-get update
sudo apt-get install libncurses5-dev libncursesw5-dev
cmake .. -DNVIDIA_SUPPORT=ON -DAMDGPU_SUPPORT=OFF -DINTEL_SUPPORT=OFF -DV3D_SUPPORT=OFF -DMSM_SUPPORT=OFF -DPANFROST_SUPPORT=OFF -DPANTHOR_SUPPORT=OFF -DMETAX_SUPPORT=OFF

make

your nvtop binary will be on nvtop/build/src dir

OPTIONALLY, you can also make install, to make it available system wide.

2 Likes

You also need to install libdrm-dev to avoid compilation errors without editing CMakeLists.txt:

sudo apt install libdrm-dev

I didn’t need that, but updated the instructions.

I’m just a software engineer that likes monitoring things in nvtop.

3 Likes

Personally speaking, I don’t see the point to install all those libraries and build with support for every GPU architecture, when we know for a fact we’ll only ever need NVIDIA support on the Spark. It just doubles the size of the binary and adds a bunch of logic for GPUs we’ll never need. I’d recommend, if people want to build it themselves, just disable all the other GPU architectures in the CMake file and make it a minimal build that just targets the DGX Spark’s architecture.

very cool RazielAU.

1 Like

Just added the other cases. Now the image has the same size of yours. Just added the instructions because sharing binaries is not a good practice.

I’m in favour of people building it themselves, hence why I included basic instructions in my original post, but I don’t see sharing binaries as a bad thing, most software is distributed as binaries. As a simple example, someone is working on getting Blender 5 working on the Spark, I think that’s really awesome, but I’d much rather have a binary of that, than having to build it myself.

1 Like

Ive been using GitHub - XuehaiPan/nvitop: An interactive NVIDIA-GPU process viewer and beyond, the one-stop solution for GPU process management. its pretty nice too

That looks pretty nice based on the GitHub page, have you got a screenshot of it running on the Spark? Just want to see what info it can pull from the Spark before I make a decision.

nvitop shows system (total) memory correctly, along with its usage and graph over time. But the GPU MEM graph is shown as N/A - no graph, no numbers. I’ve opened a ticket with them.

Many of these tools made assumptions about the memory split. Now that unified memory becomes more common, those assumptions are no longer always true.