Why does MATLAB crash when plotting in Linux with Nvidia drivers?
Show older comments
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
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:
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
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!