CDAT / cdat

Community Data Analysis Tools
Other
174 stars 68 forks source link

meshfill plot broekn with bg=0 #804

Closed doutriaux1 closed 9 years ago

doutriaux1 commented 9 years ago

the following script creates two different png depending if we use bg = True or not

bg=True leads to the correct output in bg mode, and incorrect in non bg mode

See attached pngs first is good and second is bad

import cdms2,vcs

bg=True

f=cdms2.open("data_portrait.nc")
s=f("variable_3")       
M=f("variable_115")

x=vcs.init()        
y=vcs.init()
x.scriptrun("mesh_bug.json")
x.setcolormap("bl_rd_12")
m=x.getmeshfill("portrait")
x.plot(s,M,m,bg=bg)
x.png("mesh_%i" % bg)
y.plot(s,M,m,bg=not bg)
y.png("mesh_%i" % (not bg))

now interestingly enough turning the bg to False leads to a core dump following this output:

radeon: Failed to allocate a buffer:
radeon:    size      : 1 bytes
radeon:    alignment : 1 bytes
radeon:    domains   : 2
radeon: Failed to allocate a buffer:
radeon:    size      : 1 bytes
radeon:    alignment : 1 bytes
radeon:    domains   : 2
Segmentation fault (core dumped)

mesh_1 mesh_0

aashish24 commented 9 years ago

@doutriaux1 what machine is this? Is this remote or local?

doutriaux1 commented 9 years ago

data and json and script can be found at: https://github.com/doutriaux1/VTKLearning/tree/master/uvcdat_bugs

@dlonie I will need your help on this one I think.

doutriaux1 commented 9 years ago

it is on my local ubuntu. Confirmed by other users (@durack1) on RH6

alliepiper commented 9 years ago

Do you both have the same graphics card? The radeon errors make me wonder if this is hardware related...

aashish24 commented 9 years ago

what driver you are using @doutriaux1 We should be able to re-produce this bug if it is not hardware specific. @dlonie can you try the script and the data?

alliepiper commented 9 years ago

Sure. It'll be a bit before I can get to it, but sometime today.

durack1 commented 9 years ago

I don't think this has anything to do with hardware, as it happens both on a real and virtual machine..

alliepiper commented 9 years ago

Yep, it's not hardware, I can reproduce this on my nVidia system.

doutriaux1 commented 9 years ago

@dlonie I don't think it's hardware related either happens on Ubunut/RH/Mac and a VM I would be really surprising if all these computers had the exact same graphic card (although I guess it is possible)

durack1 commented 9 years ago

One of the concerning issues too, is that exporting to different formats yields completely different graphics.. So pngs seem to look fine, thought pdf and ps files have labels rotated differently and this difference is concerning..

alliepiper commented 9 years ago

That is a known issue unrelated to this one, see #503.

durack1 commented 9 years ago

Yeah thanks @dlonie I was aware there was already an issue open on that.. Was just too lazy to link to it..

alliepiper commented 9 years ago

The problem seems to be triggered by the call to configureEvent() (since bg has no interactor, configureEvent never gets called). Still tracking down the specifics...

alliepiper commented 9 years ago

Removing the call to self.canvas.clear() in configureEvent (VTKPlots.py 173) fixes the issue. Is this call needed?

(note, I also had to add y.scriptrun("mesh_bug.json");y.setcolormap("bl_rd_12") to the test_bg.py script to get colors correct).

doutriaux1 commented 9 years ago

let me look into this, I think if we don't do a clear then plots never get cleared in the GUI and they get drawn on top of each other. The real question I guess is why do we get half a plot when calling clear.

alliepiper commented 9 years ago

You're right, the clear does need to be there for the GUI. I'm guessing that the configureEvent is being called at a bad time, possibly while in the middle of building up the scene.

doutriaux1 commented 9 years ago

I think this has been fixed by #873