Hello, I'm working on mobile game industry.
We are suffering from opengl link program failure.....
I think this is because of too many opengl program count.
If we applied lru cache for shader count, the problem was gone...
I wanna know "Limit of program(compiled shader) count is determined based on memory usage at the time?"
And "Can too many program(compiled shader) count impact to other gpu resource like texture, constant buffer...? ( Memory size that compiled shader takes up is fixed?? )"
Hi Sung Jin,
What driver version is used on devices where you see this problem? Some older drivers have an internal 16MB heap for shader code, and if this is exceeded then you might see linking errors. The heap is is dedicated to shader programs so use of other resources would not impact it. If you are hitting this limit, the only work-around is to delete programs -- which in practice usually means implementing some kind of LRU cache like you say. I was curious what driver version(s) you see this problem on as my expectation is that most vendors shipping R19 or newer will have a fix for this.
Mmm... I don't know what driver version is. Error report came from user... Size of heap for shader code is 16mb or umlimeted?... Or it depends on drivers?
It depends on the driver; older ones use a fixed-size 16MB heap as mentioned, while newer drivers use an expandable heap thus there's no fixed limit. I wish I could tell you an specific driver version for where the fix is in place, but unfortunately it differs between vendors. I would be surprised to hear problems on post-R19 drivers however. :)
Then, If it has no fixed limit, it still doesn't impact to other gpu resource. right?
Not beyond sharing the available physical RAM, same as other resources, no.
Um... Ok, I have one more question...
All processes share internal 16MB heap for shader code? If I play game for a while and drop it to background and launch another game. Then Shade codes compiled in game i played still takes up the heap memory and it impacts to another game i played after the game?
No, the heap is an unique allocation for each process. Not shared between processes.