Can Microsoft's WSLg (Windows Subsystem for Linux GUI) support running matlab?

218 次查看(过去 30 天)
Has anyone had success running matlab desktop applications using WSLg?I have not successfully configured it in windows 10 21H2, but after checking the previous information, I just need to install the necessary base library jdk, execstack to install matlab on WSL, but now I think the best way to implement the desktop matlab application is through WSLg, but lack of specific tutorials, I hope the successful ones can give Thanks in advance for the installation guide!
  4 个评论
Sunip Mukherjee
Sunip Mukherjee 2022-12-20
I managed to install R2020a on WSLg (Win 11 22H2) using the /path/to/installer/bin/glnxa64/install_unix_legacy installer. Post install everything works, matlab launches with GUI in soft OpenGL mode (can be overridden with -nosoftwareopengl). The only issue seems to be with Simulink. If I right click on the simulink window, the context menu pops up randomly somewhere else on the screen. Left click and mouse movement works normally. Performance seems to be fine as well.

请先登录,再进行评论。

采纳的回答

Thomas Carpenter
Thomas Carpenter 2022-12-1
As of next month (the Dec 13 2022 patch tuesday), it will be possible to use WSLg with Win 10 version 21H2. In fact you can get it now by installing the preview (KB5020030) from the microsoft update catalogue.
Microsoft have backported the WSL windows store version to support Windows 10 once that update is installed, allowing GUI apps to work. Once the store version is installed, you need to update the wsl distro to make sure the new MESA drivers are installed inside WSL.
With appropriate NVidia/AMD driver on the windows side of things, you can also get hardware OpenGL to load, however it seems quite unstable (it's fine with software OpenGL).
I'm using R2019a, which seems to have a version of libstdc++.so.6 that doesn't support the WSL2 graphics support, however this can be overcome by simply renaming MATLABs builtin version so that it uses the system library which does support it:
cd /usr/local/MATLAB/R2019a/bin/glnxa64/../../sys/os/glnxa64/
sudo mv libstdc++.so.6 libstdc++.so.6.orig
After that, launching MATLAB with matlab -nosoftwareopengl & loads correctly with hardware OpenGL support, however attempting to plot anything causes MATLAB to crash with a segmentation fault in the graphics driver.

更多回答(0 个)

类别

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

标签

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by