使用 matlab 的奇点容器中的分段违规

Segmentation violation in Singularity Container with matlab

为了在集群上部署,我将一个名为 leverjs 的学术软件打包在一个 Singularity 容器中。它带有从软件中获取 运行 的预构建 Matlab 包。我已经通过配方文件在容器内安装了 Matlab 运行time R2017b、leverjs 和所有依赖项。

Leverjs对home路径下的Image文件进行转换分析,自动绑定到Singularity容器

但是当 运行从容器中调用 leverjs 并调用预编译的 matlab 代码时,Matlab 因分段违规而崩溃。 Leverjs 本身 运行s on electron。 如果所有依赖项和 Matlab 运行时间都在容器中,Matlab 如何导致段错误?

食谱文件: Bootstrap: docker 来自:ubuntu

%setup
  hostname -f > $SINGULARITY_ROOTFS/etc/build_host

  # or  #wget http://ssd.mathworks.com/supportfiles/downloads/R2017b/deployment_files/R2017b/installers/glnxa64/MCR_R2017b_glnxa64_installer.zip and unzip to location
    #mkdir matlab
    #unzip MCR_R2017b_glnxa64_installer.zip -d matlab

  cp -R /home/cewa/Downloads/matlab ${SINGULARITY_ROOTFS}/matlab

%post
    apt-get update 
apt-get -y upgrade
apt-get -y install git \
nodejs \
npm \
wget \
libgtk-3-dev \
libxss1 \
libgconf2-4 \
libnss3 \
libasound2-dev

# install git lfs
wget https://github.com/git-lfs/git-lfs/releases/download/v2.5.2/git-lfs-linux-amd64-v2.5.2.tar.gz
mkdir git-lfs
tar -C git-lfs -xf git-lfs-linux-amd64-v2.5.2.tar.gz
cd git-lfs
./install.sh
git lfs install

#install matlab dependency
cd ..
cd matlab
./install -mode silent -agreeToLicense yes

mkdir -p /opt/local
cd /opt/local
git clone --depth=1 https://git-bioimage.coe.drexel.edu/opensource/leverjs.git
git clone --depth=1 https://git-bioimage.coe.drexel.edu/opensource/leverUtilities.git
cd leverjs
npm update
npm run postinstall
chmod +x -R prebuilt/

## change path in CmdLoop.js to correct matlab path
cd leverjs
sed -i 's@/usr/local/MATLAB/R2017b/@/usr/local/MATLAB/MATLAB_Runtime/v93@' CmdLoop.js


##add cleanup
echo $PWD
cd /
echo $PWD
rm -rf git-lfs-linux-amd64-v2.5.2.tar.gz
rm -rf git-lfs
rm -rf matlab
apt clean
apt autoclean
apt autoremove

%runscript
cd /opt/local/leverjs
npm start

%apprun leverjs
cd /opt/local/leverjs
exec npm start


%apprun leverjs-server
exec node server.js --port=3000 "$@"

matlab 故障转储:

------------------------------------------------------------------------
       Segmentation violation detected at Thu Sep 20 15:29:40 2018
------------------------------------------------------------------------

Configuration:
  Crash Decoding      : Disabled - No sandbox or build area path
  Crash Mode          : continue (default)
  Default Encoding    : US-ASCII
  GNU C Library       : 2.27 stable
  Host Name           : X8DA3
  MATLAB Architecture : glnxa64
  MATLAB Root         : /usr/local/MATLAB/MATLAB_Runtime/v93
  MATLAB Version      : 9.3.0.713579 (R2017b)
  Operating System    : Linux 4.15.0-34-generic #37-Ubuntu SMP Mon Aug 27 15:21:48 UTC 2018 x86_64
  Processor ID        : x86 Family 6 Model 26 Stepping 5, GenuineIntel

Fault Count: 1


Abnormal termination:
Segmentation violation

