Single thread workaround and ATI cards

Hi all

I’m building an app using jogl that uses multithreading, and I’m using a laptop with an ATI Mobility Radeon 9000. I’m familiar with problems concerning ATI cards and multithreading in jogl, and I know that this problem is solved by using the single thread workaround when making a context current. However, from time to time I get the famous “Error making context current” exception, with a WGL error code, and the program crashes. I had posted to this forum a topic relative to this some time ago, but at that time I thought that it was a thread scheduling problem…

Has anyone using an ATI card gets the same, even rarely? Also, does this “ATI workaround solution” fix a problem that occurs when calling display() from different threads, or does it fix a problem that occurs when other threads are running (even if they don’t call display())? I notice that in my case the problem is caused by using more than one threads in the app, and it’s doesn’t depend on different threads calling display().

Could this be related to driver issues? The laptop is an ACER Travelmate, and the drivers for the graphics card have not been updated since 2003…

If anyone can give a hint, I’d be grateful. I’ve run out of ideas with this one…

JOGL’s “single-threaded workaround” has nothing to do with other threads running at the same time as your application. It pushes the OpenGL work done in GLCanvas.display() and GLJPanel.display() to one particular thread. You can call display() from any thread and the workaround will take effect.

Are you running the latest release of JOGL (1.1.1)?

Have you looked on your notebook vendor’s web site or guru3d.com to see if there are any modified / more recent drivers from ATI that will install on your notebook?

I’m running the las jogl version, but I wasn’t aware of guru3d.com (thanks!). I downloaded a new driver and installed it on the laptop. (At last, new driver!). So far, it seems to work without problems, but the problem I mentioned in my previous post, is not a consistent one, it appears occasionally. So much more testing is needed.

In the beginning I thought that the problem was caused because of calling synchronoysly wait() or notify() for a thread inside the display method, and that thread also invoked display() again. However that didn’t seem to be the issue, because the same problem occured when I used just a timer which called display() every 30 ms.

Ken, considering your experience, do you think that this is a driver problem or does it have to do with the application itself?

Unlucky me! It just reappeared. So I guess driver and jogl version are out of the suspects…

It’s possible it’s a bug in JOGL’s OpenGL context handling but frankly I think it’s more likely to be a bug in ATI’s OpenGL drivers. Do you have a self-contained test case which reproduces the problem on your machine? Could you file an Issue with the JOGL Issue Tracker (you’ll need to be an Observer of the project) and attach it if so?

Another possibility I just thought of is that your application may be causing OpenGL errors which are causing the drivers’ context handling to break. Have you tried installing the DebugGL pipeline to see whether any exceptions are thrown?

I installed the DebugGL pipeline and it actually found an error which in at least one case caused the context current problem. There was a wrong glPolygonMode call (gl.glPolygonMode(GL.GL_POLYGON_MODE,GL.GL_FILL)) instead of the correct one (gl.glPolygonMode(GL.GL_FRONT,GL.GL_FILL)). Up until now, the problem has not appeared again, so it must have been the cause for the entire situation. However, i’ll keep testing it, just in case…(with the DebugGL pipeline on).

Thanks again Ken! With your hints, not only the problem is (possibly :wink: ) resolved, but my graphics card has a new driver (since 2003). Maybe I’ll send an e-mail to acer, to finally update the driver at their site…