cancel
Showing results for 
Search instead for 
Did you mean: 

OpenGL & Vulkan

aferreira_bs
Adept I

AMD 5700XT OpenGL Driver Bug

Hi,

When using an AMD 5700XT and trying to run an OpenGL application i get a driver crash in the following line:

glDrawArraysInstanced(GL_PATCHES, 0, static_cast <GLsizei>(4), static_cast <GLsizei>(renderDepth));

if instead i change the primitive to GL_TRIANGLES then the drivers doesnt crash but the result is ofc not the expected one and i get GL_INVALID_OPERATION.

I tried an old AMD R9 280X using the same drivers, same OS, same code and same OpenGL version (4.6) and i got no issues there, everything ran as expected. I also tried a N* card and everything worked as well which points to me to a faulty OpenGL implementation on the 5700XT.

Thank you,

André

9 Replies

Re: AMD 5700XT OpenGL Driver Bug

did you try to use GL_ARB_debug_output, what errors's report will you see ?

Also consider to use Vulkan instead of OpenGL

0 Likes
Reply
aferreira_bs
Adept I

Re: AMD 5700XT OpenGL Driver Bug

Hi Andrey!

Yeah i am already using a debug callback function to log all the messages (and its working fine i because i am getting diagnostic and other small warnings from it). But when it gets to that line (i used the VS debugger), the screens go to black for a couple of seconds and then comes back again without any error messages. Is there some kind of GPU log in windows that i can check?

I will eventually move on to Vulcan but it will take a couple of months probably to convert all of the project so i am not yet in a position to do it sadly.

This is what i get on initialization (on the working cards), but nothing after initializing:

pastedImage_4.png

Looking at it i dont see anything worrying happening there.

Thanks!

0 Likes
Reply
dorisyan
Staff
Staff

Re: AMD 5700XT OpenGL Driver Bug

Hi ,

Thanks for your report !

could you please provide a minimal code which can reproduce this problem?

--

Best Regards

Doris Yan

0 Likes
Reply
aferreira_bs
Adept I

Re: AMD 5700XT OpenGL Driver Bug

Hi Doris,

As the glsl is a bit complex (1000+ lines) it would take me a bit of time to narrow it down to minimal code which still breaks the driver. Would a renderdoc capture on the working AMD card help?

Cheers,

André 

dorisyan
Staff
Staff

Re: AMD 5700XT OpenGL Driver Bug

Thanks André,

RenderDoc capture can also produce some info.

It would be better if you can provide a code that can reproduce it  

0 Likes
Reply
aferreira_bs
Adept I

Re: AMD 5700XT OpenGL Driver Bug

Hi Doris,

While doing a minimal code to try to give to you, i saw that a new driver was released. After installing it, it now crashes even before that line in a completely unrelated line, a regular glDrawElements with GL_TRIANGLES. This is completely unacceptable as i am wasting my time debugging this instead of developing.

0 Likes
Reply
dorisyan
Staff
Staff

Re: AMD 5700XT OpenGL Driver Bug

Oh, Maybe you can have a check on the related parameters and buffers?

Another way of checking whether it's an app issue is running your app on NV's platform.

0 Likes
Reply
aferreira_bs
Adept I

Re: AMD 5700XT OpenGL Driver Bug

As i stated in my original post:

"I tried an old AMD R9 280X using the same drivers, same OS, same code and same OpenGL version (4.6) and i got no issues there, everything ran as expected. I also tried a N* card and everything worked as well which points to me to a faulty OpenGL implementation on the 5700XT."

So i already tried another AMD card and NV card and everything works. For the record, the glDrawElements call has a simple shader which i can share (attached).

I am using a layered texture and this is the code which sets it up (with nShadowMaps = 4 and wShadowSize = 2048):

GLfloat border[] = { 1.0f, 0.0f ,0.0f, 0.0f };

glBindTexture(GL_TEXTURE_2D_ARRAY, depthMap);

glTexStorage3D(GL_TEXTURE_2D_ARRAY, 1, GL_DEPTH_COMPONENT32, wShadowSize, wShadowSize, nShadowMaps);
glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL);
glTexParameterfv(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_BORDER_COLOR, border);

glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_REF_TO_TEXTURE);

glFramebufferTexture(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, depthMap, 0);

Weirdly, it crashes only when rendering on the 2nd layer, rendering on layer 0 and 1 works fine. Anyway a driver should not crash even i used wrong buffer parameters, it should just not display correctly.

And on a more positive note, thank you for your quick replies dorisyan‌.

 

0 Likes
Reply
aferreira_bs
Adept I

Re: AMD 5700XT OpenGL Driver Bug

I take back my thank you for the quick reply, as i am waiting for answers for over one month now. I wish i could ask for a refund.