Matlab hangs when closing/exiting on Ubuntu 16.10

조회 수: 21 (최근 30일)
Hector Flores Rodriguez
Hector Flores Rodriguez 2017년 1월 11일
댓글: Richard Snape 2023년 2월 13일
I can start and use Matlab with no problem, except when trying to exit. When I hit the close button on the top right corner or type the exit command, Matlab hangs. I have to manually kill the process. No problems exiting when starting matlab without jvm.
Is there any fix or workaround to this problem?
I am currently using Xubuntu 16.10 and Matlab 2016b (student license).
$ uname -a
Linux smallhead 4.8.0-34-generic #36-Ubuntu SMP Wed Dec 21 17:24:18 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

채택된 답변

Vandana Ravichandran
Vandana Ravichandran 2017년 1월 19일
This crash may be related to an issue with the graphics drivers. You may be able to resolve this problem by running the following command in MATLAB:
>> opengl save software
Restart MATLAB and see if the problem still persists.
If the problem still persists or you never get a MATLAB command prompt at all, check to make sure that your user account has access to a home directory.
If your account is using symbolic links to point to a home directory, remove them and grant access to an actual home directory and the issue should be resolved.
  댓글 수: 1
Hector Flores Rodriguez
Hector Flores Rodriguez 2017년 1월 19일
That worked like a charm. It seems like the issue was that my laptop's graphics wasn't cutting it.
Thank you!

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Breno Odnan Souza
Breno Odnan Souza 2021년 9월 23일
Hello there!
I have the same problem on my Ubuntu 20.04
Running "opengl save software" did work for opening and closing MATLAB only, but the problem persists when Simulink is used.
I have tried Opening MATLAB, (1)running "opengl save software", (2) opening simulink, then (3)Closing simulink, and finally closing MATLAB. After this process, MATLAB still hangs in the background, even when doing (1) after (2) or after (3).
Is there any variant of this fix for simulink?
The following messages appear on the terminal running MATLAB (wheter or not (1) is used)
MATLAB is selecting SOFTWARE OPENGL rendering.
Gtk-Message: 19:09:09.593: Failed to load module "canberra-gtk-module"
MESA-LOADER: failed to open iris: /usr/lib/dri/iris_dri.so: não é possível abrir arquivo compartilhado: Arquivo ou diretório inexistente (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri)
failed to load driver: iris
MESA-LOADER: failed to open kms_swrast: /usr/lib/dri/kms_swrast_dri.so: não é possível abrir arquivo compartilhado: Arquivo ou diretório inexistente (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri)
failed to load driver: kms_swrast
MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: não é possível abrir arquivo compartilhado: Arquivo ou diretório inexistente (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri)
failed to load swrast driver
Currently running R2021b - Trial license
$ uname -a
Linux Charizard-L 5.11.0-34-generic #36~20.04.1-Ubuntu SMP Fri Aug 27 08:06:32 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
  댓글 수: 4
Chao Wang
Chao Wang 2022년 3월 11일
I've experienced similar issue, and the program would return after hanging about five minutes. Matlab R2021b on Ubuntu Linux 20.04, run with the following bash script at the command line prompt:
#!/bin/bash
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu/dri/
export MESA_LOADER_DRIVER_OVERRIDE=i965
matlab -desktop
After I closed the Matlab window, the terminal would hang for about five minutes before it could return to the prompt. I used top to see that the matlab process takes 100% of one of the CPU cores, and the corresponding thread is shown to be "MCR 0 interpret." Hope this info would help identify the problem.
Richard Snape
Richard Snape 2023년 2월 13일
Just adding to this thread. Even with the opengl save software suggestion, I still experience long hangs on typing exit at the MATLAB prompt. This is with MATLAB R2022a, on Ubuntu 20.04. All I did in the MATLAB session was open a project (using openProject('myName.prj') to set up a path.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by