MATLAB with OpenGL through terminal?

조회 수: 55 (최근 30일)
Aaron Anderson
Aaron Anderson 2017년 7월 13일
답변: Sergio 2020년 12월 22일
I'm curious if it's possible to get MATLAB running with any form of OpenGL from the terminal. The issue is I am currently running MATLAB through a ssh client and incapable of running the normal desktop mode. I received a warning when creating some figures that OpenGL is not available when running through the terminal and there were lines running all over the figure's graphics objects.

답변 (2개)

Nagarjuna Manchineni
Nagarjuna Manchineni 2017년 7월 17일
When you are running MATLAB from the command line (any SSH client), you can use 'nodesktop' mode to run MATLAB command line mode. Use the following command to run MATLAB from terminal:
>> matlab -nodesktop -nosplash
There is no need to alter 'opengl' behavior until you are trying to launch some figures. You can disable launching figure windows by specifying the '' startup option. For example,
>> matlab -nodesktop -nosplash -noFigureWindows
Also, if you want to alter opengl behavior or want to execute any script while launching MATLAB, you can use the '-r' flag and execute the script. For example,
>> matlab -r "opengl software"
Refer to the following documentation link for more startup options:
  댓글 수: 2
Aaron Anderson
Aaron Anderson 2017년 7월 20일
A couple of issues that I run into:
Using
matlab -r "opengl software"
doesn't appear to work, as when I then type openGL info, it is missing the mesa software tag
Version: ''
Vendor: ''
Renderer: 'None'
RendererDriverVersion: ''
RendererDriverReleaseDate: ''
MaxTextureSize: 0
Visual: ''
Software: 1
HardwareSupportLevel: 'none'
SupportsGraphicsSmoothing: 0
SupportsDepthPeelTransparency: 0
SupportsAlignVertexCenters: 0
Extensions: {}
MaxFrameBufferSize: 0
opengl hardware doesn't work because it is apparently not supported at runtime on unix.
What I want to do is to make figures and use export_fig to create some PDFS. The issue is that without openGL I cannot properly render the images so they come out with lines running all over them.
Antal Horváth
Antal Horváth 2020년 11월 11일
Same problem here. I want to produce images by running a script via an ssh terminal. In the script the following lines are called:
hf = figure('visible', 'off');
clf(hf);
ax = axes('Parent', hf);
imshow(I, [], 'parent', ax)
hold(ax, 'on')
contour(structure, [.5 .5], 'b-', 'linewidth', linewidth, 'parent', ax);
exportgraphics(ax, [path '.png'], 'Resolution', 600);
This results in the warning:
Warning: MATLAB has disabled some advanced graphics rendering features by switching to software OpenGL. For more information, click <a href="matlab:opengl('problems')">here</a>.
and produces images with huge black padding.
Running this script locally in the MATLAB IDE, however, does not have this issue.

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


Sergio
Sergio 2020년 12월 22일
I have the same problem -- now working from home makes a significant problem. Mathworks support washes their hands with the usual "not supported" feature to run matlab over ssh. What?
Paraview works with server-side rendering so I can use the GPUs on my server, but Matlab does not...

카테고리

Help CenterFile Exchange에서 Graphics Performance에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by