I am working on an embedded OpenGL graphics application running on an Intel Atom z530 with the GMA500 graphics hardware. (It's my understanding that the GMA500 is a PowerVR under the hood, but I'm not sure). I'm running with the Tungsten Graphics "Gallium" driver on Ubuntu 9.10 Karmic Koala. Oh, you should also know that i have 1 GB of available system memory.
Here's the problem: I have code that allocates a bunch of 512x512x32 textures (about 1MB apiece). When I get to about 118-120 of these, I get an "out of memory" error from OpenGL, and I also get this message on the console: "error: INTEL_ESCAPE_ALLOC_REGION failed".
This, along with simple measurements while looking at "top", indicate to me that I'm hitting up against an ~128MB limit for textures. The odd thing is this: this architecture doesn't have dedicated video ram, it's shared. And I can tell for sure that OpenGL is using system ram for the textures because I can see the "free" ram going down in 'top'. So why would I get an 'out of memory' error? I would expect opengl to simply use more of my available system ram. Why would there be such a hard limit? Is there some way to change what this apparent "hard limit" is set to?
I'm looking for an OpenGL driver expert to discuss this with at the moment, thx for your patience.
In the mean time, when you say you have 1Gb of available system memory, is that before running the program or at the point where it fails?
There's been some discussion about this, and there is a possibility that between mip map generation and memory stride requirements there may be more than 1MB being used for each 512x512x32 texture. From your description it sounds like a simple test for you would be to try allocating 64x64x32 or 128x128x32 or 256x256x32textures and calculate how much memory you getto usebefore running out.
This might give us some more clues and maybe lead you to an optimum size for textures in your app.
Dimensions: # of Textures Created: Approx. Mem Usage (MB):32x32x16 42,351 86.734864x64x16 1,982 16.2365128x128x16 1,982 64.9462256x256x16 1000 131.072512x512x16 247 129.4991024x1024x16 60 125.8292048x2048x16 13 109.052