Nsight compute can not be launched in docker

I installed the latest version 2023.3 in my docker, when I launch nsight compute ui app, but it failed:

# /usr/local/NVIDIA-Nsight-Compute/ncu-ui
qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin “xcb” in “” even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: offscreen, wayland-egl, wayland, xcb.

Application could not be initialized!
This is likely due to missing Qt platform dependencies.
For a list of dependencies, please refer to Qt for X11 Requirements | Qt 6.6
To view missing libraries, set QT_DEBUG_PLUGINS=1 and re-run the application.

Warning: OpenGL Version check failed. Falling back to Mesa software rendering.
qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin “xcb” in “” even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: offscreen, wayland-egl, wayland, xcb.

################# ERROR: CrashReporter #################
CrashReporter

Qt initialization failed

Failed to load Qt platform plugin: “xcb”

  • Library path: /usr/local/NVIDIA-Nsight-Compute-2023.3/host/linux-desktop-glibc_2_11_3-x64/Plugins/platforms/libqxcb.so
    Application is going to abort
    /bin/bash: xmessage: command not found
    /usr/local/NVIDIA-Nsight-Compute-2023.3/host/linux-desktop-glibc_2_11_3-x64/ncu-ui: line 26: 9702 Aborted (core dumped) “$NV_AGORA_PATH/CrashReporter” “NVIDIA Nsight Compute” “NVIDIA Nsight Compute” “2023.3.0.0 (build 33266684) (public-release)” “$NV_AGORA_PATH/ncu-ui.bin” “$@”

Your container is likely not setup to support graphical applications, or at least doesn’t have all the dependencies that ncu-ui requires. I would recommend that you use the ncu command line tool to collect and report within the container and then open that report in an ncu-ui instance on the host system.