For a school project I have to use Valgrind and other tools to help optimise a program. I’m on macOS 14.0 and using a Lima VM to run the profiling tools, but this is my first time using an environment like this so I’m not familiar with how it all works.
I’m encountering a problem with kcachegrind
: after profiling the compiled file with valgrind --tool=callgrind ./file
I run kcachegrind callgrind.out.3113
but get the following output:
qt.qpa.xcb: could not connect to display 127.0.0.1:10.0
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: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.
Aborted (core dumped)
I tried reinstalling Qt but it didn’t fix the issue. I’ve also tried a few quick fixes I found online:
-
XQuartz is running
-
The
~/.ssh/config
file contains the linesForwardX11 yes ForwardX11Trusted yes
-
I’ve tried setting the DISPLAY environment manually with
export DISPLAY=127.0.0.1:10.0
According to the guide I was given, kcachegrind
should open a GUI that visualises the profiling file produced by Valgrind.
Any help is much appreciated, thanks.