bugGNU Octave - Bugs: bug #45028, Use...


bug #45028: Use "visible","off" for printing

Submitted by:  Michael Godfrey <godfrey>
Submitted on:  Tue 05 May 2015 04:35:36 PM UTC  
Category: Plotting with OpenGLSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Performance
Status: PostponedAssigned to: None
Originator Name: GodfreyOpen/Closed: Open
Release: devOperating System: Any

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


(Jump to the original submission Jump to the original submission)

Sat 23 Sep 2017 04:34:52 PM UTC, comment #18:

Andreas - see bug #50479. This affects Debian unstable and will affect Debian buster. All distributions are now using libglvnd, which breaks using OSMesa and Mesa together. Maybe now is the time to look at moving OSMesa support into a separate auxiliary executable and piping the OpenGL buffer to it.

Mike Miller <mtmiller>
Project Administrator
Sat 23 Sep 2017 01:24:30 PM UTC, comment #17:

@Mike: I'm using the OSMesa rendering on Debian stretch and jessie and wonder why you say there are problems on "any current Arch, Debian, or Fedora distribution"

Andreas Weber <andy1978>
Project Member
Wed 20 Sep 2017 06:23:15 PM UTC, comment #16:

The list of known problems with OSMesa keeps growing, marking this as postponed. OSMesa now doesn't work on any system with NVidia, any Ubuntu 14.04 system, any Windows system, and now any current Arch, Debian, or Fedora distribution. Someone is welcome to close this as won't fix if it doesn't seem likely that this will go anywhere.

Mike Miller <mtmiller>
Project Administrator
Wed 13 May 2015 07:41:56 PM UTC, comment #15:

