3 minute read

NVIDIA Visual Profiler has been discontinued in favor of the NSight Compute suite, which does not support older GPUs (so… NVIDIA, f-u!). Having to use a venerable, but still viable GTX 1050 for a course, I had to try and get the older Visual Profiler up and running.

NVIDIA Visual Profiler

NVIDIA Visual Profiler (NVVP) is a GUI application written in Java1 that can be used to perform automated analysis of performance data exported by the nvprof tool.

nvvp-splash

Nothing screams «corporate software» like a good splash screen!

NVIDIA still hosts the NVVP homepage, but the tool has been discontinued.

Here’s an overview of what you can do with nvprof (and, by extension, NVVP): CUDA Pro Tip: nvprof is Your Handy Universal GPU Profiler.

Getting nvprof running

The nvprof tool is part of the CUDA toolkit. I have been given access (thanks, EmaPe) to a server where the latest version of the CUDA toolkit had already been installed.

To get it working, I had to ask an administrator to follow this procedure, as I didn’t have the right permissions to access the GPU’s performance counters.

Here’s what nvprof reports:

remote$ nvprof -V
nvprof: NVIDIA (R) Cuda command line profiler
Copyright (c) 2012 - 2023 NVIDIA Corporation
Release version 12.3.101 (21)

Getting NVVP running

I tried running NVVP directly on the remote host with ssh -X, but it failed due to a Java error I later learned to be caused by the fact that NVVP won’t run on a JDK newer than 1.8.0.

This left me with the necessity to install NVVP locally, which meant locating the appropriate packages.

The Ubuntu route

Apparently, NVVP is still provided by Ubuntu in their repositories. Since I have an Ubuntu VM lying around, I decided to give it a try.

I was able to get NVVP running but it turns out it’s never been updated to the latest version, so it can’t import the capture files generated by my version of nvprof.

Installing on Fedora 38

By pure luck I stumbled across the old NVIDIA CUDA toolkit repository, from where I was able to download the appropriate version of the packages for my system.

  1. Write down the nvprof version, this will be necessary to download the correct packages. In my case, this is 12.3.101.
  2. Navigate to https://developer.download.nvidia.com/compute/cuda/repos/fedora37/x86_64/. This will differ if you use another distro.
  3. Download the appropriate version of the following packages:
    • cuda-nvprof
    • cuda-nvvp
    • cuda-nvdisasm
    • cuda-cupti
  4. Install all of the above. I decided to ignore dependencies, as NVVP depends on Java 1.7.0 and I won’t be installing it anyway.
    • rpm -ivh --nodeps cuda-*.rpm
  5. Install Java 8 with dnf install -y java-1.8.0-openjdk, then use alternatives --config java to select Java 1.8.0 as the default JRE.
  6. Run /usr/local/cuda-12.3/bin/nvvp.
  7. Profit.

Now you should be able to import files generated by nvprof without NVVP complaining about a version mismatch!

Using NVVP

NVVP can bse used to profile a program directly or to interactively analyze performance data captured by nvprof.

Remote connection

Technically, a local installation of NVVP should be able to connect to a remote host, but I wasn’t able to get it working (I guess due to an outdated ssh client cipher).

nvprof files

nvprof can be used from the command line to generate performance data capture files that can be imported and analyzed by NVVP. In order to do so, you must use the correct nvprof options. I did the following:

remote$ nvprof -f --analysis-metrics --export-profile capture.nvprof ./my_cuda_app

The -f flag allows you to overwrite existing capture files, while the --analysis-metrics option is used to generate a file that contains all of the metrics necessary for guided analysis.

Once the file has been generated, you can copy it to your machine and import it into NVVP, then start analyzing it.

  1. It’s the $n$-th commercial tool based on that steaming pile of garbage we call Eclipse, FYI.