Skip to content

Instantly share code, notes, and snippets.

@tomesparon
Forked from pangyuteng/readme.md
Last active May 15, 2026 12:44
Show Gist options
  • Select an option

  • Save tomesparon/cb6da9038ead569d7454e3c1f1ea0c95 to your computer and use it in GitHub Desktop.

Select an option

Save tomesparon/cb6da9038ead569d7454e3c1f1ea0c95 to your computer and use it in GitHub Desktop.
itksnap wsl2

ITK-SNAP in WSL2 ubuntu24.04

  • download itksnap, unzip tar at ~
tar -xvf xxx.tar.gz
  • add bin folder to PATH in .bashrc
export PATH=/home/xxx/itksnap-4.4.0-20250909-Linux-x86_64/bin:$PATH
  • install libs
# sudo apt update && apt upgrade
sudo apt install mesa-utils libglu1-mesa-dev freeglut3-dev libxcb-* mesa-common-dev

Note: had to use this or else I get segfaults

export QT_XCB_GL_INTEGRATION=xcb_egl

old notes:

  • use below to troubleshoot missing libs:
export QT_DEBUG_PLUGINS=1



Launching ITK-SNAP
qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
qt.qpa.plugin: From 6.5.0, xcb-cursor0 or libxcb-cursor0 is needed to load the Qt xcb platform plugin.
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: xcb.

Aborted (core dumped)

Dump of other commands ran...

  198  itksnap
  199  export QT_QPA_PLATFORM=xcb
  200  itksnap
  201  ldd /opt/itksnap-4.4/lib/snap-4.4.0/platforms/libqxcb.so | grep 'not found'
  202  sudo apt install libqt6
  203  sudo apt install libqt6xcbqpa
  204  ldd /opt/itksnap-4.4/lib/snap-4.4.0/ITK-SNAP | grep 'not found'
  205  sudo apt update
  206  sudo apt install -y libxcb-cursor0 libxkbcommon-x11-0 libxcb-icccm4 libxcb-keysyms1 libxcb-randr0 libxcb-shape0 libxcb-xinerama0 libxcb-xkb1 libxcb-render-util0 libgl1 libegl1 libopengl0
  207  QT_QPA_PLATFORM=xcb /opt/itksnap-4.4/bin/itksnap
  208  ldd /opt/itksnap-4.4/lib/snap-4.4.0/ITK-SNAP | grep 'not found'#
  209  ldd /opt/itksnap-4.4/lib/snap-4.4.0/platforms/libqxcb.so | grep 'not found'
  210  ls /opt/itksnap-4.4/bin/
  211  cp /opt/itksnap-4.4/bin/greedy /usr/local/bin/
  212  greedy
  213  which greedy
  214  sudo apt update
  215  sudo apt install -y   libxcb-cursor0   libxcb-icccm4   libxcb-image0   libxcb-keysyms1   libxcb-render-util0   libxcb-randr0   libxcb-shape0   libxcb-shm0   libxcb-sync1   libxcb-xfixes0   libxcb-xinerama0   libxcb-xkb1   libxkbcommon-x11-0   libx11-xcb1   libxcb-glx0   libgl1   libegl1   libopengl0   libsm6   libice6   libglib2.0-0   libdbus-1-3   libfontconfig1   mesa-utils   x11-apps
  216  itksnap
  217  export LANG=C.UTF-8
  218  export LC_ALL=C.UTF-8
  219  QT_QPA_PLATFORM=xcb LIBGL_ALWAYS_SOFTWARE=1 /opt/itksnap-4.4/bin/itksnap
  220  export LANG=C.UTF-8
  221  export LC_ALL=C.UTF-8
  222  QT_QPA_PLATFORM=xcb LIBGL_ALWAYS_SOFTWARE=1 /opt/itksnap-4.4/bin/itksnap
  223  echo "$DISPLAY"
  224  echo "$WAYLAND_DISPLAY"
  225  xclock
  226  glxinfo -B | head -20
  227  LIB=/opt/itksnap-4.4/lib/snap-4.4.0
  228  LD_LIBRARY_PATH=$LIB ldd $LIB/platforms/libqxcb.so | grep 'not found'
  229  LD_LIBRARY_PATH=$LIB ldd $LIB/ITK-SNAP | grep 'not found'
  230  QT_QPA_PLATFORM=xcb LIBGL_ALWAYS_SOFTWARE=1 /opt/itksnap-4.4/bin/itksnap
  231  sudo apt install -y libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-xkb1 libxkbcommon-x11-0 libxcb-cursor0 mesa-utils x11-apps
  232  QT_QPA_PLATFORM=xcb LIBGL_ALWAYS_SOFTWARE=1 /opt/itksnap-4.4/bin/itksnap
  233  sudo apt update && sudo apt upgrade -y
  234  sudo apt install -y libglu1-mesa-dev freeglut3-dev mesa-common-dev libxcb-cursor0 libxkbcommon-x11-0 libdbus-1-3 libfontconfig1 libnss3 libasound2 libgbm1
  235  glxinfo -B | head -20
  236  itksnap
  237  export LIBGL_ALWAYS_SOFTWARE=1
  238  itksnap
  239  itksnap -vv
  240  itksnap --help
  241  itksnap --testgl
  242  itksnap --debug-events
  243  sudo apt update
  244  sudo apt install libgl1-mesa-glx libxcb-xinerama0
  245  sudo apt update && apt upgrade
  246  sudo apt install mesa-utils libglu1-mesa-dev freeglut3-dev libxcb-* mesa-common-dev
  247  export QT_DEBUG_PLUGINS=1
  248  itksnap
  249  itksnap --testgl
  250  export QT_XCB_GL_INTEGRATION=none
  251  export QT_OPENGL=software
  252  export LIBGL_ALWAYS_SOFTWARE=1
  253  itksnap
  254  export QT_XCB_GL_INTEGRATION=xcb_egl
  255  itksnap
  256  export QT_XCB_GL_INTEGRATION=xcb_egl
  257  itksnap
@tomesparon

Copy link
Copy Markdown
Author

for anyone searching for this! export QT_XCB_GL_INTEGRATION=xcb_egl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment