This recipe demonstrates the usage of Intel® VTune™ Profiler server in High Performance Computing (HPC) clusters for interactive performance profiling or accessing performance data for scheduled jobs.
Typically, nodes in HPC clusters do not have any GUI context. This can cause inconveniences when using VTune Profiler for performance analysis. Users in HPC clusters either have to rely on command-line reports or have to the transfer the result files out of the cluster to view them on other machines using the desktop VTune Profiler GUI.
This recipe aims to eliminate these inconveniences by offering a better workflow. Starting with VTune Profiler version 2021.1.1, you can launch VTune Profiler as a server inside the HPC cluster and view the results remotely with the full-featured GUI, requiring nothing more than a machine that can run a modern web browser.
Intel® DevCloud for oneAPI is used as an example in this recipe, but this workflow is valid for any other HPC cluster or similar environment.
Content experts: Stas Neverov
Here are the environment and software tools that you need:
After you complete this setup, you will be able to:
For both cases, you do not need to install anything on your client system. You only need a web browser to access the VTune Profiler GUI.
In this scenario, you run VTune Profiler server on a compute node inside an HPC cluster and access the VTune Profiler GUI via a web browser on your laptop. This usage model is somewhat similar to using VTune Profiler desktop GUI via VNC, but it is easier to set up and provides a better user experience.
This figure illustrates the setup for this scenario:
Follow these steps to enable this workflow:
ssh devcloud
qsub -I
vtune-backend --enable-server-profiling --data-directory=~/intel/vtune/projects
VTune Profiler server outputs a string like this:
Serving GUI at https://127.0.0.1:42277?one-time-token=456e20b6dcaad209ea2157744c1dc6c5
Take note of the port number, compute node name, and the URL. You will need this information for the next steps.
ssh -L 127.0.0.1:42277:127.0.0.1:42277 devcloud
ssh -L 127.0.0.1:42277:127.0.0.1:42277 s000-n000
When you open the VTune Profiler GUI, your web browser will prompt you about the VTune Profiler server self-signed certificate. You can proceed safely without installing the certificate, because the SSH tunnel provides protection from Man-in-the-Middle (MitM) attacks. For more information on transport security, see the Set Up Transport Security topic.
When you run VTune Profiler server for the first time, the URL that it prints should contain a one-time-token. When you open this URL in a browser, VTune Profiler server prompts you to set a passphrase. Other users cannot access your VTune Profiler server without the passphrase. The hash of the passphrase is persisted on the server in your user home directory. Also, your browser stores a secure HTTP cookie, so that you do not need to enter the passphrase each time you open the VTune Profiler web GUI.
Once you set the passphrase, the VTune Profiler Welcome screen opens.
VTune Profiler automatically opens the Configure Analysis dialog.
Your compute node that is running the VTune Profiler server is selected as the target system by default.
Once the analysis completes, VTune Profiler opens the Summary tab of the analysis result.
In this scenario, you collect performance data for scheduled jobs using the VTune Profiler command-line interface, and then serve these results by running VTune Profiler server inside the cluster. You can then access the results on your laptop via a web browser.
This figure illustrates the setup for this scenario:
Follow these steps to enable this workflow:
ssh devcloud
echo vtune -collect hotspots \
-r ~/intel/vtune/projects/demo/matrix/hotspots01 \
-- /opt/intel/oneapi/vtune/latest/samples/en/C++/matrix/matrix \
> ~/run_with_vtune.sh
The -r ~/intel/vtune/projects/demo/matrix/hotspots01 option defines where the collected VTune Profiler result will be stored. You can change this location, but, when you start VTune Profiler server at a later step, it should point to some parent folder of this location, e.g. ~/intel/vtune/projects.
qsub ./run_with_vtune.sh
The sample matrix application will take about a minute to complete. Your real-life HPC jobs could take hours to complete. You do not need to wait for the job to complete and can resume this flow the next day—your VTune Profiler results will be waiting for you in the specified location.
qsub -I
vtune-backend --data-directory=~/intel/vtune/projects
The --data-directory=~/intel/vtune/projects should refer to some parent folder of the result folder that you specified in step 4.
VTune Profiler server outputs a string like this:
Serving GUI at https://127.0.0.1:42277?one-time-token=456e20b6dcaad209ea2157744c1dc6c5
Take note of the port number, compute node name, and the URL. You will need this information for the next steps.
ssh -L 127.0.0.1:42277:127.0.0.1:42277 devcloud
ssh -L 127.0.0.1:42277:127.0.0.1:42277 s000-n000
When you open the VTune Profiler GUI, your web browser will prompt you about the VTune Profiler server self-signed certificate. You can proceed safely without installing the certificate, because the SSH tunnel provides protection from Man-in-the-Middle (MitM) attacks. For more information on transport security, see the Set Up Transport Security topic.
When you run VTune Profiler server for the first time, the URL that it prints should contain a one-time-token. When you open this URL in a browser, VTune Profiler server prompts you to set a passphrase. Other users cannot access your VTune Profiler server without the passphrase. The hash of the passphrase is persisted on the server in your user home directory. Also, your browser stores a secure HTTP cookie, so that you do not need to enter the passphrase each time you open the VTune Profiler GUI.
Once you set the passphrase, the VTune Profiler Welcome screen opens.
You should see a demo/matrix/hotspots01 result in the Project Navigator panel. Double-click this result to open it.
warn: Server access is limited to localhost only. To enable remote access restart with --allow-remote-access.
Because the usage models described above use SSH port forwarding, you do not need to enable --allow-remote-access. Incoming connections to the VTune Profiler server come from the SSH server, and thus are essentially localhost connections.
If you enable the --allow-remote-access option, VTune Profiler server builds a URL with the real network card IP address or FQDN name, which may not be accessible from your client machine.