A self-hosted NVIDIA Nsight Tools GUI (for Nsight Graphics) running in a Docker container allows for remote access via a web browser.
Nsight Streamer for Nsight Graphics
A self-hosted NVIDIA Nsight Tools GUI, running within a Docker container, enables remote access through a web browser. This configuration is highly beneficial for analyzing data on remote servers or clusters.
Currently, NVIDIA Nsight Systems, NVIDIA Nsight Compute, NVIDIA Nsight Graphics, and NVIDIA Nsight Deep Learning Designer are supported for running inside a container.
Benefits
-
Handling Large Data: The reports generated by NVIDIA Nsight Graphics on servers/clusters can be extremely large, making it impractical to transfer them to a local machine. By hosting the GUI on the remote server, you can analyze the data in place without the need for excessive data transfers.
-
Enhanced Performance: Remote servers or clusters often have significantly more computational power and memory compared to local machines. Analyzing the reports directly on the remote server leverages these resources, ensuring faster and more efficient data processing and analysis.
-
Security Compliance: Many organizations have strict security protocols that prevent copying sensitive data from servers or clusters to local environments. This self-hosted solution ensures that the data remains within the secure confines of the server while still providing the necessary tools for thorough analysis.
Warning
Nsight Streamer for Nsight Graphics supports remote profiling, so it is essential to ensure that the server is secure and that the necessary security measures are in place to prevent unauthorized access to your data.
Getting Started
Prerequisites
Docker
- Docker installed on the host machine.
- NVIDIA drivers installed on the host machine. See the NVIDIA GPU Driver Installation Guide for more information.
- NVIDIA Container Toolkit installed on the host machine.
Kubernetes
- A Kubernetes cluster.
- Helm installed on the administator machine.
- Have NVIDIA GPU Operator installed on the Kubernetes cluster. See the NVIDIA GPU Operator Installation Guide for more information.
(Optional) NVIDIA GPU with AV1 encoding support
- NVIDIA GPU with AV1 encoding support (Ada Lovelace architecture or newer GPUs). For a complete list of supported GPUs, see the NVIDIA Video Encode and Decode GPU Support Matrix
Run the container using a Python script
The Nsight Streamer can be started using the run_nsight_streamer.py script provided by Nsight Streamer Resources.
Linux/Mac
Windows
Benefits
- Fetching the Latest Image: The script fetches the latest image of the specified Docker container from the NGC repository. This ensures you are always running the most up-to-date version of the container.
- Port Availability: The script checks if HTTP and TURN ports (8080 and 3478 by default) are available on the host machine. If they are not available, it finds an available port and uses that for the container.
- Stopping Existing Containers: Before starting a new container, the script can stop existing Nsight Streamer containers which are using the specified HTTP and TURN ports.
- Running the Container: The script constructs and runs the Docker command with the specified parameters, including volumes and additional Docker arguments.
- Configuration Preserve: The script automatically preserves Nsight Tool configuration across multiple container launches on one machine.
- Hardware Acceleration: The script automatically detects the availability of a NVIDIA GPU with AV1 encoding support and NVIDIA Container Toolkit and enables hardware acceleration if both are present. NVIDIA GPU with AV1 encoding support is required for hardware acceleration. See the NVIDIA Video Encode and Decode GPU Support Matrix for a list of supported GPUs. Additionaly, NVIDIA drivers are required for hardware acceleration. See the NVIDIA GPU Driver Installation Guide for more information.
Script arguments
None of the arguments are required, but it is highly recommended to include at least one -v/--volume argument to mount a volume with profiling reports inside the container.
| Parameter | Description | Default Value |
|---|---|---|
| tool | The Nsight Tool tool to run inside the container. | |
| --http-port | Set the HTTP port. Set to 'dynamic' to find the first available port. | 8080 |
| --turn-port | Set the TURN port. Set to 'dynamic' to find the first available port. | 3478 |
| --host-ip | The host IP address to bind the server to. | 0.0.0.0 |
| --enable-resize | Should resizing be enabled to fit the remote resolution to the client window? | true |
| --max-resolution | Maximum resolution of the remote screen used for streaming Nsight Tool. | 1920x1080 |
| -v, --volume | Mount a volume from the host to the container. This option can be repeated multiple times. The volume will be mount to /mnt/host/volumes/[volume] inside the container | |
| --no-preserve-config | Do not preserve a Nsight Tool configuration file in the container between runs. | |
| -y, --yes | Automatically answer 'yes' to prompts. Use with caution. | |
| --web-username | The username for accessing the NVIDIA Nsight Streamer from a browser. If set to an empty string, no authentication is required. | |
| --web-password | The password for accessing the NVIDIA Nsight Streamer from a browser. | |
| --encoder | Manually specify the encoder to use (nvav1enc, vp9). If not specified, the container will auto-detect the best available encoder. | |
| -- | Additional docker run arguments that will be passed directly to the docker run command. | |
| -h, --help | Display this help and exit. |
Run the container using docker run
- From the top-right corner of this page, select the pull-down Get Container and copy the URL to the default container. Alternatively, click on View all tags to select a different container.
- Open a command prompt on your Linux compatible system and run the following command. Ensure the pull completes successfully before proceeding to the next step.
- Run the docker container (use the desired container tag in the command line below):
This example sets the HTTP port for publishing on the host to 8080, the TURN port for publishing on the host to 3478, and mounts /host_path/reports to /container_path/reports inside the container.
Enabling Hardware Acceleration
To enable GPU hardware acceleration with Docker which improves the performance of the Nsight Streamer, you need to:
- Have an NVIDIA GPU with AV1 encoding support on the node where the Nsight Streamer is deployed (Ada Lovelace architecture or newer GPUs). For a complete list of supported GPUs, see the NVIDIA Video Encode and Decode GPU Support Matrix
- Have NVIDIA drivers installed on the host. See the NVIDIA GPU Driver Installation Guide for more information.
- Have NVIDIA Container Toolkit installed. See the NVIDIA Container Toolkit Installation Guide for more information.
- Pass the appropriate flags to Docker:
Runtime environment variables
Can be used to configure runtime parameters.
| Variable | Description | Default value |
|---|---|---|
| TURN_PORT | TCP port that will be used for WebRTC data transmission. The port should match the port published from the container on the host. | 3478 |
| ENABLE_RESIZE | Should resizing be enabled to fit the remote resolution to the client window? | true |
| MAX_RESOLUTION | Maximum resolution of the remote screen used for streaming the Nsight Tool. | 1920x1080 |
| WEB_USERNAME | The username for accessing the NVIDIA Nsight Streamer from a browser. If set to an empty string, no authentication is required. | nvidia |
| WEB_PASSWORD | The password for accessing the NVIDIA Nsight Streamer from a browser. | nvidia |
| ENCODER | The video encoder to use (nvav1enc for NVIDIA GPU with AV1 support, vp9 for software encoding). | Auto-detected |
Run in a Kubernetes cluster using a Helm Chart
-
Install the Nsight Streamer with volumes for your profiling reports:
-
Using a values file for more complex configurations:
-
Install in a non-default namespace:
-
Install multiple copies of the Nsight Streamer:
Enabling Hardware Acceleration in Kubernetes
To enable GPU hardware acceleration for video encoding in Kubernetes, which significantly improves the performance and responsiveness of the Nsight Streamer, you need to:
- Have an NVIDIA GPU with AV1 encoding support on the node where the Nsight Streamer is deployed (Ada Lovelace architecture or newer GPUs). For a complete list of supported GPUs, see the NVIDIA Video Encode and Decode GPU Support Matrix
Helm installation configuration values
The Nsight Streamer can be customized to suit particular needs. A values file or the --set argument can be used for setting these values.
| Parameter | Description | Default Value |
|---|---|---|
| tool | The Nsight tool to run in the container. Valid values: nsys (Nsight Systems), ncu (Nsight Compute), ngfx (Nsight Graphics), ndld (Nsight Deep Learning Designer). | Required |
| service.type | The type of Kubernetes service to create (ClusterIP, NodePort). | NodePort |
| service.httpPort | The port on which the HTTP service will be exposed within the cluster. | 30080 |
| service.turnPort | The port on which the TURN service will be exposed within the cluster. | 30478 |
| service.nodeHttpPort | The NodePort value for exposing HTTP traffic outside the cluster. Applicable when service.type is NodePort. | 30080 |
| service.nodeTurnPort | The NodePort value for exposing TURN traffic outside the cluster. Applicable when service.type is NodePort. Should be equal to service.turnPort. | 30478 |
| nodeSelector | Node selector for Nsight Streamer pod scheduling. | {} |
| tolerations | Tolerations for Nsight Streamer pod scheduling. | [] |
| affinity | Affinity rules for Nsight Streamer pod scheduling. | {} |
| volumeMounts | List of volumes to mount into the container. | [] |
| volumes | List of volumes to be used by the container. | [] |
| env | List of environment variables to be injected into the Docker container. | [] |
| enableResize | Should resizing be enabled to fit the remote resolution to the client window? | true |
| maxResolution | Maximum resolution of the remote screen used for streaming the Nsight Tool. | 1920x1080 |
| preserveConfig | Preserve the Nsight Tool configuration file in the container between runs. | true |
| webUsername | The username for accessing the NVIDIA Nsight Streamer from a browser. Can be provided as a direct string value or as a secret reference. If using a secret, set webUsername as a map with secretName and secretKey. If set to an empty string, no authentication is required. | nvidia |
| webPassword | The password for accessing the NVIDIA Nsight Streamer from a browser. Can be provided as a direct string value or as a secret reference. If using a secret, set webPassword as a map with secretName and secretKey. | nvidia |
Accessing the Service After Installation
After installing the Nsight Streamer using Helm, you can access it in different ways depending on the service type configuration:
ClusterIP Service Type
When using ClusterIP (set via service.type=ClusterIP), the service is only accessible from within the cluster. You can access it using port forwarding to your local machine:
Then access the service at http://localhost:30080
Make sure that the target turn port forwarded is the same as the service.turnPort (default is 30478).
NodePort Service Type
When using NodePort (default, or set via service.type=NodePort), the service is exposed on each node's IP at a static port. The default port is 30080, but this can be configured during installation using the service.nodeHttpPort parameter.
After installation, the connection information will be automatically displayed by the print-connection-info job. You can retrieve this information by checking the job logs:
Access the service by opening your web browser and navigating to:
Note: Ensure your network security settings allow access to the configured NodePort.
Automatic Report File Detection
The Nsight Streamer scans all mounted volumes at startup and selects the first one containing supported report files (ngfx-cppcap, nsight-gfxcppcap). The "Open..." dialog will be opened with the detected directory.
Troubleshooting
Clipboard is not working in Chrome
Enable chrome://flags/#unsafely-treat-insecure-origin-as-secure and add the Nsight Streamer URL to the list.
Connection failed on Firefox
If you encounter a "Connection failed." error on Firefox, you can resolve it by changing a configuration setting:
- Open Firefox and navigate to
about:config. - Search for
media.peerconnection.ice.loopback. - Set the value to true.
Connection failed on Safari
If you are experiencing connection issues in Safari when using AV1 codec:
- Open Safari and go to Safari menu > Settings > Advanced.
- Check the box next to "Show features for web developers".
- Go to "Feature Flags" and search for "WebRTC AV1 codec".
- Enable the "WebRTC AV1 codec" option.
- Restart Safari and try connecting again.
The GUI is too small on an HDPI screen
Restart the remote Nsight Tool:
- Go to
Filein the menu bar of Nsight Tool. - Select
Exit. - Nsight Tool will be opened with the scaled GUI.
License Agreements
By pulling and using the container, you accept the terms and conditions of this End User License Agreement.