Running Slicer in a web browser via Amazon AppStreams

At today’s MONAILabel workshop 100+ people could see how amazingly well Slicer works in a web browser using Amazon AppStream. For those who missed, here is a short demo:

Questions are already coming in if this is generally available and about how this can be set up. @pieper can you answer this question or ask someone from AWS to answer here?

9 Likes

That’s an excellent demo video @lassoan, thanks!

Yes, this is all just off-the-shelf AWS AppStream 2.0 and the regular Slicer build. Qing Liu from AWS and I have been testing this out for a while and have been planning to make a Slicer-specific blog post to explain the details. Yesterday was the first time I had seen it scaling it up to so many users.

4 Likes

Get Slicer Running on AWS AppStream 2.0 Under Amazon Linux

Further to this thread… I spent quite a bit of time over the last several days figuring out how to get Slicer running on AWS AppStream 2.0 on an Amazon Linux instance (versus a Windows instance). I thought I’d post my solution here to help any others who might be interested in doing this.

  1. First, create an AppStream Image Builder instance. (If you need more details ping me, or post here. There are lots of instructions online). In my AWS zone (Canada Central), I had to opt for a stream.graphics-pro.4xlarge instance. Pricing info. (Make sure you check the “Internet Access” box in the Networking config panel to give your instance access to the internet). Launch this instance.

  2. Next, install the Chromium Browser on your instance

  3. Use the browser to download the Slicer install package (.tar.gz). As of this writing that file is ‘Slicer-5.2.2-linux-amd64.tar.gz’ (you could also use wget or curl to download the file directly from the command line, and skip the browser install if you want)

  4. Unpack this file eg: “tar xzvf Slicer-5.2.2-linux-amd64.tar.gz”. This will create a directory called ‘Slicer-5.2.2-linux-amd64’ with Slicer inside it. I’ll assume this in in your home folder.

  5. Install the missing libraries Slicer needs to run:

    • sudo yum install -y mesa-libGLU xcb-util-keysyms xcb-util-renderutil xcb-util-wm xcb-util-image qt5-qtbase

That should do it. You should now be able to launch Slicer on your ImageBuilder instance:

  • ~/Slicer-5.2.2-linux-amd64/Slicer

I hope this helps!

5 Likes

Thanks for taking the time to write a detailed summary :pray:

Since we bundled qt libraries, do you know which Qt library or plugin was missing ? I would like to understand if there is anything we would need to fix on the packaging side.

Hello Jean:

I initially got the following error when launching Slicer on Amazon Linux:

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.

The key to finding the problems was to set the Qt debug environment variable:

  • export QT_DEBUG_PLUGINS=1

Then, launching Slicer produced Qt debug messages. These revealed that there were errors loading a library called “libqxcb.so"

This library is part of the Slicer build, and is located in "lib/QtPlugins/platforms” inside the Slicer install dir.

Next, I checked what dependencies this library had by executing the following from the Slicer install dir:

  • ldd ./lib/QtPlugins/platforms/libqxcb.so

This produced a lot of output. I’ve edited this to show only the missing dependencies…

libQt5XcbQpa.so.5 => not found
libQt5Gui.so.5 => not found
libQt5DBus.so.5 => not found
libQt5Core.so.5 => not found
libxcb-icccm.so.4 => not found
libxcb-image.so.0 => not found
libxcb-keysyms.so.1 => not found
libxcb-render-util.so.0 => not found

So, I then installed these missing dependencies:

  • sudo yum install xcb-util-keysyms
  • sudo yum install xcb-util-renderutil
  • sudo yum install xcb-util-wm
  • sudo yum install xcb-util-image
  • sudo yum install qt5-qtbase

This allowed Slicer to launch and run!

I hope this helps.

Thanks a lot, these are all very useful information and they make sense. The only thing that I don’t understand is why qt5-qtbase was needed.

Can you verify that everything works well without installing qt5-qtbase? (or if not, what is missing)

2 Likes

I want to know how can I get Slicer in AppStreams, since I only see limited apps for chosen and there is no 3D Slicer now.