Go Back   nV News Forums > Linux Support Forums > NVIDIA Linux

Newegg Daily Deals

Reply
 
Thread Tools
Old 11-05-08, 03:05 AM   #1
Original_PQ
Registered User
 
Join Date: Dec 2002
Location: Lappeenranta, Finland
Posts: 14
Default Bug: 177.80 DDX leaks shm segments on Linux

I have an OpenGL application, that creates an FBO, runs some processing, and quits. It never shows a window on screen, since it's just data processing. To run tests on the program, I wrote a script to run it with different parameters 7380 times. This would take 5-6 hours to complete. No more than a single instance of my program is running at any time. Since this program is for unpublished research, I cannot attach the source code.

After 5000-6000 runs, the FBO setup starts to fail with GL_FRAMEBUFFER_UNSUPPORTED_EXT. Restarting X server and reloading the nvidia kernel module seems to reset the situation, I can again run over 5000 iterations, until it starts to fail.

From the attached report, you can see the following in X server log:
Code:
(EE) NVIDIA(0): Failed to obtain a shared memory identifier: No space left on
(EE) NVIDIA(0):     device
Indeed, my system now has 4100 allocated POSIX IPC shared memory segments, of which 4093 have been allocated by the X server. An excerpt from ipcs -m:
Code:
------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status      
0x00000000 390889901  root      777        4096       1                       
0x00000000 390955438  root      777        4096       1                       
0x00000000 391053743  root      777        4096       1                       
0x00000000 391152048  root      777        4096       1                       
0x00000000 391217585  root      777        4096       1                       
0x00000000 391315890  root      777        4096       1                       
0x00000000 391414195  root      777        4096       1                       
0x00000000 391479732  root      777        4096       1                       
0x00000000 391578037  root      777        4096       1                       
0x00000000 391676342  root      777        4096       1                       
0x00000000 391741879  root      777        4096       1                       
0x00000000 391840184  root      777        4096       1                       
0x00000000 391938489  root      777        4096       1                       
0x00000000 392004026  root      777        4096       1
This is clearly a shm segment leak in the DDX.

There are some shm related reports on the forums here, but they seem to be either with a BSD system, or failing to provide any shm IPC in the first place.

Please advice how to circumvent the problem. Can I simply ipcrm the shm segments the X server creates during the execution of my program?
Attached Files
File Type: log nvidia-bug-report.log (116.7 KB, 79 views)
Original_PQ is offline   Reply With Quote
Old 11-06-08, 01:24 AM   #2
xbobmx
Registered User
 
Join Date: May 2003
Posts: 191
Default Re: Bug: 177.80 DDX leaks shm segments on Linux

Quote:
Originally Posted by Original_PQ View Post
Can I simply ipcrm the shm segments the X server creates during the execution of my program?
I doubt it.

Changing how resources are allocated/freed usually perturbs such things, for better or for worse. Try destroying (or not destroying) the FBO(s), GL context(s), and any other GL-related resource you may have allocated before exiting the program, and see if that helps.
xbobmx is offline   Reply With Quote
Old 11-06-08, 02:36 AM   #3
Original_PQ
Registered User
 
Join Date: Dec 2002
Location: Lappeenranta, Finland
Posts: 14
Default Re: Bug: 177.80 DDX leaks shm segments on Linux

Quote:
Originally Posted by xbobmx View Post
I doubt it.

Changing how resources are allocated/freed usually perturbs such things, for better or for worse. Try destroying (or not destroying) the FBO(s), GL context(s), and any other GL-related resource you may have allocated before exiting the program, and see if that helps.
True, ipcrm just marks the segments for removal, but they are really deleted only when the X server quits.

Having all X and GL resources wrapped in C++ classes, I'm fairly sure I already do all possible clean-ups on exit. But I will check once more. I can also try, if showing the X window (for nothing) would make the DDX clean up.

Not doing selected clean-ups is a funny idea, for which I don't have the time. I've already worked around this problem by scripting my test set into two halfs, and restarting X in between, before shm gets exhausted. Luckily I don't have to run those at my regular desktop.
Original_PQ is offline   Reply With Quote
Old 11-06-08, 05:00 AM   #4
Original_PQ
Registered User
 
Join Date: Dec 2002
Location: Lappeenranta, Finland
Posts: 14
Default Re: Bug: 177.80 DDX leaks shm segments on Linux

Showing the window does not help, neither does a one second delay between program invocations.
Original_PQ is offline   Reply With Quote
Old 06-22-09, 08:13 AM   #5
Torgeir
Registered User
 
Join Date: Mar 2004
Posts: 1
Default Re: Bug: 177.80 DDX leaks shm segments on Linux

Hi,

This seems similar to our findings. We have an application that runs a few times a day to produce some graphics. This is rendered offscreen using FBOs.

After a few months the X-server becomes unresponsive and the application fails to allocate FBOs and all rendered results are black.

We would really appreciate if nVidia could look into this potentially severe issue, and it seems related to the use of FBOs which is commonly used these days in all kinds of applications.

Best regards,
- Torgeir Lilleskog
Torgeir is offline   Reply With Quote
Old 06-22-09, 10:08 AM   #6
AaronP
NVIDIA Corporation
 
AaronP's Avatar
 
Join Date: Mar 2005
Posts: 2,487
Default Re: Bug: 177.80 DDX leaks shm segments on Linux

Is this still a problem with 185.14.18?
AaronP is offline   Reply With Quote
Old 06-26-09, 03:59 AM   #7
Original_PQ
Registered User
 
Join Date: Dec 2002
Location: Lappeenranta, Finland
Posts: 14
Default Re: Bug: 177.80 DDX leaks shm segments on Linux

Quote:
Originally Posted by AaronP View Post
Is this still a problem with 185.14.18?
The problem in my use case seems to be fixed.

Thanks.
Original_PQ is offline   Reply With Quote
Old 06-26-09, 10:43 AM   #8
AaronP
NVIDIA Corporation
 
AaronP's Avatar
 
Join Date: Mar 2005
Posts: 2,487
Default Re: Bug: 177.80 DDX leaks shm segments on Linux

Quote:
Originally Posted by Original_PQ View Post
The problem in my use case seems to be fixed.
Cool, thanks for confirming that.
AaronP is offline   Reply With Quote

Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 06:28 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 1998 - 2014, nV News.