Q: Failure to load modules and drivers in Ubuntu 20.04 I recently installed Ubuntu 20.04 and MATLAB 2021b. In the middle of running a script, MATLAB crashes (there is nothing wrong with the script as it works perfectly fine in my MATLAB on Windows).
When I type ./matlab in the terminal, I receive these messages.
MATLAB is selecting SOFTWARE OPENGL rendering.
Gtk-Message: 08:28:19.310: Failed to load module "canberra-gtk-module"
MESA-LOADER: failed to open nouveau: /usr/lib/dri/nouveau_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri)
failed to load driver: nouveau
MESA-LOADER: failed to open kms_swrast: /usr/lib/dri/kms_swrast_dri.so: cannot open shared object file: No such file or directory (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: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri)
failed to load swrast driver

After this, MATLAB starts working. But as mentioned earlier, it crashes while running a script. What do I do to stop these failure messages from coming up and/or to stop MATLAB from crashing?

A: I have matlab 2021b and Ubuntu 20.04 and received the same error (plus some others) when opening matlab.I did these two things and it got rid of the error related to the "acnberra-gtk-module":

*

*Make sure canberra-gtk-module is installed: sudo apt install libcanberra-gtk-module

*before running matlab type: export GTK_PATH=/usr/lib/x86_64-linux-gnu/gtk-2.0
