How to detect Tegra device from system info under Android JellyBean 4.3 ?

Up until now we’ve been following the sample code “nv_syscaps” which opens “proc/config.gz” and looks for the line:


However (so far on the Nexus 7) with stock Android 4.3 update installed, proc/config.gz no longer exists (the kernel seems to have been built without that option enabled to have that file output). Curious if there might be some other way (from the cpuinfo or otherwise) to detect that the device has a Tegra SoC without having to initialize a GL context and look at the “RENDERER” string (which does contain Tegra)?

For example, if I do a “cat proc/cpuinfo” inside an adb shell on the Nexus 7, I see a couple things I am not sure of what they mean (and I can’t find info about them), “CPU Variant” and “CPU Part” - are those by chance Tegra-specific identifiers that could be used when proc/config.gz is not found?

Beyond that I could resort to special-casing the Nexus 7 as a “whitelist” device in our Tegra detection code, but that would break if other devices start removing config.gz as well from their stock kernels.

Has anyone at nVidia or otherwise run into broken Tegra detection code with the stock 4.3 update yet (specifically on the Nexus 7 so far but not necessarily limited to that device) and if so, how did you address it?


FWIW - i fixed this by adding a fallback case to call eglInitialize() and then make a call to glGetString(GL_RENDERER) and checking the resulting string for “Tegra”

that seemed to do the trick if “config.gz” could not be found. it looks like eglInitialize() is reentrant and is not refcounted so looks like it’s ok to call that ahead of the actual EGL init code.

By “eglInitialize()”, do you mean “go through the entire EGL initialization sequence”?

Because when I tried just eglInitialize(), glGetString() crashed with “no context!”