Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to compile vertex shader #37

Open
icanb opened this issue Mar 3, 2018 · 12 comments
Open

Failed to compile vertex shader #37

icanb opened this issue Mar 3, 2018 · 12 comments

Comments

@icanb
Copy link

icanb commented Mar 3, 2018

I'm getting the following crash on launch on some devices. Any idea what's going wrong? Any work arounds? Thanks!

03-03 02:56:07.452 3573-3596/com.example.ican.edgy W/Viro: �[1;33m[******************************** ABORT ********************************]�[0m
03-03 02:56:07.452 3573-3596/com.example.ican.edgy W/Viro: �[1;33m        File: /Users/vadvani/ViroReact/ViroRenderer/ViroRenderer/VROShaderProgram.cpp�[0m
03-03 02:56:07.452 3573-3596/com.example.ican.edgy W/Viro: �[1;33m        Line: 303�[0m
03-03 02:56:07.452 3573-3596/com.example.ican.edgy W/Viro: �[1;33m    Function: bool VROShaderProgram::compileAndLink()�[0m
03-03 02:56:07.453 3573-3596/com.example.ican.edgy W/Viro: �[0;33m      Reason: Failed to compile vertex shader "constant_diffuse" with code:
                                                           #version 300 es
                                                           
                                                           layout (std140) uniform lighting_vertex {
                                                               int lv_num_lights;
                                                               lowp float lv_padding0, lv_padding1, lv_padding2;
                                                               
                                                               mat4 shadow_view_matrices[8];
                                                               mat4 shadow_projection_matrices[8];
                                                           };
                                                           
                                                           struct VROShaderGeometry {
                                                               vec3 position;
                                                               vec3 normal;
                                                               vec2 texcoord;
                                                               vec4 tangent;
                                                               vec4 bone_weights;
                                                               ivec4 bone_indices;
                                                           } _geometry;
                                                           
                                                           struct VROShaderVertex {
                                                               vec4 position;
                                                           } _vertex;
                                                           
                                                           struct VROTransforms {
                                                               mat4 model_matrix;
                                                               mat4 view_matrix;
                                                               mat4 projection_matrix;
                                                           } _transforms;
                                                           
                                                           in vec3 position;
                                                           in vec3 normal;
                                                           in vec2 texcoord;
                                                           in vec4 tangent;
                                                           in vec4 bone_weights;
                                                           in ivec4 bone_indices;
                                                           
                                                           uniform mat4 normal_matrix;
                                                           uniform mat4 model_matrix;
                                                           uniform mat4 view_matrix;
                                                           uniform mat4 projection_matrix;
                                                           
                                                           #pragma geometry_modifier_uniforms
                                                           #pragma vertex_modifier_uniforms
                                                           
                                                           out mat3 v_tbn;
                                                           out vec2 v_texcoord;
                                                           out vec3 v_surface_position;
                                                           flat out int v_instance_id;

@dthian
Copy link
Member

dthian commented Mar 5, 2018

Thanks @icanb!

  1. You've mentioned that this crashes on launch on some devices. Thus, could you let us know which devices, it's OS and it's GPU type you are running this on that causes the crash? Viro reports the GPU type in the logs, a line like the following will be printed when you create a ViroView:

GPU vendor [XYZ], renderer [XYZ]

  1. In addition, can you also identify and provide us the code you are running that causes this crash (do send us an email privately if needed)?

  2. Finally, can you also provide us a longer stack trace (just in case) - any Viro logs above and below the abort stack trace will be helpful.

Much thanks!

@icanb
Copy link
Author

icanb commented Mar 5, 2018

Here it is:



03/05 11:59:39: Launching app
$ adb push /Users/ilter.canberk/Downloads/virocore-helloworld (2)/virocore-helloworld-scene/app/build/outputs/apk/app-debug.apk /data/local/tmp/com.example.virosample.scene
$ adb shell pm install -t -r "/data/local/tmp/com.example.virosample.scene"
	pkg: /data/local/tmp/com.example.virosample.scene
Success


$ adb shell am start -n "com.example.virosample.scene/com.example.virosample.ViroActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Client not ready yet..Waiting for process to come online
Waiting for process to come online
Connected to process 3273 on device vuzix-blade-0123456789ABCDEF
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
I/art: Late-enabling -Xcheck:jni
I/art: Enabled coredump for process 3273
W/linker: libviro_native.so: unused DT entry: type 0x6ffffffe arg 0xbdba8
W/linker: libviro_native.so: unused DT entry: type 0x6fffffff arg 0x6
W/linker: libvrapi.so: unused DT entry: type 0x6ffffffe arg 0x15d4
W/linker: libvrapi.so: unused DT entry: type 0x6fffffff arg 0x2
W/linker: libprotobuf-lite.so: unused DT entry: type 0x6ffffffe arg 0x2d108
W/linker: libprotobuf-lite.so: unused DT entry: type 0x6fffffff arg 0x2
W/linker: libfreetype.so: unused DT entry: type 0x6ffffffe arg 0x4a2c
W/linker: libfreetype.so: unused DT entry: type 0x6fffffff arg 0x1
W/linker: libBulletCollision.so: unused DT entry: type 0x6ffffffe arg 0x4739c
W/linker: libBulletCollision.so: unused DT entry: type 0x6fffffff arg 0x2
W/linker: libBulletDynamics.so: unused DT entry: type 0x6ffffffe arg 0x27e64
W/linker: libBulletDynamics.so: unused DT entry: type 0x6fffffff arg 0x2
W/linker: libBulletSoftBody.so: unused DT entry: type 0x6ffffffe arg 0x1c058
W/linker: libBulletSoftBody.so: unused DT entry: type 0x6fffffff arg 0x2
W/linker: libLinearMath.so: unused DT entry: type 0x6ffffffe arg 0xb4c8
W/linker: libLinearMath.so: unused DT entry: type 0x6fffffff arg 0x2
W/linker: libgnustl_shared.so: unused DT entry: type 0x6ffffffe arg 0x47d58
W/linker: libgnustl_shared.so: unused DT entry: type 0x6fffffff arg 0x2
I/AmazonWebServiceClient: {cognito-identity, us-west-2} was not found in region metadata, trying to construct an endpoint using the standard pattern for this region: 'cognito-identity.us-west-2.amazonaws.com'.
D/CognitoCachingCredentialsProvider: Loading credentials from SharedPreferences
W/libOpenSLES: class OutputMix interface 0 requested but unavailable MPH=28
D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
D/Atlas: Validating map...
I/OpenGLRenderer: Initialized EGL, version 1.4
D/GC: <tid=3362> OES20 ===> GC Version   : GC version rls_5011p6_GC5.10 
D/OpenGLRenderer: Enabling debug mode 0
D/GC: <tid=3293> OES30 ===> GC Version   : GC version rls_5011p6_GC5.10 
D/v_gal: [tid= 3293] gcmONERROR: status=-1(gcvSTATUS_INVALID_ARGUMENT) @ eglQuerySurface(4122)
I/Viro: Did not acquire sRGB framebuffer [colorspace 0]
I/Viro: GPU vendor [Vivante Corporation], renderer [Vivante GC7000UL]
I/Viro: Creating render targets with configuration:
I/Viro: [MRT supported:   1]
I/Viro: [Shadows enabled: 1]
I/Viro: [HDR supported:   0, HDR enabled:   0]
I/Viro: [PBR supported:   0, PBR enabled:   0]
I/Viro: [Bloom supported: 0, Bloom enabled: 0]
D/CognitoCachingCredentialsProvider: Saving credentials to SharedPreferences
D/Viro: Attempt #0, performing metrics recording in 0 milliseconds
W/art: Attempt to remove local handle scope entry from IRT, ignoring
I/Choreographer: Skipped 74 frames!  The application may be doing too much work on its main thread.
D/v_gal: [tid= 3293] gcmONERROR: status=-2001(gcvSTATUS_COMPILER_FE_PARSER_ERROR) @ gcCompileShader(452)
D/v_gal: [tid= 3293] gcmONERROR: status=-2001(gcvSTATUS_COMPILER_FE_PARSER_ERROR) @ __glChipCompileShader(4385)
W/Viro: �[1;33m[******************************** ABORT ********************************]�[0m
W/Viro: �[1;33m        File: /Users/vadvani/ViroReact/ViroRenderer/ViroRenderer/VROShaderProgram.cpp�[0m
W/Viro: �[1;33m        Line: 303�[0m
W/Viro: �[1;33m    Function: bool VROShaderProgram::compileAndLink()�[0m
W/Viro: �[0;33m      Reason: Failed to compile vertex shader "constant_diffuse" with code:
        #version 300 es

        layout (std140) uniform lighting_vertex {
            int lv_num_lights;
            lowp float lv_padding0, lv_padding1, lv_padding2;
           
            mat4 shadow_view_matrices[8];
            mat4 shadow_projection_matrices[8];
        };

        struct VROShaderGeometry {
            vec3 position;
            vec3 normal;
            vec2 texcoord;
            vec4 tangent;
            vec4 bone_weights;
            ivec4 bone_indices;
        } _geometry;

        struct VROShaderVertex {
            vec4 position;
        } _vertex;

        struct VROTransforms {
            mat4 model_matrix;
            mat4 view_matrix;
            mat4 projection_matrix;
        } _transforms;

        in vec3 position;
        in vec3 normal;
        in vec2 texcoord;
        in vec4 tangent;
        in vec4 bone_weights;
        in ivec4 bone_indices;

        uniform mat4 normal_matrix;
        uniform mat4 model_matrix;
        uniform mat4 view_matrix;
        uniform mat4 projection_matrix;

        #pragma geometry_modifier_uniforms
        #pragma vertex_modifier_uniforms

        out mat3 v_tbn;
        out vec2 v_texcoord;
        out vec3 v_surface_position;
        flat out int v_instance_id;


        --------- beginning of crash
A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0xa585023c in tid 3293 (GLThread 143)
W/AudioTrack: releaseBuffer() track 0x4b01ed20 disabled due to previous underrun, restarting
Application terminated.

This is when I try to run the helloworld-scene example that you guys provided. Thank you @dthian.

@dthian
Copy link
Member

dthian commented Mar 5, 2018

Thanks @icanb! To get a better idea of which device - os - hardware combination we can use to reproduce this issue, Could you let us know which device model, it's Android OS and it's corresponding GPU type you are running this on that causes the crash?

@icanb
Copy link
Author

icanb commented Mar 5, 2018

Vuzix Blade (Android 5.1.1, API 22) -- @dthian what's your email btw?

@dam00n
Copy link
Collaborator

dam00n commented Mar 5, 2018

@icanb we don't officially support Vuzix Blade. We have not looked at their dev kit or sdk for tracking which might be why you are running into issues. Doubtful they are using ARCore which we use for AR support on Android. Have you tried running it on a regular Android device that supports ARCore? Also, you can email me ([email protected]) and Daniel ([email protected]) as needed.

@icanb
Copy link
Author

icanb commented Mar 5, 2018

It definitely doesn't support ARCore but my goal is simply building 3D scenes without the AR stuff. That's why I've been excited about ViroCore in the first place. Can I not turn off all that stuff and simply use the 3D engine?

@icanb
Copy link
Author

icanb commented Mar 5, 2018

I realized that the current version is 1.4 (?), and one of the links on the website is actually pointing to a 1.2 version of the SDK in which the scenekit stuff works -- however I run into the issue mention in #36. Would really appreciate if you can help me figure out a path forward. I don't want to got a more complicated solution like Rajawali etc.

@dam00n
Copy link
Collaborator

dam00n commented Mar 5, 2018

Yes, ViroCore can be used for 3D scenes and that is a common use case (the Blade made me assume your use case was AR). Just to clarify, you are running into this issue only on the Blade?

Do you know what the GPU is on that device? Adreno, Mali, etc? Also does the device support opengl 3.0?

We added Renderer Configurations in Viro 1.3 (most recent version is 1.4). You might try turning all of these off and seeing if that helps -> https://developer.viromedia.com/virocore/reference/com/viro/core/RendererConfiguration.html

@icanb
Copy link
Author

icanb commented Mar 5, 2018

Turning them off didn't help unfortunately.

Here is the GPU on the device
GLES: Vivante Corporation, Vivante GC7000UL, OpenGL ES 3.0

What's the OpenGL requirements that you guys have? Maybe adding it in the manifest could help.

@dam00n
Copy link
Collaborator

dam00n commented Mar 5, 2018

We require OpenGL ES 3.0

Thanks for the additional information and sorry for the issue you are encountering. Unfortunately, we need to get our hands on a device with that GPU and debug to see what the issue is. Will have to get back to you once we find a device. If you are targeting other Android devices hopefully you can develop on those so you are not blocked.

@icanb
Copy link
Author

icanb commented Mar 6, 2018

Thank you @dam00n -- Any ideas on #36? Maybe I can switch back to using 1.2.

@dam00n
Copy link
Collaborator

dam00n commented Mar 6, 2018

We think that issue might also be GPU related because we can't repro on any of the android devices we have. We ordered a device with the same GPU and it should arrive next week. Will keep both issues open and update once we have more info. Just to confirm, you are only seeing these issues on the Blade device right? Your original comment said a couple devices, so wanted to make sure there were not other android devices you were seeing these issues on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants