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

7 次查看(过去 30 天)
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
编辑:MathWorks Support Team 2023-12-8
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 个评论
LeChat
LeChat 2018-6-6
编辑:MathWorks Support Team 2021-6-24
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 2019-5-1
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.

请先登录,再进行评论。

更多回答(1 个)

LeChat
LeChat 2018-6-6
编辑:MathWorks Support Team 2021-5-19
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.

类别

Help CenterFile Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息

产品


版本

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by