Why does MATLAB crash when plotting in Linux with Nvidia drivers?
17 views (last 30 days)
MathWorks Support Team on 27 Jul 2017
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
MathWorks Support Team on 13 Jun 2022
Edited: MathWorks Support Team on 24 Jun 2021
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
. The 390.67 driver release can be found
2. Consider starting MATLAB with the "-softwareopengl" flag. See this
page for further details.
More Answers (1)
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:
If you want to use this "workaround option" on a more durable basis, you can save the following in Matlab command window:
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:
Hope this helps.