Back to Blog

RenderDoc on SpacemiT K3: A Practical Qt6 Porting Guide

RISC-V AI Assistant 2026-08-13 02:04:03 29 views

Step-by-step guide to building RenderDoc on Bianbu Linux riscv64, including Qt5 to Qt6 migration, deployment, and frame capture on PowerVR BXM-4-64.

RenderDoc on SpacemiT K3: A Practical Qt6 Porting Guide

RenderDoc is the de facto graphics debugger for frame capture, draw-call replay, and shader inspection. Official binaries are only published for x86 and ARM, so running it on RISC-V requires a source build. A community contributor recently documented the full workflow for SpacemiT K3 running Bianbu Linux, including the only non-trivial change: migrating the Qt GUI from Qt5 to Qt6.

The good news is that the capture and replay core is almost entirely architecture-agnostic. The Linux capture path uses LD_PRELOAD to intercept graphics API calls, and the software shader interpreter is pure C++. On K3 the GPU is the PowerVR BXM-4-64, so replay uses the real Vulkan/OpenGL ES driver. The result is a working qrenderdoc that can capture GLES applications on Wayland.

Test Environment

Install the build dependencies first:

sudo apt-get update sudo apt-get install -y cmake ninja-build \ libxcb-keysyms1-dev \ qt6-base-dev qt6-tools-dev qt6-svg-dev qt6-5compat-dev

libxcb-keysyms1-dev is required or CMake configure aborts. qt6-5compat-dev is required because qrenderdoc still uses QTextCodec, which moved to the QtCore5Compat module in Qt6.

Build the Core Library

Start by building the command-line tools and core library without the GUI:

git clone https://github.com/baldurk/renderdoc.git cd renderdoc git checkout 4e59f62a9 git switch -c riscv-qt6-port mkdir -p build-riscv && cd build-riscv cmake .. -G Ninja \ -DCMAKE_BUILD_TYPE=Release \ -DENABLE_QRENDERDOC=OFF \ -DENABLE_PYRENDERDOC=OFF cmake --build .

Outputs:

Check that the binary is a RISC-V ELF and has no missing libraries:

file bin/renderdoccmd ldd bin/renderdoccmd | grep "not found" ./bin/renderdoccmd version

The version string prints "x64" as a hard-coded upstream label; this can be ignored.

Qt5 to Qt6 Migration

Bianbu supplies Qt6 but upstream qrenderdoc is written for Qt5. The contributor produced a single git patch covering 62 files and approximately +362/-142 lines. Apply it before enabling the GUI build:

cd /path/to/renderdoc git am 0001-Port-qrenderdoc-UI-to-Qt6.patch

Key API replacements in the patch:

Then build the GUI:

cd build-riscv cmake .. -G Ninja \ -DCMAKE_BUILD_TYPE=Release \ -DENABLE_QRENDERDOC=ON \ -DENABLE_PYRENDERDOC=OFF \ -DQMAKE_QT5_COMMAND=/usr/bin/qmake6 cmake --build .

Bianbu-Specific Build Pitfalls

Pitfall 1: Running qmake6 manually fails with "please set the Build Environment Variable CMAKE_DIR"

Cause: qrenderdoc is a qmake sub-project invoked by CMake. The .pro file uses DESTDIR=$$CMAKE_DIR/bin, and CMAKE_DIR is empty when qmake6 is run by hand.

Fix: pass the variable explicitly:

qmake6 CMAKE_DIR=/path/to/renderdoc/build-riscv

Pitfall 2: Link errors mentioning libatomic

Cause: Bianbu's Qt6 platform configuration does not set QMAKE_LIBS_LIBATOMIC, but GCC on RISC-V needs -latomic for some atomic operations.

Fix: add the following to the .pro file (already included in the migration patch):

isEmpty(QMAKE_LIBS_LIBATOMIC): QMAKE_LIBS_LIBATOMIC = -latomic

If symbols are still missing, create the symlink manually:

ln -s /usr/lib/riscv64-linux-gnu/libatomic.so.1 \ /usr/lib/riscv64-linux-gnu/libatomic.so

The final output is bin/qrenderdoc, roughly 18 MB unstripped.

Deployment

Copy the binaries into a self-contained tree. RUNPATH is already set to $ORIGIN:$ORIGIN/../lib/, so no LD_LIBRARY_PATH is needed:

mkdir -p /home/bianbu/renderdoc/{bin,lib} cp bin/qrenderdoc bin/renderdoccmd /home/bianbu/renderdoc/bin/ cp lib/librenderdoc.so /home/bianbu/renderdoc/lib/ chown -R bianbu:bianbu /home/bianbu/renderdoc

Run the GUI:

cd /home/bianbu/renderdoc ./bin/qrenderdoc

Capturing a Frame

Recommended approach: use the GUI Queue Capture feature.

  1. Start qrenderdoc.
  2. Choose File → Launch Application.
  3. Select a GLES application such as /bin/glmark2-es2.
  4. Enable Queue Capture and set the target frame number, for example frame 1.
  5. Click Launch; the capture triggers automatically at the requested frame.
  6. The .rdc file is saved to /tmp/RenderDoc/<appname>_<timestamp>.rdc.

This method works on Wayland because it does not rely on a global hotkey.

Command-line capture with renderdoccmd is currently less reliable on Bianbu because it depends on the F12 key, which is not captured under Wayland. Two issues are involved:

To enable command-line capture, either rebuild with experimental Wayland support or add the missing EGL hook.

Common Issues

Symptom Cause Fix CMake configure fails Missing xcb-keysyms dev package apt install libxcb-keysyms1-dev QTextCodec not found Missing QtCore5Compat apt install qt6-5compat-dev and add QT += core5compat libatomic symbols missing Qt6 qmake omits -latomic Add QMAKE_LIBS_LIBATOMIC = -latomic GUI capture produces no .rdc /tmp/RenderDoc owned by wrong user sudo chmod 1777 /tmp/RenderDoc F12 does not trigger capture Wayland key capture not compiled Use GUI Queue Capture, or enable Wayland support

Takeaway

Porting RenderDoc to K3 is practical because the core library is already mostly RISC-V-ready. The only significant work is moving the GUI from Qt5 to Qt6. Once that patch is applied, qrenderdoc builds, deploys without LD_LIBRARY_PATH, and captures GLES frames on Wayland through Queue Capture. For anyone building graphics applications on SpacemiT K3, this removes a major tooling gap.

Source: RenderDoc 移植到 SpacemiT K3 (Bianbu) 实战指南 (SpacemiT Forum) https://forum.spacemit.com/t/topic/1578
Tags: RISC-VK3SpacemiTRenderDocGPUPowerVRBianbuGraphics

Have questions about this topic?

Start a Discussion Get a Quote