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

Compile for PowerVR #341

Closed
MightyM17 opened this issue Sep 22, 2021 · 12 comments
Closed

Compile for PowerVR #341

MightyM17 opened this issue Sep 22, 2021 · 12 comments

Comments

@MightyM17
Copy link

I have a PowerVR SGX 540 GPU, and it seems like there are pvr specific flags for compiling, which should i use? There is pandora build but thats sgx530 so will it work fine with 540?

@ptitSeb
Copy link
Owner

ptitSeb commented Sep 22, 2021

Maybe use Pyra build instead. Or no specific flag. The PVR specific code is dynamic for most of it, so it should work as-is.

@MightyM17
Copy link
Author

Oh nice, will try without any specific flag, thanks!

@MightyM17
Copy link
Author

MightyM17 commented Sep 22, 2021

Does it not build with musl?

samsung-espresso3g:~/gl4es/build$ cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo
-- The C compiler identification is GNU 10.3.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Looking for backtrace
-- Looking for backtrace - not found
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/gl4es/build
samsung-espresso3g:~/gl4es/build$ make -j2
[  2%] Building C object src/CMakeFiles/GL.dir/gl/arbgenerator.c.o
[  2%] Building C object src/CMakeFiles/GL.dir/gl/arbconverter.c.o
[  3%] Building C object src/CMakeFiles/GL.dir/gl/arbhelper.c.o
[  5%] Building C object src/CMakeFiles/GL.dir/gl/arbparser.c.o
during GIMPLE pass: strlen
/home/user/gl4es/src/gl/arbparser.c: In function 'resolveParam':
/home/user/gl4es/src/gl/arbparser.c:655:8: internal compiler error: Bus error
  655 | char **resolveParam(sCurStatus_NewVar *newVar, int vertex, int type) {
      |        ^~~~~~~~~~~~
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.
make[2]: *** [src/CMakeFiles/GL.dir/build.make:118: src/CMakeFiles/GL.dir/gl/arbparser.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
during GIMPLE pass: cddce
/home/user/gl4es/src/gl/arbgenerator.c: In function 'generateInstruction':
/home/user/gl4es/src/gl/arbgenerator.c:1041:1: internal compiler error: Bus error
 1041 | }
      | ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.
make[2]: *** [src/CMakeFiles/GL.dir/build.make:90: src/CMakeFiles/GL.dir/gl/arbgenerator.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:98: src/CMakeFiles/GL.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

@ptitSeb
Copy link
Owner

ptitSeb commented Sep 22, 2021

I should work, but your compiler failed with a BUS ERROR. It's a compiler error, not gl4es fault. Try to lower the local optimization of the file arbparser.c , by adding #pragma GCC optimize 1 at the beggining of the file (this is just a workaround, until your cmpiler is fixed)

@MightyM17
Copy link
Author

MightyM17 commented Sep 22, 2021

I use gcc, and a PREEMPT kernel, never faced such an issue, but adding #pragma GCC optimize 1 seems to have worked, thanks!

@MightyM17
Copy link
Author

log.txt
I set `export LD_PRELOAD="/usr/lib/gl4es/libGL.so.1" and ran glxgears, it gave segmentation fault as output.
Above is the strace of it

@ptitSeb
Copy link
Owner

ptitSeb commented Sep 22, 2021

Can you put the console output? gl4es output many things at launch, it's usualy enough to understand what is going wrong.

@MightyM17
Copy link
Author

Can you put the console output? gl4es output many things at launch, it's usualy enough to understand what is going wrong.

Hey, sorry for the late reply but here's what is on my console

samsung-espresso3g:~$ export LD_PRELOAD="/usr/lib/gl4es/libGL.so.1"
samsung-espresso3g:~$ XDG_RUNTIME_DIR=/run/user/10000 glxgears
LIBGL: Initialising gl4es
LIBGL: v1.1.5 built on Sep 22 2021 18:56:00
LIBGL: Using GLES 2.0 backend
LIBGL: loaded: libGLESv2.so
LIBGL: loaded: libEGL.so
LIBGL: Using GLES 2.0 backend
LIBGL: Error while gathering supported extension (eglInitialize: EGL_NOT_INITIALIZED), default to none
LIBGL: Targeting OpenGL 2.1
LIBGL: WARNING, No Limited or Full NPOT support in hardware, Forcing NPOT have no effect!
LIBGL: Not trying to batch small subsequent glDrawXXXX
LIBGL: try to use VBO
LIBGL: Force texture for Attachment color0 on FBO
LIBGL: Hack to trigger a SwapBuffers when a Full Framebuffer Blit on default FBO is done
LIBGL: glX Will try to recycle EGL Surface
LIBGL: Current folder is:/home/user
Error: couldn't open display (null)
LIBGL: Shuting down

@MightyM17
Copy link
Author

Ok the above output was from ssh, running it on device, I get,

samsung-espresso3g:~$ export LD_PRELOAD="/usr/lib/gl4es/libGL.so.1"
samsung-espresso3g:~$ glxgears
LIBGL: Initialising gl4es
LIBGL: v1.1.5 built on Sep 22 2021 18:56:00
LIBGL: Using GLES 2.0 backend
LIBGL: loaded: libGLESv2.so
LIBGL: loaded: libEGL.so
LIBGL: Using GLES 2.0 backend
LIBGL: Hardware Full NPOT detected and used
LIBGL: Extension GL_EXT_blend_minmax  detected and used
LIBGL: Extension GL_EXT_draw_buffers  detected and used
LIBGL: FBO are in core, and so used
LIBGL: PointSprite are in core, and so used
LIBGL: CubeMap are in core, and so used
LIBGL: BlendColor is in core, and so used
LIBGL: Blend Subtract is in core, and so used
LIBGL: Blend Function and Equation Separation is in core, and so used
LIBGL: Texture Mirrored Repeat is in core, and so used
LIBGL: Extension GL_OES_mapbuffer  detected
LIBGL: Extension GL_OES_element_index_uint  detected and used
LIBGL: Extension GL_OES_packed_depth_stencil  detected and used
LIBGL: Extension GL_OES_depth24  detected and used
LIBGL: Extension GL_OES_rgb8_rgba8  detected and used
LIBGL: Extension GL_EXT_multi_draw_arrays  detected
LIBGL: Extension GL_EXT_texture_format_BGRA8888  detected and used
LIBGL: Extension GL_OES_depth_texture  detected and used
LIBGL: Extension GL_OES_texture_stencil8  detected and used
LIBGL: Extension GL_EXT_texture_rg  detected and used
LIBGL: Extension GL_OES_texture_float  detected and used
LIBGL: Extension GL_OES_texture_half_float  detected and used
LIBGL: Extension GL_EXT_color_buffer_float  detected and used
LIBGL: Extension GL_EXT_color_buffer_half_float  detected and used
LIBGL: high precision float in fragment shader available and used
LIBGL: Extension GL_EXT_frag_depth  detected and used
LIBGL: Max vertex attrib: 16
LIBGL: Extension GL_OES_standard_derivatives  detected and used
LIBGL: Max texture size: 16384
LIBGL: Max Varying Vector: 32
LIBGL: Texture Units: 16/16 (hardware: 32), Max lights: 8, Max planes: 6
LIBGL: Max Color Attachments: 8 / Draw buffers: 8
LIBGL: Hardware vendor is Mesa/X.org
LIBGL: GLSL 300 es supported
LIBGL: GLSL 310 es supported and used
LIBGL: sRGB surface supported
LIBGL: EGLImage to Texture2D supported
LIBGL: EGLImage to RenderBuffer supported
LIBGL: Targeting OpenGL 2.1
LIBGL: NPOT texture handled in hardware
LIBGL: Not trying to batch small subsequent glDrawXXXX
LIBGL: try to use VBO
LIBGL: Force texture for Attachment color0 on FBO
LIBGL: Hack to trigger a SwapBuffers when a Full Framebuffer Blit on default FBO is done
LIBGL: glX Will try to recycle EGL Surface
LIBGL: Current folder is:/home/user
Segmentation fault

@MightyM17
Copy link
Author

Bump

@ptitSeb
Copy link
Owner

ptitSeb commented Oct 4, 2021

I don't see anything obvious in the log. You need to get a gdb backtrace of the crash.

@MightyM17
Copy link
Author

seems to be a glxgears specific issue

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

2 participants