gatk icon indicating copy to clipboard operation
gatk copied to clipboard

GATK should warn the user when the temp dir is "noexec"

Open droazen opened this issue 1 year ago • 2 comments

As reported recently by Eric Jones:

"Many newer Linux distributions will mount /tmp with the noexec mount option. If /tmp is noexec, then any JNA code (Java code that extracts native binary components into shareable libraries and then executes that code) will fail. There are a number of GATK methods that do this.

A typical error looks like:

java.lang.UnsatisfiedLinkError: /tmp/libbwa.2929202181066681888.jnilib: /tmp/libbwa.2929202181066681888.jnilib: failed to map segment from shared object

There's an easy fix for it: you can use --tmpdir or one of the typical java methods that reset java.io.tmpdir to name a directory that isn't noexec. But it's amazingly hard to find clues about that being necessary. I found no references to noexec on the forum nor in the help section of the gatk site"

We should address this by explicitly checking on GATK startup whether the selected temp dir is marked noexec, and warn the user in that case.

droazen avatar Aug 04 '23 14:08 droazen

I have also stumbled over this. I am adding a detailed error log. I think that the incompatibility of accelerated PairHMM with a tmp directory mounted noexec should be mentioned in the installation requirements. I found it well-documented in the troubleshooting section. But everyone with this setup will experience falling back to the slow implementation for no other reason.

INFO  NativeLibraryLoader - Loading libgkl_utils.so from jar:file:/
miniconda2/envs/polyploidPhasing/share/gatk4-4.3.0.0-0/gatk-package-4.3.0.0-local.jar!/com/intel/gkl/native/libgkl_utils.so
WARN  NativeLibraryLoader - Unable to load libgkl_utils.so from native/libgkl_utils.so (/tmp/libgkl_utils9418239050694741169.so: /tmp/libgkl_utils9
418239050694741169.so: failed to map segment from shared object: Operation not permitted)
WARN  IntelPairHmm - Intel GKL Utils not loaded
PairHMM - OpenMP multi-threaded AVX-accelerated native PairHMM implementation is not supported

mdondrup avatar Jan 23 '24 10:01 mdondrup

To bump an old issue: I could take a look at this if you knew of a good Java library method to test whether a directory is noexec or not, especially something cross-platform friendly (if this is an issue anywhere else other than Linux). This just happened to me and I found this issue more useful to debugging than the output.

Also, for anyone else who stumbles upon this in the meantime, the flag to pass to GATK is --TMP_DIR and then point to some random directory you made on your local fs.

rickymagner avatar Feb 27 '24 21:02 rickymagner