• Advertisement
Sign in to follow this  

wglMakeCurrent leaking memory on ATI cards

This topic is 4510 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi All, I've noticed the severe memory leaks when constantly switching from one GL render context to another using the wglMakeCurrent proc. I can reproduce it only on ATI cards (drivers ranging from official Catalyst to non-official Omega drivers), Nvidia drivers do not leak in such circumstance. I've tested this on several ATI cards with several different applications (to be sure it's not my software leaking memory). In order to reproduce such behavior all you need to do is to create several windows and for each of them to create the GL context. Then render each context sequentially, one after another, in the same thread. Did anyone else notice such mem leaks, or I'm the only one who uses multiple GL contexts?

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by wazoo
Hi All,

I've noticed the severe memory leaks when constantly switching from one GL render context to another using the wglMakeCurrent proc. I can reproduce it only on ATI cards (drivers ranging from official Catalyst to non-official Omega drivers), Nvidia drivers do not leak in such circumstance. I've tested this on several ATI cards with several different applications (to be sure it's not my software leaking memory).

In order to reproduce such behavior all you need to do is to create several windows and for each of them to create the GL context. Then render each context sequentially, one after another, in the same thread.

Did anyone else notice such mem leaks, or I'm the only one who uses multiple GL contexts?
Yeah, I remember seeing a thread about this problem a while ago... I was under the impression that it has been fixed since then. If not I suggest contacting ATI's developer relations and sending a minimal example program demonstrating the problem.

EDIT: Here is that thread... from October of last year. It doesn't mention if it has been fixed or not but it does say at the end that ATI would look into it.

Share this post


Link to post
Share on other sites
Well, it seems that ATI didn't contact the guy (from the old thread) who also had this very problem and the problem is still unresolved, he says he tries to minimize the number of context switches. It won't work in my case because one of the things that is required from the thing I'm working on is the real-time display of the data in the viewports.

Share this post


Link to post
Share on other sites
You can get around the context switches by creating one window and rendering to multiple viewports, instead of using multiple windows.

Share this post


Link to post
Share on other sites
Quote:
Original post by wazoo
Well, it seems that ATI didn't contact the guy (from the old thread) who also had this very problem and the problem is still unresolved, he says he tries to minimize the number of context switches. It won't work in my case because one of the things that is required from the thing I'm working on is the real-time display of the data in the viewports.
The very last post (on second page with default posts per page) says that they replied and said they would look into it. I suggest you write up a quick program that demonstrates it and send it in to ATI's developer relations to remind them about it. Hopefully it will be fixed soon after that and released in an upcoming driver set.

Share this post


Link to post
Share on other sites
Quote:
Original post by Kalidor
Quote:
Original post by wazoo
Well, it seems that ATI didn't contact the guy (from the old thread) who also had this very problem and the problem is still unresolved, he says he tries to minimize the number of context switches. It won't work in my case because one of the things that is required from the thing I'm working on is the real-time display of the data in the viewports.
The very last post (on second page with default posts per page) says that they replied and said they would look into it. I suggest you write up a quick program that demonstrates it and send it in to ATI's developer relations to remind them about it. Hopefully it will be fixed soon after that and released in an upcoming driver set.


I contacted the guy and he told me the dev team never replied, just like in my case, I've sent them the email describing everything in detail and got no reply. I've spend a day installing different versions of their official drivers and saw that the amount of leaked memory actually grows larger in the newer driver builds.

Share this post


Link to post
Share on other sites
Quote:
Original post by Dave Hunt
You can get around the context switches by creating one window and rendering to multiple viewports, instead of using multiple windows.


I wish it were so easy :) The reason I'm using the multi-window viewport setup is because it allows to create any set of viewport windows with any size, position and z-index which isn't possible (or too complex to event bother to implement) with a single window setup. The good thing is that besides OGL we also support D3D9 as the renderer, so we will switch to D3D rendering on ATI cards to avoid the ATI driver leaks.

Share this post


Link to post
Share on other sites
well, to drop opengl just like that isn't such a good idea. if there are workarounds, i'll use them. but this attitude from ATI is not to be forgiven.

Share this post


Link to post
Share on other sites
I've had the same problem, and didn't hear from ATI either. Since I'm doing some other stuff now, I haven't looked into it further yet.

Share this post


Link to post
Share on other sites
Quote:
Original post by wazoo
I contacted the guy and he told me the dev team never replied, just like in my case, I've sent them the email describing everything in detail and got no reply. I've spend a day installing different versions of their official drivers and saw that the amount of leaked memory actually grows larger in the newer driver builds.
That is pretty disappointing. [sad] Oh well, hopefully they will get around to fixing it someday. Until then, good luck with the rest of your project.

Share this post


Link to post
Share on other sites
Quote:
Original post by rick_appleton
I've had the same problem, and didn't hear from ATI either. Since I'm doing some other stuff now, I haven't looked into it further yet.

Seriously, I got so sick of this attitude towards OpenGL Developers from ATI I switched to NVIDIA. ATI kept saying EXT_framebuffer_object was "comming soon", but no such luck. I swapped my R9500 Pro for an 6800GT, and have never looked back.

I know what you're thinking, It could be being worked on or who knows, it could be a massive architectural problem (although i dont think it is) but if a company doesnt have the professional courtesy to reply with a short e-mail either explaining that this isn't a priority fix or that its a major fix and one shouldn't expect a patch anytime soon, then I dunno. Developing for OpenGL is hard enough as is (with the extensions mechanism and no official SDK etc) without these kinds of problems.

I state clearly, NVIDIA treat OpenGL developers as first class citizens, not prioritizing D3D developers as ATI have shown.

EDIT: As of the latest OpenGL drivers EXT_framebuffer_object is supported (thanks Boku San) But my point was the NVIDIA developers had a basic prelimary implementation to play with months before Catalyst 5.8 (maybe even a year?)

[Edited by - silvermace on September 8, 2005 3:46:54 AM]

Share this post


Link to post
Share on other sites
I've been contacted by ATI representatives and I've sent them the sample application that causes the memory leak on context switch. Can anyone with the recent ATI video card and official drivers try to reproduce this issue on their PCs? I'm attaching the sample application and the sources. The more people test this issue the better understanding of the issue we will have.

Sources:
sources

Application exe:
application

Share this post


Link to post
Share on other sites
Quote:
Original post by silvermace
EDIT: As of the latest OpenGL drivers EXT_framebuffer_object is supported (thanks Boku San) But my point was the NVIDIA developers had a basic prelimary implementation to play with months before Catalyst 5.8 (maybe even a year?)
I agree it was annoying having to wait for FBO support, but keep in mind that nvidia users got it so early from a leaked beta driver. Then the drivers were still beta for a while after that. FBO support on ATI cards started with Cat5.7 drivers. And it was only a few months, the spec was only approved on Jan. 31 of this year. It sure did seem like a year though... (and I've been so busy lately I still haven't had the chance to try FBO out [sad]).
Quote:
Original post by wazoo
The more people test this issue the better understanding of the issue we will have.
I'll try to test it out later.

Share this post


Link to post
Share on other sites
I tried to download the exe, but got a message saying the site was not allowed any more downloads. If you keep having problems with that feel free to contact me, and I can host it for you.

Share this post


Link to post
Share on other sites
Send me the files: silvermace at g mail dot com
I will host it on my server for ya (i have alot of diskspace and alot of bandwidth).

Share this post


Link to post
Share on other sites
Hi.

I have bought lately Radeon 9550 128/128 and Im starting to regret it.
I have the same problem with often wglMakeCurrent calls. Im trying to create 3D modeller, MDI based, couple of windows representing diferrent ortho mode and perspective view. I need to call wglMakeCurrent on every frame, obviously.
Only solution which I currently see is to create couple of threads, but I cant imagine to make it now, especially when I think about syncronisation required.
Ive been working today with my app for about 2 hours, I've experienced 40mb memory leak from wglMakeCurrent. This is a SHOCK, to let such error survive. Sorry, Im running out of patience too. I've been trying to contact ATI, Customer Care sent me to developer page, but I cant find there any email adress, or link when I can contact someone.

Here is mine simple sample of the problem (contains exe and code in devcpp):
http://rogdush.republika.pl/test.rar
Feel free to check it out and see the growing 4-8kb memory on one sec.

Im looking forward on some response, maybe some one have some additional info concering solution or when ATI would like to take care of that problem?

[Edited by - rogdush on September 12, 2005 9:51:32 PM]

Share this post


Link to post
Share on other sites
Quote:
Original post by rogdush
[...]Im trying to create 3D modeller, MDI based, couple of windows representing diferrent ortho mode and perspective view. I need to call wglMakeCurrent on every frame, obviously.[...]
I don't have anything else to say about wglMakeCurrent problem, but if what you're doing is like a typical 3d modeller setup you don't need to make separate windows for the different views. Just use different viewports.

Share this post


Link to post
Share on other sites
The wglMakeCurrent leak has been known for years, comes up on the opengl.org forums every couple of months, and has been reported a billion times to ATI - without any reaction.

This behaviour from ATIs dev department is beyond my comprehension. Fixing it would probably not even take a day.

It doesn't happen on all ATI setups, though. Some combinations of chipsets and drivers are affected, others not.

I don't have an ATI card here right now, but has anyone tried what happens if you destroy the context without ending the process ? Does the driver free the memory (ie. does it keep track of the entire allocated memory, and releases it on context destruction), or is it a hard memory leak ? In the former case, one could destroy and recreate the contexts in regular intervals as a workaround.

Share this post


Link to post
Share on other sites
Quote:
Original post by Yann L
The wglMakeCurrent leak has been known for years, comes up on the opengl.org forums every couple of months, and has been reported a billion times to ATI - without any reaction.


Its not too nice to hear...

Quote:
Original post by Yann L
I don't have an ATI card here right now, but has anyone tried what happens if you destroy the context without ending the process ? Does the driver free the memory (ie. does it keep track of the entire allocated memory, and releases it on context destruction), or is it a hard memory leak ? In the former case, one could destroy and recreate the contexts in regular intervals as a workaround.


I've just tried context recreation, but it didnt free even some memory.

Quote:
Original post by Kalidor
I don't have anything else to say about wglMakeCurrent problem, but if what you're doing is like a typical 3d modeller setup you don't need to make separate windows for the different views. Just use different viewports.


Unfortunatelly, I have made MDI ortho windows, and I have made some relations to it, so changing onto viewports is not so easy.

Anyway, if people are trying to force ATI for such a long time to fix it, then probably our talk here wont do any diference. So, only alternative left for me is to change card to GeForce and do not recommend ATI Radeon anymore.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement