get as much video memory I have

Hi all, I need to know how much video memory I have.
This is to analyze the results of a performance test.

Is it possible to get the amount of video memory using JOGL?

Thanks

Looking at JOGL’s API I don’t think it is possible. Googling for OpenGL video card memory turned up poor results. It looks like most of the ways that you check are through OS specific windowing APIs and isn’t part of the OpenGL spec.

from OpenGL.org:

[quote]If you need to find out how much video memory your video card has, you need to ask the OS. GL doesn’t provide a function since GL is intended to be multiplatform and on some systems, there is no such thing as dedicated video memory.
[/quote]
Humm… what do we know that is multi platform and allows us to talk to the graphics card… :wink:

System.out.println(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getAvailableAcceleratedMemory());

Mike

Yes it is possible, there are one extension doing this for NVIDIA and another one for ATI (GL_ATI_meminfo).

Is this any good?

there is no standardised way to query HW info via OpenGL. You could use JOCL and device.getGlobalMemSize() (and the other getFooMemSize() methods) but those are implementation dependent and usually return less than the physical mem size.

or take a look at those extensions:
http://www.opengl.org/registry/specs/ATI/meminfo.txt
http://developer.download.nvidia.com/opengl/specs/GL_NVX_gpu_memory_info.txt

(we usually don’t expose vendor dependent extensions in JOGL, but feel free to file a bug at http://jogamp.org/bugzilla/)

lspci -vvv is useful for this on Linux, XNVCTRLQueryAttribute for Nvidia too and this for Windows in general:

SDL has a nice method to do it:
http://www.libsdl.org/cgi/docwiki.cgi/SDL_VideoInfo

Is it possible to use SDL in an applet?, is to do like JOGL? (AppletLauncher)

Thanks for your answers

Java binding of SDL is really crappy (and SDL itself becomes crappy too), I think it could be a source of inspiration to find a nice way of querying the total video memory. However, in my humble opinion, you will never find a nice cross-platform way of getting such an information. After some searches, you cannot even query this info with the same way if you use Vista/7 or XP; in one case, WMI works. Rather use another approach, try to detect OpenGL errors, especially out of memory errors when they occur.

gouessej: Thanks for your answer.

Maybe suggest a request for enhancement to LWJGL for this feature. We have a pragmatic approach to requirements like this.

Cas :slight_smile:

What’s exactly the difference between this

System.out.println(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getAvailableAcceleratedMemory());

and what’s actually required? Is it totally unrelated, or just unreliable?

Did not work for me :-
On all computers I tried the result was -1

This is not the right place to speak about another Java binding for OpenGL.

Um, why not? This is an issue that concerns all OpenGL bindings, even if it was posted in the JOGL section.

but this is the JOGL section and he is asking for help. Imagine that you have a problem with your General Motors car, someone comes to you, you think that he is going to help you. Instead of helping you, he tries to sell an Audi car, it does not solve your problem and I’m sure you would be disappointed in such a situation.

The difference being that Cas doesn’t sell anything here, he’s offering a possible and practical path to a solution.
Following your analogy, if JOGL is a free Opel and LWJGL a free Audi, I might be tad disappointed with General Motors for not having the same attitude :slight_smile:

The “solution” proposed by princec is not a solution to this precise problem for a JOGL user, it is not a solution that uses JOGL. Therefore, my analogy is fine except that both bindings are free of charge. This is the JOGL section, proposed solutions have to use JOGL. If someone hesitates between the use of both bindings, it is not the appropriate place to speak about it. If JOGL was abandoned, I would understand that some people would suggest alternative APIs as we already do for Java3D but it is not the case, JOGL is alive.

I’m having difficulty understanding why this restriction is necessary. It seems like an arbitrary rule that can only reduce the quality and amount of help that the forum can offer. Could you perhaps explain what undesirable outcome it is protecting us from?

This issue was also the reason the two forms were merged into one so that resources of all opengl developers can be pooled/shared in one area so everyone can benefit (also so any silly flame wars can be avoided), if I remember correctly it was just a technical issue/limitation at the time which prevented this.