[QUOTE=Dark Photon;1287557]Ok first, glMapBuffer() returning NULL doesn’t necessarily mean there is no remaining virtual memory. But (on NVidia drivers), it may indicate that there is insufficient “pinned memory” left to satisfy the request.
AFAIK, the NVidia driver locates GL buffer objects either in GPU (on-device) memory or in CPU pinned memory (you can easily see this if you install a message callback using glDebugMessageCallback() – see this wiki link), and under some circumstances, they can migrate from one memory space to the other. Mapping a buffer on NVidia GL drivers automatically demotes the buffer object to pinned memory by default (IIRC), if it wasn’t already there.
Pinned memory is a special type of virtual memory (as you probably already know) which is not paged. Other names for “pinned memory” include: page-locked memory (on Linux) or non-paged memory or non-paged pool (on Windows). The opposite type of virtual memory is of course Paged memory (i.e. memory that can be paged out of physical RAM).
For OpenGL in general, no (OpenGL is a spec defining an API, not a driver implementation). However, a specific GL driver could potentially have a limitation like this.
…that said, on a 64-bit CPU (which your numbers suggest you’re running on), I’ve not read or heard of a general limitation pn the amount of pinned memory being that low. In fact, on the net you can find folks that have much more pinned memory than that reserved.
How much non-paged memory is your Window 7 boxed configured for, and what does it show for the limit? (see Task Manager -> Performance -> Kernel Memory : Nonpaged, and/or Process Explorer -> System Information -> Memory). This is typically going to be a small subset of your total virtual memory.
Also, what’s your “NonPagedPoolSize” set to (not sure if setting this on Win7 works or not)?:
Check out Process Explorer or poolmon for tools that should let you monitor your non-paged pool usage dynamically.
According to this Microsoft blog post and reference page, the max non-paged pool memory on Win7 64-bit is min( 75% * Amount of RAM, 128 GB):
so with the right config, you should be able to fix your problem (**), collectively allocating at most 96GB of RAM for pinned memory with your current installed RAM.
(**) …that is, unless there’s some limitation in CUDA or the NVidia drivers that you hit up against.[/QUOTE]
Thank you so much for the reply.
I was disturbed by other thing for a while. Sorry for the delayed response. I really appreciated the detailed answer and want to do some testing before I asked you more questions which also takes some time.
Following the answer, I read the two links you provided. It seems that default nonpaged pool size is 75% of RAM or 128GB. The paged pool size in win 7 is min(system commit limit, 384GB).
In Registery Editor, the NonPagedPoolSize is a DWORD, limited to 32bit, I cannot make it larger than 4GB.
According to Process Explorer, this is how our win 7 with 32GB RAM or 96GB RAM look like:
[ATTACH=CONFIG]1505[/ATTACH]
So the operating system’s default Nonpaged Limit is 16,777,216
This confused me.