nV News Forums


nV News Forums (http://www.nvnews.net/vbulletin/index.php)
-   NVIDIA Linux (http://www.nvnews.net/vbulletin/forumdisplay.php?f=14)
-   -   Texture memory, nvidia, and opengl (http://www.nvnews.net/vbulletin/showthread.php?t=13243)

dcomes 06-11-03 09:48 PM

Texture memory, nvidia, and opengl
So I'm working in a embedded like env. I have a nVidia Geforce 4 card
with 128 MB of ram and a linux system with 128 MB of ram. Due to the
"embeded like" env, the linux system does not have a swap file system.
Which would be fine except the nVidia Open GL driver seems to keep 2
copies of each texture I load in memory. One copy in system memory
and one copy in card memory. Meaning I malloc some memory to read in
the texture file from disk, hand it to open gl, then free the memory I
malloc'ed to hold the texture. It seems as if the driver keeps one
copy of the texture in system memory and keeps one in the card memory.

I am working with OpenGL 1.3 drivers on linux from nVidia's web site.
I would like to know if anyone else has seen this problem? And is
there a way to stop this from happening.

To be completely fair, I'm about 70% confidient that this is my
problem, so my description above may be incorrect. But nVidia does
not open source their open GL drivers so without dumping assembler and
reverse engineer the driver, I think my decription above is accurate.

Any help or insite would be greatly appreciated.


BenjyD 06-12-03 06:33 AM

I think all openGL drivers would show the same behaviour. In a normal setup, the texture memory on the card is only a cache for most-used textures. As you load textures and draw them, they are cached in texture memory for speed. If the set of textures being used is larger than texture memory, then some textures will have to be swapped in and out of texture memory from main memory.

If you don't keep a copy of every texture in system memory, then when the drivers swap a texture out of texture memory it has to be copied back across the AGP bus, which is *slow*. So the drivers maintain two copies, allowing the texture to be 'swapped' out of texture RAM by just overwriting it and keeping a pointer to the current valid, fastest, copy.

You could possibly use the VAR extension to just use texture memory to store textures, although I've never tried this.

dcomes 06-12-03 10:53 PM

Can you give me any information on this var extension? Like where I can find info on it?

All times are GMT -5. The time now is 03:11 AM.

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