Blank images and "dead pixels" in Makie

In the meantime, here’s a snippet of the errors that the scene variable captures:

Here’s the gist:

https://gist.github.com/dalarev/8b7b213e177bd5fe6b97aabff7db401b

Man, not sure what to do next on this one. Removed and reinstalled AMD drivers to ensure I had the latest, and the problem persists.

Considering just purchasing an Nvidia card but that could have its own compatibility issues because my build is ~8 years old.

I’ll try plotting heatmaps with other packages like plotly or other to determine if its a flat-out GPU issue or compatibility with Makie.

I’m 90% sure we can fix this… it’s just a bit hard to debug remotely :frowning:
Your warnings look like coming from an old context… Is that after you already opened a couple of plots/windows? But, that should also considered to be a bug, since I should avoid doing any operations on an old context…

So, maybe this is the perfect use case for CodeXL:


I got it running in a few minutes without problems! :slight_smile:
Just installed it, started a new debug project with these settings:

-e "using Makie; wait(display(heatmap(rand(10, 10))))"

Then started the debugging, and when the plot showed up, you need to press break, and then you can look at all used textures etc… Maybe you can also activate some more debug output to see, if there is some broken state.

Awfully convenient tool…great find!

OK, so here’s what I see - with the caveat that, before running, CodeXL told me my GPU was not supported but it ran the tests anyway; even the user guide said that older cards e.g. Raden 6000 would need an older version of the software along with the older Catalyst drivers.

Here is the Makie window generated: clearly a null pixel at (x,y) = ~(6.5,5.5)

image

Textures 2 & 3 do not show any image, and two of the other 8 don’t look quite right:

Texture 5. I have no idea what is going on here and frankly I don’t know if this is normal or not.

…and Texture 4, which is basically a repeat of what was in the Makie window.

Really? It should be red, like in my picture… It would be interesting to figure out, if the problem is in the colormap (should be a 1D texture) or in the red data texture

You mean Texture 6? My Texture 6 looks just like yours. Interestingly, even though there are some black pixels, none of them are exactly black - unlike in Figure 4, where the null pixel is exactly black.

Well, that does point to problems in the color texture… Isn’t there any texture, that matches the color scale?

Yes, Texture 7:

image

I guess as another data point, I plotted these arrays in MATLAB with about 5 different methods (imagesc, pcolor, mesh, surf, etc.) and they all worked perfectly.

That’s not too surprising…
Can you try:

using Makie, GeometryTypes, GLMakie, Random
using GLMakie.GLAbstraction: Texture
GLMakie.GLAbstraction.Texture(x::Texture) = x
AbstractPlotting.convert_attribute(cm::Texture, ::key"colormap") = cm
Random.seed!(777)
colors = rand(RGBAf0, 5, 10)
A = rand(5, 10)
colors2 = to_colormap(:viridis)
m = GLNormalUVMesh(SimpleRectangle(0, 0, 2, 1))
m.texturecoordinates .= UV{Float32}[(-0.2, 1.2), (1.2, 1.2), (-0.2, -0.2), (1.2, -0.2)]
scene = Scene()
display(scene) # important, since you can't create a Texture without an active window..
# Textures are also just valid for one window, so make sure not to use old ones...
meshes = map((:clamp_to_edge, :mirrored_repeat, :repeat)) do repeat
    x = Texture(colors, minfilter = :nearest, x_repeat = repeat)
    mesh(m, color = x, shading = false, scale_plot = false)
end;

heatmaps = map((:clamp_to_edge, :mirrored_repeat, :repeat)) do repeat
    x = Texture(colors2, minfilter = :nearest, x_repeat = repeat)
    heatmap(0..2, 0..1, A, colormap = x, interpolate = false, scale_plot = false)
end;
heatmaps2 = map((:clamp_to_edge, :mirrored_repeat, :repeat)) do repeat
    x = Texture(colors2, minfilter = :linear, x_repeat = repeat)
    heatmap(0..2, 0..1, A, colormap = x, interpolate = false, scale_plot = false)
end;
vbox(
    hbox(meshes...),
    hbox(heatmaps...),
    hbox(heatmaps2...),
    parent = scene
)

And post the result?

A few null pixels floating around in the heatmaps:

Pretty suspicious, that the dead pixels are getting displayed in brown in my version, even though the colormap doesn’t contain any brown… I’m guessing I’m having a problem in my shader, that leads to undefined behaviour, which nvidia handles gracefully, but gets messed up in old AMD drivers… or something like that…

That makes a lot of sense.

can you try ]add GLMakie#sd-fixAMD ? I simplified the shader a bit and removed suspicious complications, so there should be much less room for undefined behaviour :wink:

3 Likes

No dead pixels to be found… Trying previous heatmap examples now.

It works! I still occasionally get a ton of errors starting with “## is not a GLenum” and pointing to ModernGL, but heatmaps seem to be working!

The original Makie example works perfectly, too. I’m marking your last post as the solution.

This took quite a bit of time and effort, I very much appreciate you walking through the troubleshooting with me, Simon!

2 Likes

Thanks for patiently going through with it :wink:
I do need to have you make one final test though… I removed some functionality, to be sure to fix it on the first try, and I’ll need to bring that functionality back, hopefully without bringing back the bug :smiley:

Allright, I pushed a new commit, hopefully that still works… If you could be so nice to give it one last test run?
Also maybe test:

contour(rand(10, 10), fillrange =true)