Register State (from fault):
  RAX = 0000000000000000  RBX = 00007ffc5c5a6a30
  RCX = 0000000000000000  RDX = 0000000000000001
  RSP = 00007ffc5c5a6990  RBP = 00007ffc5c5a69b0
  RSI = 00000000000000d8  RDI = 00007ffc5c5a6a48

   R8 = 00007ffc5c5a6bf0   R9 = 0000000000000001
  R10 = 0000000000000004  R11 = 00007fdcbf45c070
  R12 = 0000000000000001  R13 = 0000000003905600
  R14 = 00007ffc5c5a6a48  R15 = 00007ffc5c5a6a30

  RIP = 00007fdcb6e64c9e  EFL = 0000000000010206

       CS = 0033   FS = 0000   GS = 0000

    Stack Trace (from fault):
    [  0] 0x00007fdcb6e64c9e                 bin/glnxa64/libmwfoundation_usm.so+00056478 _ZN10foundation3usm10management10thisthread16ContextActivatorC1INS0_5scope3MvmEEERNS1_7ContextIT_EE+00000014
    [  1] 0x00007fdcb5795c36                            bin/glnxa64/libmwmcr.so+00457782
    [  2] 0x00007fdcb57cc0df                            bin/glnxa64/libmwmcr.so+00680159 _ZN11mcrInstance27feval_on_interpreter_threadEPKciPP11mxArray_tagiS4_+00000063
    [  3] 0x00007fdcb57d0051                            bin/glnxa64/libmwmcr.so+00696401 _ZN11mcrInstance18CallMATLABFunctionEPKciPP11mxArray_tagiS4_PNSt15__exception_ptr13exception_ptrE+00000129
    [  4] 0x00007fdcb57d0293                            bin/glnxa64/libmwmcr.so+00696979 _ZN11mcrInstance10EvalStringERKSbIDsSt11cha
7b5788                            bin/glnxa64/libmwmcr.so+00587656
    [ 20] 0x00007fdcb57b5a93                            bin/glnxa64/libmwmcr.so+00588435 _Z12mcr_run_mainRKN5boost9function0IiEEbb+00000243
    [ 21] 0x00007fdca3b135a8                       bin/glnxa64/libmwMVMLocal.so+00427432
    [ 22] 0x00007fdcb546e38d                            bin/glnxa64/libmwmvm.so+02507661
    [ 23] 0x00007fdcb5a926bd                        bin/glnxa64/libmwmclbase.so+00386749 mclRunMain+00000989
    [ 24] 0x00007fdca478bf02                         bin/glnxa64/libmwmclmcr.so+02191106 mclStandaloneGenericMain+00001074
    [ 25] 0x00007fdcbff84bd2                   bin/glnxa64/libmwlaunchermain.so+00048082
    [ 26] 0x0000000000408b06           /opt/local/leverjs/prebuilt/matlabPollDB+00035590
    [ 27] 0x00007fdcbf3e6b97                    /lib/x86_64-linux-gnu/libc.so.6+00138135 __libc_start_main+00000231
    [ 28] 0x0000000000404544           /opt/local/leverjs/prebuilt/matlabPollDB+00017732
    [ 29] 0x0000000000000000                                   <unknown-module>+00000000


    If this problem is reproducible, please submit a Service Request via:
        http://www.mathworks.com/support/contact_us/

    A technical support engineer might contact you with further information.

    Thank you for your help.

我希望这不是太离题了。

谢谢。

leverjs是一款可视化软件, 您需要 运行 具有 OpenGL 库支持的奇点。添加 --nv 选项

用于 %运行脚本 部分

$ singularity run --nv --nv  image_test.simg

对于 %app运行

$ singularity run --nv --app leverjs-server image_test.simg [args]

$ singularity run --nv --app leverjs image_test.simg

现在,如果您在使用此技术时遇到问题,可以从包含 GL standard libraries no vendor 的 docker 图像执行 bootstrap 并将其添加到选项 --nv

先试试这个,如果问题还没有解决,对于Singularity的容器问题已经不小了,你应该更详细地说明你对运行容器使用的命令。

这行也来自您的故障转储

Crash Decoding : Disabled - No sandbox or build area path

说Matlab找不到源文件