Why does MATLAB crash when plotting in Linux with Nvidia drivers?

5 views (last 30 days)
MATLAB crashes when I try creating plots with the crash log below.  Why is this happening?
Stack Trace (from fault):
[ 0] 0x00007f9b156558fa /usr/lib64/libstdc++.so.6+00686330 _ZSt28_Rb_tree_rebalance_for_erasePSt18_Rb_tree_node_baseRS_+00000474
[ 1] 0x00007f98ec185ca4 /opt/matlab/R2016b/bin/glnxa64/libmwosgserver.so+02296996
[ 2] 0x00007f98ee7b6f6c /opt/matlab/R2016b/bin/glnxa64/libmwhandle_graphics.so+21462892 _ZN2hg16CompositeCommand7executeEPNS_23CommandExecutionContextE+00000044
[ 3] 0x00007f98ec1905e1 /opt/matlab/R2016b/bin/glnxa64/libmwosgserver.so+02340321 _ZN2hg19OsgSceneServerProxy14executeCommandEiPNS_7CommandE+00000033
[ 4] 0x00007f9abcce212e /opt/matlab/R2016b/bin/glnxa64/libnativehg.so+00045358 Java_com_mathworks_hg_peer_JavaSceneServerPeer_doExecuteCommand+00000030
[ 5] 0x00007f9ad79bdd98 <unknown-module>+00000000
[ 6] 0x00007f9ad79b1058 <unknown-module>+00000000
[ 7] 0x00007f9ad79b1706 <unknown-module>+00000000
[ 8] 0x00007f9ad7fa4224 <unknown-module>+00000000

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 7 Dec 2023
Edited: MathWorks Support Team on 8 Dec 2023
This crash is caused by a bug in the NVIDIA Linux drivers.  
NVIDIA is reporting and we have confirmed that the crash is addressed starting in version 390.67 of NVIDIA's long-lived driver branch and it is also addressed starting in version 396.24 of NVIDIA's short-lived driver branch.
In order to address the crashes, consider the following two workarounds:
1. Download and install the most recent graphics driver for your graphics card.
The 396.24 driver release can be found here:
https://www.nvidia.com/Download/driverResults.aspx/133859/
The 390.67 driver release can be found here:
https://www.nvidia.com/Download/driverResults.aspx/134859/
Please note that these two driver releases above may not be the most recent, but they should be sufficient for resolving this crash.
2. Consider starting MATLAB with the "-softwareopengl" flag in the command line. See the documentation page below for further details:
https://www.mathworks.com/help/matlab/ref/opengl.html
  2 Comments
LeChat
LeChat on 6 Jun 2018
Edited: MathWorks Support Team on 24 Jun 2021
Should we update to this version:
or this one:
which seems more recent (I updated last week to the v390.59 which just came out but the issue persisted...)?
LeChat
LeChat on 1 May 2019
FYI, in case an update of your Linux is causing weird issues, I would recommand to remove the GPU driver (I have an Nvidia) and reinstall it from scratch. Here are the commands I recently used when I switched to Ubuntu 19.04 (from Ubunut 18.10):
sudo apt purge --autoremove '*nvidia*'
sudo apt-get update
sudo apt-get upgrade
ubuntu-drivers devices
nvidia-settings
sudo apt install nvidia-settings
sudo reboot
Hope this helps.

Sign in to comment.

More Answers (1)

LeChat
LeChat on 6 Jun 2018
Edited: MathWorks Support Team on 19 May 2021
As previously said, this crash is caused by the Linux Nvidia driver. As a general rule, update the driver of your Nvidia GPU to late version (see https://www.nvidia.com/Download/index.aspx?lang=en-us).
A workaround option is to use opengl, which you can do by opening Matlab using the following command in the Terminal:
matlab -softwareopengl
If you want to use this "workaround option" on a more durable basis, you can save the following in Matlab command window:
opengl('save','software')
so you do not need the "-softwareopengl" flag everytime you open Matlab.
To switch back to the "normal mode", which would be to use the Nvidia driver, then do:
opengl('save','hardware')
Hope this helps.

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Products


Release

R2018a

Community Treasure Hunt

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

Start Hunting!