gimp: OpenBLAS: GotoBLAS : Can't open shared memory. Terminated.

after some recent updates, i’m getting

gimp: GotoBLAS : Can’t open shared memory. Terminated.

i tried various alternatives with
sudo update-alternatives --config libblas.so.3
Selection Path Priority Status

0 /usr/lib64/blas/libblas.so.3 50 auto mode

  • 1 /usr/lib64/blas/libblas.so.3 50 manual mode
    2 /usr/lib64/libopenblas_openmp.so.0 20 manual mode
    3 /usr/lib64/libopenblas_pthreads.so.0 20 manual mode

all the selections results in the same error

i found a workaround

OPENBLAS_NUM_THREADS=1 gimp

but this shouldn’t be the case
it seem to be unable to initialise shared memory
https://github.com/xianyi/OpenBLAS/blob/master/driver/others/init.c#L658

apparently some fixes to openblas needs to be applied
but these fixes are sitting on the development branch on OpenBLAS github repository
https://github.com/xianyi/OpenBLAS/commits/develop/driver/others/init.c
https://github.com/xianyi/OpenBLAS/commit/2a6fef9a55f5760be2d2aac280764284d9637ff5#diff-227ecc3ab422173879429275857a3fa3
https://github.com/xianyi/OpenBLAS/commit/07e7c36dac30f8f4864d86efad44a4e1b74e8ff3#diff-227ecc3ab422173879429275857a3fa3
https://github.com/xianyi/OpenBLAS/commit/28ae3ca76fffe35206afaff947283c1dfff7f5e8#diff-227ecc3ab422173879429275857a3fa3


#if defined(BIGNUMA)
// max number of nodes as defined in numa.h
// max cpus as defined in most sched.h
// cannot use CPU_SETSIZE directly as some
// Linux distributors set it to 4096 
#define MAX_NODES	128
#define MAX_CPUS	1024     <<<<<<<<<<<<< this is CPU_SETSIZE in the production master branch !
#else
#define MAX_NODES	16
#define MAX_CPUS	256
#endif

logged a bug report
https://bugzilla.opensuse.org/show_bug.cgi?id=1139010

for some reason the issue has been resolved

recently there is a proprietary Nvidia drivers update from Nvidia repository
among the things i did is i changed the libglx config from xorg to nvidia-libglx
but i’m not too sure if this is the thing that fixed it

the other thing is i rebooted

update-alternatives --config libglx.so
There are 2 choices for the alternative libglx.so (providing /usr/lib64/xorg/modules/extensions/libglx.so).

Selection Path Priority Status

0 /usr/lib64/xorg/modules/extensions/nvidia/nvidia-libglx.so 100 auto mode

  • 1 /usr/lib64/xorg/modules/extensions/nvidia/nvidia-libglx.so 100 manual mode
    2 /usr/lib64/xorg/modules/extensions/xorg/xorg-libglx.so 50 manual mode

but now i’m able to run gimp without OPENBLAS_NUM_THREADS=1