MATLAB GUI displays black with XQuartz

조회 수: 101 (최근 30일)
Hannah Rodriguez
Hannah Rodriguez 2022년 1월 4일
댓글: Kenneth 2025년 1월 10일
I am running MATLAB R2021a from a remote Linux server. I am able to bring up the GUI on my local macbook running macOS 12.1 using XQuartz and ssh, but the GUI usually displays black where the white usually is. Sometimes the window displays in the right color, (white) but only for a few seconds, then reverts back to the black. When it's black, I can still see the GUI, it's just very hard to read.
  댓글 수: 16
vip
vip 2023년 1월 5일
편집: vip 2023년 1월 5일
Same issue with R2022b. Remote system is Oracle Linux 8. Client is macOS 12.6.2 with XQuartz 2.8.4. I notice the windows turns black when I move the mouse and settles back to normal after a few seconds.
Andrew
Andrew 2023년 3월 8일
I'm having the same issue with two M1 Macs, both with OSVentura. Connecting to a Centos7 remote system with the latest XQuartz. The MATLAB (R2022a) GUI has a black background that makes it unusable. If I have dual monitors the window becomes normal when I move the cursor to the monitor that does not have the MATLAB GUI.

댓글을 달려면 로그인하십시오.

답변 (3개)

Sudhansu Sekhar
Sudhansu Sekhar 2023년 3월 13일
create a file "java.opts" in the home folder
mention the following inside that file
-Dsun.java2d.xrender=false
-Dsun.java2d.pmoffscreen=false
Restart matlab from home .
Check if it solves the issue.
I solved the same like this.
  댓글 수: 11
Zhenyu Ren
Zhenyu Ren 2024년 1월 4일
Thanks, this works for me too.
Farhan
Farhan 2024년 1월 7일
Works for me too, Thanks.

댓글을 달려면 로그인하십시오.


DavidePiccinini
DavidePiccinini 2023년 2월 2일
Similar issue for me R2020b running on Ubuntu Linux remote system. Client is MacOS 13.1 with XQuartz 2.8.5 (xorg-server 21.1.6).
The window become "normal" when I type on the keyboard in other programs (like I'm doing right now in Chrome), and turns black when I move the mouse.

Henrique Barbosa
Henrique Barbosa 2024년 11월 14일
편집: Henrique Barbosa 2024년 11월 14일
This is not an issue with the remote linux server, but with XQuartz (black background issue occurs with other applications too, not only Matlab).
On the XQuartz github:
They suggest to close XQuartz then issue this command on your mac:
defaults write org.xquartz.X11 enable_render_extension 0
Then run your application again (in our case, Matlab). This works for me, and seem like the right solution. The "defaults write" is stiky, so you only have to do this once.
By the way, if you see the following errors when starting Matlab (or other applications that use glx, like glxgears, etc...):
$ run_my_glx_application
MESA: error: ZINK: failed to choose pdev
glx: failed to create drisw screen
No matching fbConfigs or visuals found
This is what I did. First, I allowed GLX on XQuartz:
defaults write org.xquartz.X11 enable_iglx -bool YES
Second, I went to XQuartz => Settings => Security => and "Allow connections from network clients.
Finally, I added the following to my .bashrc (on the remote linux server):
# Fix OpenGL applications accessed remotely
LIBGL_ALWAYS_INDIRECT=1
I hope this helps.

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by