Running ilastik GUI from a container

Hi there!

As mentioned here, we’re in the process of offering all image analysis tools as Singularity containers so that they can be run directly in our clusters with access to fast storage - ilastik GUI has been an issue! I’ve generated a Singularity container with the following recipe and it seems to have done the job for headless:

Bootstrap: docker
From: debian:buster-slim

%runscript
    export MYHOME=/home/user
    cd $MYHOME/ilastik-1.*-Linux
    ./run_ilastik.sh

%post
    export MYHOME=/home/user
    mkdir $MYHOME
    cd $MYHOME
    apt-get update
    apt-get install -y wget bzip2
    wget https://files.ilastik.org/ilastik-1.3.3post2-Linux.tar.bz2
    tar xjf ilastik-1.*-Linux.tar.bz2
    rm ilastik-1.*-Linux.tar.bz2

However, when trying to run with GUI I run into the error below. It is also the same error I run into if I try to follow the instructions here but remove --headless from the run command. Is it something we can fix on our end? Any thoughts appreciated!

Summary
Starting ilastik from "/home/user/ilastik-1.3.3post2-Linux".
Fatal Python error: Segmentation fault

Thread 0x00007f0996ef0700 (most recent call first):
  File "/home/user/ilastik-1.3.3post2-Linux/lib/python3.7/threading.py", line 300 in wait
  File "/home/user/ilastik-1.3.3post2-Linux/lib/python3.7/threading.py", line 552 in wait
  File "/home/user/ilastik-1.3.3post2-Linux/lib/python3.7/threading.py", line 1156 in run
  File "/home/user/ilastik-1.3.3post2-Linux/lib/python3.7/threading.py", line 917 in _bootstrap_inner
  File "/home/user/ilastik-1.3.3post2-Linux/lib/python3.7/threading.py", line 885 in _bootstrap

Current thread 0x00007f099a7be740 (most recent call first):
  File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 1043 in create_module
  File "<frozen importlib._bootstrap>", line 583 in module_from_spec
  File "<frozen importlib._bootstrap>", line 670 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 967 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 983 in _find_and_load
  File "/home/user/ilastik-1.3.3post2-Linux/ilastik-meta/volumina/volumina/pixelpipeline/imagepump.py", line 27 in <module>
  File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 728 in exec_module
  File "<frozen importlib._bootstrap>", line 677 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 967 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 983 in _find_and_load
  File "/home/user/ilastik-1.3.3post2-Linux/ilastik-meta/volumina/volumina/api.py", line 25 in <module>
  File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 728 in exec_module
  File "<frozen importlib._bootstrap>", line 677 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 967 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 983 in _find_and_load
  File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1035 in _handle_fromlist
  File "/home/user/ilastik-1.3.3post2-Linux/ilastik-meta/volumina/volumina/__init__.py", line 47 in <module>
  File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 728 in exec_module
  File "<frozen importlib._bootstrap>", line 677 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 967 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 983 in _find_and_load
  File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 953 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 983 in _find_and_load
  File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 953 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 983 in _find_and_load
  File "/home/user/ilastik-1.3.3post2-Linux/ilastik-meta/ilastik/ilastik/excepthooks.py", line 62 in display_and_log
./run_ilastik.sh: line 77: 55986 Segmentation fault      (core dumped) "${PREFIX}/bin/python" "${PREFIX}/ilastik-meta/ilastik/ilastik.py" "$@"

I had the same error before, what I did is to install some dependencies.

my container base image is ubuntu18.04. after install the following dependencies ,UI start working

  • libglu1-mesa-dev
  • qt5-default
  • libgl1-mesa-glx

Also, you probably want to make sure your machine has enough RAM.

Hope this helps

2 Likes

Brilliant, worked perfectly! Thanks a lot!

Could you please update your runscript so the rest of us can understand how the solution was implemented?

Sure thing! There’s only a few extra packages to be installed by apt-get and I moved to ubuntu 18.04 so it looks like this:

Bootstrap: docker
From: ubuntu:18.04

%runscript
	export MYHOME=/home/user
	cd $MYHOME/ilastik-1.*-Linux
    ./run_ilastik.sh

%post
    export MYHOME=/home/user
    mkdir $MYHOME
    cd $MYHOME
    apt-get update
    apt-get install -y wget bzip2 libglu1-mesa-dev qt5-default libgl1-mesa-glx
    wget https://files.ilastik.org/ilastik-1.3.3post2-Linux.tar.bz2
    tar xjf ilastik-1.*-Linux.tar.bz2
    rm ilastik-1.*-Linux.tar.bz2

We’re keeping all our Singularity recipes at https://github.com/TheJacksonLaboratory/rit-imageanalysis-containers for reference!