As you know OSMesa is used with graphics_toolkit FLTK and Qt if "visible"=="off". But we have some other bug reports (http://wiki.octave.org/OSMesa#known_problems) which makes OSMesa a bad choice for users with proprietary Nvidia drivers or on windows.

Andreas Weber <andy1978>
Project Member
Sun 10 May 2015 07:52:02 PM UTC, comment #14:


Here is a summary of behavior with export LIBGL_DRI3_DISABLE=1
set running locally on fedora 21 with Intel HD 6000 Graphics:

Using fltk and visible on, print zzz.pdf gives seg fault
as before. zzz.pdf contains an empty frame.

Using qt and visible on, print zzz.pdf results in X11 crash!

So, fltk really works fully locally and through ssh.

Through ssh qt does not display plots correctly, but
visible off print zzz.pdf works.

Matlab has quite a lot of commentary about defective
graphics systems and through ssh it complains that
software Opengl has been set and some features will not
be available...

Michael Godfrey <godfrey>
Project Member
Sun 10 May 2015 12:27:41 PM UTC, comment #13:

I can add that visible off is also not needed
with this fix. During a print command the figure
flickers around as it does locally, but this is more
obvious since it takes longer.

I still think that incorporating the sequence
in the print command:

1. save visible state.
2. If it was on, turn it off
3. do the print command
4. restore original visible state, if needed.

May be a good idea.

Michael Godfrey <godfrey>
Project Member
Sun 10 May 2015 12:20:02 PM UTC, comment #12:

Also, with


print commands seem to generate the correct
output even though the plot that appears on the local
screen is incomplete.

This was done with graphics_toolkit('qt')

Switching to graphics_toolkit('fltk')
appears to fix the incomplete plot problem.
And, the edit menu items seem to work i.e. can turn
grid lines on and off, ...

The incomplete qt plotting could be the same bug as

Based on this limited testing this makes ssh usage
essentially fully functional for fltk.

The problem with X11-mesa was reported here:

Michael Godfrey <godfrey>
Project Member
Sun 10 May 2015 11:57:17 AM UTC, comment #11:

Finally, setting:


Causes glxgears to run and also causes octave
to at least try to produce a plot when ssh'ed
to remote machine.

So far,
plot(1:100) produces the expected plot, but turning
on grid only displays the first 2 grid lines...

The first test was:

>> plot(1:100)

libGL error: failed to authenticate magic 73
libGL error: failed to load driver: i965


Matlab also produces similar error messages...

Michael Godfrey <godfrey>
Project Member
Wed 06 May 2015 12:57:45 PM UTC, comment #10:

If using ssh login to a remote machine and:

octave --no-gui
h = figure ("visible", "off");

Octave hangs. The gdb bt at hang is attached as: fig_bt.

When this is run locally, no figure appears, but the
(visible off) figure is created.

This was done with X11Forwarding on.

(file #33940)

Michael Godfrey <godfrey>
Project Member
Wed 06 May 2015 09:31:48 AM UTC, comment #9:

Printing invisible figures currently doesn't work on windows so this may not be a cross-platform solution ATM.

FTR, instead of using copyobj, you may want to use something like

hdl2struct/struct2hdl is basically what is used in copyobj.

Pantxo Diribarne <pantxo>
Project Member
Tue 05 May 2015 06:28:34 PM UTC, comment #8:

By the way, whatever makes a remote figure("visible","off")
hang should not be required I think. So, fixing that
would be useful in any case.

Michael Godfrey <godfrey>
Project Member
Tue 05 May 2015 06:26:10 PM UTC, comment #7:

John: Right. If it helps with that too, great!

Michael Godfrey <godfrey>
Project Member
Tue 05 May 2015 06:14:10 PM UTC, comment #6:

Well, we need some way to print on Windows systems. See https://savannah.gnu.org/bugs/index.php?44916

John W. Eaton <jwe>
Project Administrator
Tue 05 May 2015 06:04:58 PM UTC, comment #5:

But, John, do not let this distract you now
unless it helps solve a blocking bug for 4.0

Michael Godfrey <godfrey>
Project Member
Tue 05 May 2015 06:03:38 PM UTC, comment #4:

I just tried a remote login and the visible off/on
sequence and, even though it does not display a plot
when run locally, it hangs at:
h=figure(1,"visible", "off")

So, not so good, but still possibly an improvement over
the current flickering. And, something like this should
work. Maybe, even, John's idea is closer.

Michael Godfrey <godfrey>
Project Member
Tue 05 May 2015 05:57:31 PM UTC, comment #3:

When I did this manually, by:

h = gcf();
figure(h, "visible", "off");
print zzz.pdf
figure(h, "visible", "on");

I did not see any brief display. I was going to try:
fn = tempname ();
_osmesa_print_ (h, fn, "pdf");

but since print zzz.pdf worked, I did not try it.
Would that have worked better/differently?

nyhow, a brief display of the plot is not as bad as the
current flicker and color change. But, it probably will
not work remotely.

Michael Godfrey <godfrey>
Project Member
Tue 05 May 2015 05:27:00 PM UTC, comment #2:

Sorry, I edited and failed to change the initialization of HNEW to be TMP_FIG.

John W. Eaton <jwe>
Project Administrator
Tue 05 May 2015 05:25:30 PM UTC, comment #1:

Perhaps we can use something like this

Then the original figure would not flicker or be removed.

Unfortunately, as things currently work this briefly displays the copy of the figure on the screen. But we might be able to fix that by modifying the copyobj function to accept a list of properties to apply after making the copy. Then it would be

to create an invisible copy of an existing figure FIG.

Using unwind_protect should properly manage the object so it is deleted no matter how control leaves the print function.

John W. Eaton <jwe>
Project Administrator
Tue 05 May 2015 04:35:36 PM UTC, original submission:

Now that, for qt and fltk, printing works with visible off, it
would be useful if the print command used this capability. The
advantages would include:

1. More efficient plot processing.
2. No 'flickering' of the plot while print runs. Actually, the
plot would disappear and then reappear.
3. Remote printing would work again, without having to switch
from use of OpenGL, etc., and without X11.
4. This would also "fix" bug #44823.

It appears after a few experiments, that this can be done
in print.m, before the actual print code:
h =gcf();
--- check for visible on or off---, if on:
figure(h, "visible", "off");
--- print code---
reset visible state.

A complication is that all the rror paths will need to
be checked.

Michael Godfrey <godfrey>
Project Member


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):

Attached Files
file #33940:  fig_bt added by godfrey (15KiB - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by andy1978 (Posted a comment)
  • -unavailable- added by pantxo (Posted a comment)
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by godfrey (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 20 Sep 2017 06:23:15 PM UTCmtmillerStatusNone=>Postponed
    Wed 06 May 2015 12:57:45 PM UTCgodfreyAttached File-=>Added fig_bt, #33940

    Back to the top

    Powered by Savane 3.1-cleanup1