I'm trying to run Opengl sample on a window with depth 32

I tried running the sample on a window with depth 24 and it runs fine.
the attributes for choosing the visual were

GLint att[] = { GLX_RGBA, GLX_DEPTH_SIZE, 24, GLX_DOUBLEBUFFER, None};

Display* dpy = XOpenDisplay(NULL);
XVisualInfo* vi = glXChooseVisual(dpy, 0, att);

for the above attributes glXChooseVisual() returns a visual with depth 24 and the sample runs fine.

but when I give GLX_DEPTH_SIZE as 32, glXChooseVisual returns NULL

when I run "xdpyinfo" on terminal it returns visuals with both 24 and 32 depths

OS: Ubuntu 12.04
Graphics card: Nvidia GS 8400 (driver version 304.88)
OpenGL version supported 3.3.0, GLX version 1.4

please help me in figuring out where I am going wrong

Thanks.