ES3 on Jetson Not Available

I have installed the latest image on the jetson tk1 device.

There does not seem to be the gl3.h nor gl31.h headers that my application requires for using es3 context.

The libGLESv2.so does not contain the functions required for es3.

The sdk states it is Opengles3 capable, how can I use this functionality?

Thanks

As with all devices, the capability of the hw does not imply that the software provided will allow that capability. Without the appropriate support ( drivers and libraries ) from the HW manufacturer there is nothing much you can do. You mentioned that the shim module does not have the functions required for ES3…what functions specifically are you referring to…as OpenGL ES 3.1 will have additional entry point that OpenGL ES 3.0 will not have, so by ES3 are you referring to OpenGL ES 3.0 ?

Sorry I should have been clearer, it is specifically es3.1 I am requiring, for the Jetson tk1 device. I am using the sdk supplied here “https://developer.nvidia.com/platform-software-development”, which states support for OpenGL ES 3.1.

I have used the gl31.h header from another device (a jeston pro using vibrante), but the program fails to link with undefined references to “glMemoryBarrier”, “glTexLevelParameteriv” and “glBindImageTexture”, which in the “es” apis became available in es3.1.

I am fairly sure the device is capable of these features, however they are lacking from the libGLES2v2 lib.

I think you can get the GLES3 headers with:

sudo apt-get install libgles2-mesa-dev

When compiling you shouldn’t link explicitly to any vendor specific GL library as the vendor specific library is search during the runtime.

If the linker finds the wrong GLES lib runtime (e.g. the Mesa implementation), you maybe want to tweak the order of conf files in /etc/ld.so.conf.d/:

sudo ln -s /usr/lib/arm-linux-gnueabihf/tegra-egl/ld.so.conf /etc/ld.so.conf.d/00_tegra-egl.conf
sudo ldconfig

Just realised that link doesn’t necessarily show the software I am using, it is the

Tegra Linux Driver Package R21.3

Did you check the examples in ~/GameWorksOpenGLSamples (that should exist at least if you installed everything with the JetPack).

There seems to be some GLES3 examples as well.

Hi thanks for your help, I’m still having troubles though!

So the es3 examples in the gamesamples do use the functions I am looking for, also link against GLESv2 in the android makefiles. I’m running ubuntu, I can’t test the examples, though I assume the GLESv2 lib is the same?

Running nm -D …/tegra-egl/libGLESv2.so.2 | grep glMemoryBarrier

produces no results, I’ve tried the same with all libGLESv2 libs I can find on the system (and in the JetPack download).

I have got this working on the Jetson Pro, which does have a GLESv2 lib with the es3 functions in it (I obviously tried to use that too, to no avail). It has the same graphics chip I believe.

I wonder if I can use that vibrante sdk on the non-pro jetson?

Thanks again for your help, think I may have hit a dead end.

I don’t know about the glMemoryBarrier etc. functions you mentioned. I do find them in the GL lib, but I don’t know if it’s possible for the GLES to use parts of GL lib (GLES 3 matches quite well some of the GL versions, afaik). At least I didn’t find a direct link dependency between them.

But it do seem to be ES 3.1:

$ es2_info |grep GL_VERSION
EGL_VERSION: 1.4
GL_VERSION: OpenGL ES 3.1 NVIDIA 21.3

Wait, you DO find those functions in your GLESv2 lib? Where did you get it from? Where did you get the es2_info command from, I don’t see to have it?

got it built by linking against libGL.so, but it crashed at the first function it tried to call from it, glGetIntergerv :(.

No. The only place where I did see them, was the libGL.

sudo apt-get install mesa-utils-extra

nickjet, could you write as small as possible example code that shows the problem (and works e.g. on the Jetson Pro)?

well it’s just any program that uses a GLES31 function:

#include <GLES3/gl31.h>

int main() {

  glMemoryBarrier(GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT);

  return 0;

}

build with:

g++ main.cpp -lGLESv2 -o gl3test

On my jetson with the R21.3 package I get “undefined reference to ‘glMemoryBarrier’”

On my Jetson Pro with Vibrante SDK, builds without error. (Seg faults on execute, probably wants a gl context at least!)

Can you find the function pointer with eglGetProcAddress()?

you should not be calling GL functions without a GL context. If the symbols are missing from the library you are linking against, then there is nothing you can do without getting an updated library with the symbols…GL and GLES are never to be mixed…If you can access the device filesystem…find the shared object on the device and see if the appropriate symbol is present as a test…if it is, then you need to get an updated SDK. Again, the device being capable does not imply that your program will build as these are 2 separate issue. A few have mentioned the headers…but the headers will not help…but you are on the right path with the library…because one MUST link with the stub implementation or some other means of having the GL functions defined or else your application will NOT build…

So, can we get an updated libGLESv2 lib, with the gles 3.1 functions implemented in it anytime soon?

Did you try getting the function pointers with eglGetProcAddress()?

EDIT: at least eglGetProcAddress(“glMemoryBarrier”) does return a non-null value.

Hi, how do you do that? I tried;

void (*glMemoryBarrier)(GLbitfield);
	glMemoryBarrier = (void(*)(GLbitfield))eglGetProcAddress("glMemoryBarrier");

	void (*glGetTexLevelParameteriv)(GLenum, GLint, GLenum, GLint *);
	glGetTexLevelParameteriv = (void (*) (GLenum, GLint, GLenum, GLint *))eglGetProcAddress("glGetTexLevelParameteriv");

	void (*glBindImageTexture) (GLuint, GLuint, GLint, GLboolean, GLint, GLenum, GLenum);
	glBindImageTexture = (void (*)(GLuint, GLuint, GLint, GLboolean, GLint, GLenum, GLenum))eglGetProcAddress("glBindImageTexture");

I still get undefined symbols, how do I declare these functions correctly?

I’m guessing it’s something like this:

[url]Load OpenGL Functions - OpenGL Wiki

I did get that working in the end, with the use of “eglGetProcAddress”, thanks for all your help!