cancel
Showing results for 
Search instead for 
Did you mean: 

OpenGL & Vulkan

spaceengineer
Journeyman III

OpanGL GL_ATI_meminfo replacement?

Hi there! I am SpaceEngine simulator developer. You can download it for free at http://spaceengine.org

SpaceEngine is based on OpenGL. It uses aggressive video memory management, by occupying all available VRAM for its resources (procedurally generated textures and VBOs). Thus I need to know total VRAM size and current available amount. Some years ago there was extension GL_ATI_meminfo, which did the work, but now it is not available. How do I query available VRAM now on AMD? No problem with NVidia (GL_NVX_gpu_memory_info extension).

Interesting fact: despite on the fact that GL_ATI_meminfo is not available, its constants like GL_TEXTURE_FREE_MEMORY_ATI are still present and works (I'm using GLEW to access extensions). This query returns believable values, but generates GL_INVALID_ENUM:

GLint mem[4] = { 0, 0, 0, 0 };

glGetIntegerv(GL_TEXTURE_FREE_MEMORY_ATI, &mem[0]);

It seems that functionality is still in the driver, but was somehow removed (not completely) from OpenGL implementation. Any chance to get is back to work? Or maybe some replacement extension / API exists? Thanks for advice!

PS: I have RX 580 8 GB, Windows 7, but stuck at driver 17.12.2, because newer drivers produces heavy lags on the whole system every 3-5 seconds. This is known issue for which I didn't found solution as well.

0 Likes
5 Replies
dipak
Big Boss

Hi spaceengineer,

I've whitelisted you. Also I'm moving this thread to OpenGL & Vulkan forum. 

0 Likes
xhuang
Staff

Actually,  we do support GL_ATI_meminfo for Workstation graphic cards only. May i know the usage case of getting the VRAM size ?

0 Likes

I need to know how much VRAM is free to start releasing old resources. My engine uses LRU cache for all generated resources with common memory. On low-end machines with 1 GB terrain textures may quickly eat out all VRAM, but then user leave planet, textures get removed to free memory for stars and galaxies.

Also at startup, some software and OS may take up to 500 Mb of VRAM. In this case app noticing user that it needs all available VRAM, and asking to close unnecessary apps.

0 Likes
mirh
Adept III

GL_ATI_meminfo seems to have been nuked at the end of 2012

On the other hand you should be able to get total memory size with WGL_AMD_gpu_association

I'm not sure what you could do for monitoring "used/free one" then... Some direct3d, windows or adl api maybe?

0 Likes

Yes, I already use WGL_AMD_gpu_association to get total VRAM size, but I need to know how much is left free time to time (once every 50-100 frames or so).

0 Likes