PDA

View Full Version : OpenGL makes application crash when using RADEON videocard.



AimedNuu
09-23-2016, 08:11 AM
Hello.

Our team is developing a graphical client for a MMORPG game and we're experiencing issues with users which have Radeon video cards.
OpenGL randomly crashes on glBindTexture and we fail to get any stack trace or anything more useful other than that. All we know that they all have one thing in common - Radeon video cards.

Are there any known pitfalls with Radeon videocards and OpenGL that we should know?

mhagain
09-23-2016, 09:52 AM
The Truth on OpenGL Driver Quality (http://richg42.blogspot.ie/2014/05/the-truth-on-opengl-driver-quality.html)

An eye-opener about AMD and driver quality for OpenGL
(http://www.leadwerks.com/werkspace/topic/11651-an-eye-opener-about-amd-and-driver-quality-for-opengl/)
Dolphin Emulator and OpenGL drivers - Hall of Fame/Shame (https://dolphin-emu.org/blog/2013/09/26/dolphin-emulator-and-opengl-drivers-hall-fameshame/)

These are only 3 examples, but AMD don't have the best track record when it comes to OpenGL driver quality.

That said, it's also possible that the AMD driver is behaving correctly, but other drivers are accepting a texture (or combination of state) that they shouldn't. You'd need to give more information on those crashes; determine what texture or textures are being bound when it crashes, if it's a single texture inspect it for anything that looks like it might be a cuase, if it's multiple textures determine what they have in common, etc.

AimedNuu
09-23-2016, 11:02 AM
I'm sorry I made a mistake. Crash happens after glTexImage2D call.

mhagain
09-23-2016, 12:59 PM
Again, look at your parameters to the glTexImage2D call. You'll find something common across your crash cases. It would help if you'd post a sample of one or two such calls; otherwise we'll have to guess as to possible causes.

AimedNuu
09-26-2016, 04:51 AM
Again, look at your parameters to the glTexImage2D call. You'll find something common across your crash cases. It would help if you'd post a sample of one or two such calls; otherwise we'll have to guess as to possible causes.


glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB5_A1, width, height, 0, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV, pixels); pixels is ushort here*
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA4, width, height, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8, pixels); pixels is uint here*

width and height were checked through logging, they have valid values, just as everything else. All values are just valid and it's having really random crashes. Sometimes it does binding and just works....
We're getting a bit hopeless on this.

P.S. Updating drivers didn't help the guy. We'll probably buy ourselves RADEON videocard and try to reproduce on our own machine, since this happened only to our testers with RADEON videocards.

Silence
09-27-2016, 12:07 AM
GL_UNSIGNED_SHORT_1_5_5_5_REV


AFAIK, this is not a texture format. You cannot use it here.

Check this (https://www.khronos.org/registry/gles/extensions/EXT/EXT_read_format_bgra.txt).

Also, are you sure you have no errors returned by OpenGL ?

mhagain
09-27-2016, 04:09 AM
AFAIK, this is not a texture format. You cannot use it here.

No, it is a valid format: https://www.opengl.org/sdk/docs/man2/xhtml/glTexSubImage2D.xml

type
Specifies the data type of the pixel data.
The following symbolic values are accepted:
GL_UNSIGNED_BYTE,
GL_BYTE,
GL_BITMAP,
GL_UNSIGNED_SHORT,
GL_SHORT,
GL_UNSIGNED_INT,
GL_INT,
GL_FLOAT,
GL_UNSIGNED_BYTE_3_3_2,
GL_UNSIGNED_BYTE_2_3_3_REV,
GL_UNSIGNED_SHORT_5_6_5,
GL_UNSIGNED_SHORT_5_6_5_REV,
GL_UNSIGNED_SHORT_4_4_4_4,
GL_UNSIGNED_SHORT_4_4_4_4_REV,
GL_UNSIGNED_SHORT_5_5_5_1,
GL_UNSIGNED_SHORT_1_5_5_5_REV,
GL_UNSIGNED_INT_8_8_8_8,
GL_UNSIGNED_INT_8_8_8_8_REV,
GL_UNSIGNED_INT_10_10_10_2, and
GL_UNSIGNED_INT_2_10_10_10_REV.

AimedNuu
09-27-2016, 04:57 AM
It is a valid format and it works on all NVidia cards, so...
If this would be a major AMD Catalyst driver and OpenGL problem, this would be generally known. But it seems like we're the only ones having this issue...
And this randomness with crashes makes it really hard.

mhagain
09-27-2016, 05:53 AM
Can you post an example of the values that your width and height parameters have? Where I'm coming from here is that I'm wondering if you have non-power-of-two textures, width or height that are not nice multiples of 4, or similar.

As a gneral rule AMD drivers are actually OK (despite my previous post) until you try to do something unusual or unexpected - that's when they hit a codepath that might not have been robustly tested, and that's when they explode.


glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA4, width, height, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8, pixels); pixels is uint here*This, for example, is something I'd consider unusual. One doesn't often see the GL_UNSIGNED_INT_8_8_8_8 packed pixel type (GL_UNSIGNED_INT_8_8_8_8_REV is more common) and it's also doing a format conversion in the driver from 32-bit 8-bit per channel to 16-bit 4-bit per channel.

Silence
09-28-2016, 02:11 AM
No, it is a valid format: https://www.opengl.org/sdk/docs/man2/xhtml/glTexSubImage2D.xml

OK. I need some refreshes here.

cali9x
10-02-2016, 10:28 PM
AFAIK, this is not a structural format. You can not use it here.

Check this.

Also, are you sure you have no errors returned by OpenGL?

AimedNuu
10-08-2016, 02:49 PM
AFAIK, this is not a structural format. You can not use it here.

Check this.

Also, are you sure you have no errors returned by OpenGL?


Sadly enough application crashes right after the call. So getting error out of OpenGL is not an option : /

Values are:
1 crash on: 427х316
4 crashes on: 44x44
2 crashes on: 427x44
2 crashes on: 44x316
1 crash on: 427x316

AimedNuu
10-08-2016, 05:42 PM
It seems like it crashes on older AMD videocards, like:
AMD Radeon 5570HD
AMD Radeon HD 6700 Series