Fiji ImageJ App Deployment

I am working to get Fiji imageJ deployed as an app through OnDemand. I have the app configured as a VNC app. When I launch the app, it gives me a noVNC session that shows only a black screen. I can run the app just fine through an interactive desktop session. My submission script is located below. The VNC and XFCE options were pulled from an example Matlab script.

#!/usr/bin/env bash

# Benchmark info
echo "TIMING - Starting main script at: $(date)"

# Add Caffe Unet Libraries to LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/share/apps/fiji/caffe_unet/lib:/share/apps/fiji/caffe_unet/extlib:$LD_LIBRARY_PATH

# Add VirtualGL to PATH
export PATH=/opt/VirtualGL/bin:$PATH

# Configure VNC and XFCE
export SEND_256_COLORS_TO_REMOTE=1
xfwm4 --compositor=off --sm-client-disable
xsetroot -solid "#D3D3D3"
xfsettingsd --sm-client-disable
xfce4-panel --sm-client-disable

# Purge the module environment to avoid conflicts
module purge

# Load the require modules
module load shared cuda10.2/toolkit cudnn7.6-cuda10.2

# List loaded modules
module list

# Benchmark info
echo "TIMING - Starting Fiji at: $(date)"

# Launch the Fiji desktop app
set -x
/share/apps/fiji/Fiji.app/ImageJ-linux64 --heap 1G --no-splash --dont-patch-ij1 --ij2

My guess is you’re missing the --deamonize arguement for `xfwm4.

My guess is, with a set -x you’d see it hang on that command.

Jeff,

I had --daemon and --daemonize in the initial versions of my script (never together, either one or the other). Both of those flags came back as “unrecognized options” on the xfwm4 command.

OK - do you know if you’re proceeding after that statement or is the script hanging somewhere?

What’s the OS of the compute node and the output logs of one of these jobs?

It’s getting past that line. It looks like it’s hanging on the xfsettingsd command. OS is RHEL 8.3. output.log is below:

Setting VNC password...
Starting VNC server...

WARNING: talon35:1 is taken because of /tmp/.X1-lock
Remove this file if there is no X server talon35:1
Killing Xvnc process ID 2292940
Xvnc process ID 2292940 already killed
Xvnc did not appear to shut down cleanly. Removing /tmp/.X11-unix/X1
Xvnc did not appear to shut down cleanly. Removing /tmp/.X1-lock

Desktop 'TurboVNC: talon35:1 (brad.traver)' started on display talon35:1

Log file is vnc.log
Successfully started VNC server on talon35.ib.cluster:5901...
Starting before.sh...
Script starting...
Starting websocket server...
TIMING - Starting main script at: Tue Jun  7 11:45:08 CDT 2022
xfwm4: Unknown option --daemon.
Type "xfwm4 --help" for usage.
XFWM4 configured

xsetroot done

WebSocket server settings:
  - Listen on :23584
  - No SSL/TLS support (no cert file)
  - Backgrounding (daemon)
Scanning VNC log file for user authentications...
Generating connection YAML file...
xfsettingsd: No window manager registered on screen 0.

(xfsettingsd:2294433): xfsettingsd-WARNING **: 11:45:13.704: Failed to get the _NET_NUMBER_OF_DESKTOPS property.
Setting VNC password...
Generating connection YAML file...

What’s the log from a job when xfwm4 actually starts correctly?

It looks like it never starts correctly. It seems to hang on the xfwm4 command. This is the only error I see:
(xfwm4:2326764): GLib-CRITICAL **: 14:40:43.777: g_str_has_prefix: assertion 'prefix != NULL' failed

hang, meaning it doesn’t background itself. Maybe try an & to do so. Again - we haven’t upgraded yet so I’m sure there’s something on the internet about them removing that option and what to do instead. Maybe a simple --replace?

xfwm4 --compositor=off --sm-client-disable 2>&1 &

I’m getting a few more errors but it still hangs at the same command. The addition of --replace didn’t seem to do anything. Errors are below. The last error was printed three times. I only put it once here.

(xfwm4:2330423): GLib-CRITICAL **: 14:59:09.157: g_str_has_prefix: assertion 'prefix != NULL' failed
(xfsettingsd:2330425): GLib-CRITICAL **: 14:59:12.079: g_str_has_prefix: assertion 'prefix != NULL' failed
(xfsettingsd:2330425): GLib-GObject-CRITICAL **: 14:59:12.081: g_value_get_string: assertion 'G_VALUE_HOLDS_STRING (value)' failed

Yea I’m not sure what, if any, of those errors are meaningful. Seems to me you need to background the process with a & or similar.

I’ve added 2>&1 & to the end of the command. It hasn’t done anything.

I removed the 2>&1 and just left the &. No dice.

It turns out that the --daemon option needs to be moved to the xfsettingsd command. I’m now getting hung up on the xfce4-panel command.

Adding the & to background xfce4-panel seems to fix it.