Install all headers (probably, except gl.h) - this is a _lot_ of packages (for glx, xf86vidmode, ...). Use google for the purpose. UPD: for xf86vidmode, 2 are needed: x11proto-xf86vidmode-dev, libxxf86vm-dev (if necessary, make symlink libXext.so. to libXext.so). Or just disable xf86VidMode functionality. Beware - there can be a dead link 'libGL.so' pointing to the Mesa GL: NV devdriver (at least, for CUDA 4.1) installs incorrectly and link must be fixed manually. UPD: OpenGL 2 demos don't run on Kubuntu 'Precise' (NV 295.40 + GT240M) - some error during compilation of shaders. Multitexture example doesn't draw textures. Damn.