Using
Intel® VTune™
Profiler Server with Visual Studio Code and Intel® DevCloud for oneAPI (NEW)
Intel® VTune™
Server with Visual Studio Code and Intel® DevCloud for oneAPI (NEW) Profiler
This recipe demonstrates how you use
Intel® VTune™
as a web server when you develop and tune performance on a remote development machine. As an example, we use a compute node at Intel® DevCloud for oneAPI for a remote machine.
Profiler
Ingredients
Here are the hardware and software tools you need:
- Starting with the 2020 release, Intel® VTune™ Amplifier has been renamed toIntel® VTune™.Profiler
- Most recipes in theIntel® VTune™Performance Analysis Cookbook are flexible. You can apply them to different versions ofProfilerIntel® VTune™. In some cases, minor adjustments may be required.Profiler
- Get the latest version ofIntel® VTune™:Profiler
- From theIntel® VTune™product page.Profiler
- Download the latest standalone package from the Intel® oneAPI standalone components page.
Setup Overview
With v2021.1.1 and newer versions, you can run
Intel® VTune™
as a server and access it remotely using a web browser. This setup is useful when you develop applications on a remote system.
Profiler
- You can runIntel® VTune™on the system where you do development, so it has direct access to the binaries, debug info, and source files.Profiler
- Intel® VTune™also stores the collected traces and processed data on the same system so you do not have to transfer this heavy data to your client system for analysis.Profiler
- You do not need to install anything on your client system. You only need a web browser to access theIntel® VTune™GUI.Profiler
This figure illustrates the setup for this scenario:

Option 1: Use
Intel® VTune™
Profiler Server for Remote Development with Visual Studio Code
Intel® VTune™
Server for Remote Development with Visual Studio Code Profiler
- Log into Intel® DevCloud for oneAPI.
- Set up the VS Code connection. When you complete this procedure, you should get local VS Code connected to a compute node in the DevCloud.
- RunIntel® VTune™server on the compute node from the VS Code terminal:Profilervtune-backend --enable-server-profiling
- Run theIntel® VTune™GUI. Control+click the URL displayed byProfilerIntel® VTune™server in the VS Code terminal to open theProfilerIntel® VTune™GUI in your web browser.Profiler
Option 2. Use
Intel® VTune™
Profiler Server on a Remote System via SSH Terminal
Intel® VTune™
Server on a Remote System via SSH Terminal Profiler
In this case, you must manually set up SSH tunneling. To simplify this procedure, run VTune on a specific port (
55001
in this example). You can select a different port if
55001
is busy.
- Log into Intel® DevCloud for oneAPI.
- Follow the instructions for Windows or Linux / MacOS systems and set up an SSH connection into the DevCloud.
- Log into the DevCloud login node:ssh devcloud
- Reserve a DevCloud compute node:qsub -IDo not close the terminal after this step, as the action will release your compute node.
- Open a new terminal.
- Log into the DevCloud node again, this time with SSH Port forwarding enabled:ssh -L 127.0.0.1:55001:127.0.0.1:55001 devcloud
- Establish an SSH connection from the login node to the compute node with one more SSH tunnel:ssh -L 127.0.0.1:55001:127.0.0.1:55001 s000-n000Replaces000-n000with your compute node name.
- Start VTune server on the compute node:vtune-backend --web-port=55001 --enable-server-profiling
- Open the VTune GUI. Use your web browser to open the URL displayed by the VTune server.
Finish Setup
Whether you chose Option 1 or Option 2, complete the setup by following these steps:
- Accept the VTune server certificate.When you open the VTune GUI, your web browser may prompt you about the VTune 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 Set Up Transport Security.
- Set the passphrase.When you run VTune server for the first time, the URL that it displays should contain a one-time-token. When you open this URL on a browser,Intel® VTune™server prompts you to set a passphrase. Other users cannot access yourProfilerIntel® VTune™server without the passphrase. The hash of the passphrase is persisted on the server. Also, your browser stores a secure HTTP cookie so that you do not need to enter the passphrase each time you open the VTune GUI. Once you set the passphrase, theProfilerIntel® VTune™welcome screen opens.Profiler
- Create a project.
- Configure an analysis. Your remote machine (running theIntel® VTune™server) is selected as the target system by default since you ran the server withProfiler--enable-server-profilingoption.
- Set the target application path and any command-line arguments. For more information, see Set Up Analysis Target.
- Run the analysis.
Usage Considerations
- The setup described in Option 1 relies on the functionality of the VS Code Remote - SSH extension to watch port numbers used by processes that are started through the VS Code terminal. The Remote - SSH extension automatically forwards these ports through the SSH tunnel. This action is controlled by theremote.autoForwardPortssetting, which is enabled by default.
- You can use the--enable-remote-profilingcommand-line option to enable the system that hosts VTune server as the performance profiling target. This option is disabled by default for security because running a VTune analysis involves launching a target application, which is an arbitrary command line. If multiple users have access to a single instance of VTune server, they would get access to execute arbitrary code on behalf of the user account that runs theIntel® VTune™server. EnableProfiler--enable-remote-profilingonly when VTune server is intended for a single user and you do not share the passphrase used to access the server.
- Use the--web-port=PORTcommand-line option to run VTune server on a specific port. Otherwise,Intel® VTune™will run on any arbitrary port available on the system.Profiler
- VTune server displays this warning in the output:
Because this procedure uses SSH port forwarding, you do not need to enablewarn: Server access is limited to localhost only. To enable remote access restart with --allow-remote-ui.--allow-remote-ui. Incoming connections to the VTune server come from the SSH server and they are localhost connections. If you enable--allow-remote-ui, VTune server builds a URL with the real network card IP address or FQDN name, which may not be accessible from your client machine. - By default, VTune server stores profiling results in your home directory. Use the--data-directorycommand-line argument to specify a different data directory. You can also use this argument to open pre-collectedIntel® VTune™results inProfilerIntel® VTune™server.ProfilerIntel® VTune™can locate its results in any child folders.Profiler