Skip to content

Instantly share code, notes, and snippets.

@tapyu
Last active May 27, 2024 18:15
Show Gist options
  • Save tapyu/0b73a46d3e1b19bd601a168e0568755f to your computer and use it in GitHub Desktop.
Save tapyu/0b73a46d3e1b19bd601a168e0568755f to your computer and use it in GitHub Desktop.
Matlab workarounds

Matlab workarounds

Matlab sucks on Linux, and this gist gather all workaround you need

Problem

Action

References

Tested on

Error using matlab.internal.webwindow (line 333) MATLABWindow application failed to launch. Unable to launch the MATLABWindow application On terminal, type
    cd /usr/local/MATLAB/R2017b
    cd cefclient/sys/os/glnxa64
    mkdir exclude
    mv libglib-2.0.so* exclude/
  
Mathworks ...
Matlab window to small (for 4K screens) On Matlab, type
    >> s = settings;s.matlab.desktop.DisplayScaleFactor
    >> s.matlab.desktop.DisplayScaleFactor.PersonalValue = 2
  
On terminal, type
    resolution=$(xdpyinfo |  awk '$1 ~ /^resolution/{print $2}' | awk -Fx '{print $1}')
    new_resolution=$((2*$resolution))
    xrandr --dpi ${new_resolution}
  
Mathworks Ubuntu
Gtk-Message: 02:44:30.889: Failed to load module "canberra-gtk-module" On Ubuntu, sudo apt install libcanberra-gtk-module. This location must be found by Matlab at runtime. If you install it and it is still not loaded, it is probably becuase its location, /usr/lib/x86_64-linux-gnu/gtk-2.0/modules/libcanberra-gtk-module.so is not in the linker search path. Firstly, reboot you system. If it is still to found by the linker, you can try to symlink it as the same name in /usr/lib, which is usually included in the linker search path. You can check this default linker search path running ldconfig -v. Therefore, you can run
      sudo apt install libcanberra-gtk-module
      cd /usr/lib
      sudo ln -s /usr/lib/x86_64-linux-gnu/gtk-2.0/modules/libcanberra-gtk-module.so libcanberra-gtk-module.so
      
My mind. Ubuntu
MATLAB is selecting SOFTWARE OPENGL rendering. Open Nvidia settings app -> PRIME profiles -> Select NVIDIA (performance mode) Myself. Ubuntu. Windows server display protocol = $XDG_SESSION_TYPE=x11. NVidia GPU= Quadro P620. NVIDIA Driver Version: 535.129.03

Futher information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment