Configuring QuPath resouce consumption for shared computing enviroments?

qupath
#1

I’m in the process of installing QuPath for researchers on a shared system, where the many other processes are active.

Is there an external way to pass usage limitation to the program, such as a Config file, env variable,
or CLI argument that can be addressed in an automatic (and dynamic startup way)?

Thanks

(If this post is misplaced, relocation assistance would be appreciated)

0 Likes

#2

The system particulars are primarily derived GridEngine. Which allocates resources based on submitted requests, to a node (basically a computer server) wherein the hardware spec’s and usage are visible to the program (thus autodetect cores or mem creates issues as), and GridEngine will terminate any usage that exceeds the requested values.

0 Likes

#3

I don’t have experience of this myself, but when using the standard launcher the maximum memory can be set inside the .cfg file with the -Xmx option, mentioned in the last line at https://github.com/qupath/qupath/wiki/Paths-and-configuration

There is a little bit of (old) info about running QuPath from the command line here, which may allow you to pass the limit directly. Although running QuPath from the command line is something that certainly needs revisited one day…

0 Likes

#4

Awesome, (I did not see that earlier)
That will take the ‘standard’ & ‘non-standard’ java options and pass them to the JVM?
-Xmx, -Xss should cover our core case.
Thanks!

0 Likes

#5

Seems I spoke too soon, I’m not sure what I’m missing …

in a freshly untar’d Qupath 1.2
in QuPath/app/QuPath.cfg I edit in

[JVMOptions]
-Xmx8G

I then launch it from the command-line and see.

which matches the auto detect fraction at 1/8th total RAM

Thanks again

0 Likes

#6

Curious… how do you launch from the command line?

0 Likes

#7

Though if if I change it from within the GUI it does seem to preserve the setting within a users space but if I open with a second user account it starts over again. (a reasonable separation, but unusable for setting global defaults.)

here is some copy and paste for how I’m launching

QuPath  QuPath-0.1.2.tar.gz
[jpessin@scc5 build-playgroud]$ whereis QuPath
QuPath: /projectnb/scv/jpessin/build-playgroud/QuPath
[jpessin@scc5 build-playgroud]$ cd QuPath/
[jpessin@scc5 QuPath]$ pwd
/projectnb/scv/jpessin/build-playgroud/QuPath
[jpessin@scc5 QuPath]$ ls
QuPath  app  libpackager.so  runtime
[jpessin@scc5 QuPath]$ QuPath
17:17:54.228 [main] [INFO ] qupath.QuPath - Launching QuPath with args:
17:17:54.898 [JavaFX Application Thread] [INFO ] qupath.lib.gui.prefs.PathPrefs - Locale FORMAT set to en_US
17:17:54.902 [JavaFX Application Thread] [INFO ] qupath.lib.gui.prefs.PathPrefs - Locale DISPLAY set to en_US
17:17:54.925 [JavaFX Application Thread] [INFO ] qupath.lib.gui.prefs.PathPrefs - Tile cache size: 3641.00 MB
17:18:01.452 [JavaFX Application Thread] [INFO ] qupath.lib.gui.QuPathGUI - Selected style: Modena Light
17:18:01.453 [JavaFX Application Thread] [INFO ] qupath.lib.gui.QuPathGUI - Performing update check...
17:18:01.453 [JavaFX Application Thread] [INFO ] qupath.lib.gui.QuPathApp - Starting QuPath with parameters: []
17:18:23.601 [JavaFX Application Thread] [INFO ] qupath.lib.gui.QuPathGUI - Calling Platform.exit();

With

[Application]
app.name=QuPath
app.mainjar=QuPathApp.jar
app.version=0.1.2
app.preferences.id=QuPathAppID
app.mainclass=qupath/QuPath
app.classpath=qupath/qupath-core-0.1.2.jar:qupath/qupath-core-awt-0.1.2.jar:qupath/qupath-core-processing-0.1.2.jar:qupath/qupath-core-processing-awt-0.1.2.jar:qupath/qupath-extension-ij-0.1.2.jar:qupath/qupath-extension-input-0.1.2.jar:qupath/qupath-extension-opencv-0.1.2.jar:qupath/qupath-extension-openslide-0.1.2.jar:qupath/qupath-extension-pen-0.1.2.jar:qupath/qupath-extension-script-editor-0.1.2.jar:qupath/qupath-gui-fx-0.1.2.jar:qupath/qupath-processing-ij-0.1.2.jar:qupath/qupath-processing-opencv-0.1.2.jar:jars/commons-math3-3.6.1.jar:jars/controlsfx-8.40.12.jar:jars/flowless-0.4.5.jar:jars/groovy-2.4.7.jar:jars/groovy-jsr223-2.4.7.jar:jars/gson-2.8.0.jar:jars/ij-1.51g.jar:jars/jfxtras-common-8.0-r5.jar:jars/jfxtras-menu-8.0-r5.jar:jars/jinput-2.0.6.jar:jars/jpen-2-150301.jar:jars/jutils-1.0.0.jar:jars/logback-classic-1.1.7.jar:jars/logback-core-1.1.7.jar:jars/opencv-3.1.0.jar:jars/openslide-3.4.1_2.jar:jars/packager.jar:jars/reactfx-2.0-M4u1.jar:jars/richtextfx-0.6.10.jar:jars/slf4j-api-1.7.20.jar:jars/undofx-1.2.jar:jars/wellbehavedfx-0.1.1.jar
app.runtime=$APPDIR/runtime
app.identifier=QuPathAppID

[JVMOptions]
-Xmx8G

[JVMUserOptions]

[ArgOptions]

I did also try:
$ QuPath -Xmx4G
but this just becomes
. . . Starting QuPath with parameters: [-Xmx4G]
. . .
Unable to open -Xmx4G with OpenSlide: -Xmx4G
which I’m guessing is expected behaviour?

0 Likes

#8

Ah yes, that’s true for v0.1.2 - preferences are stored on a per-user basis, presumably including the max memory setting. However in v0.2.0 that won’t be/isn’t possible for the memory setting, since JDK 8 handles this differently through javapackager, which isn’t available in later versions. The only way I’ve found around that in v0.2.0 is for QuPath to write its own memory setting to the .cfg file (which seems to work, but I can image it may suffer permissions problems at some point if a full installer is used…).

Anyhow, there is a bit more about the command line here. The format should be something like

java -jar QuPathApp.jar /path/to/image/or/qpdata/file -script /path/to/script

You should then be able to add Xmx4G there (and skip the image/qpdata file and script). I believe this will also bypass the normal launcher and its application of memory settings.

If this looks promising, the next challenge is likely to be ensuring that -Djava.library.path is set appropriately so that OpenSlide works and/or Bio-Formats + the Bio-Formats extension are found on the classpath. One approach for OpenSlide could be to ensure the current working directory is the one containing the native libraries associated with QuPath when it is launched.

0 Likes