arthurmco / familyline-testbed

nice and fun RTS game about the adventures of family in the ancient era. Homebrew engine. Just starting. Shitty graphics are expected
MIT License
6 stars 2 forks source link

Segfault when running on Nvidia Optimus hardware on Linux #27

Closed arthurmco closed 4 years ago

arthurmco commented 4 years ago

The game crashes when running on Optimus hardware on Linux.

Seems a driver thing, because this does not happen on Windows

The output is:

[manjaro@manjaro-gnome build]$ sudo primusrun ./familyline 
[       0.0000]  Familyline 0.1.97
[       0.0000]  built on Feb 13 2020 by manjaro
[       0.0001]  git commit is 1885a7b
[       0.0001]  Actual date is 2020-02-13 04:56:52
[       0.0001]  Default model directory is ./models/
[       0.0002]  Default texture directory is ./textures/
[       0.0002]  Default material directory is ./materials/
[       0.7978] main: driver found: x11 (default)
[       0.7979] main: driver found: wayland 
[       0.7979] main: driver found: KMSDRM 
[       0.7979] main: driver found: dummy 
[       0.7979] input-listener: Created input listener 'default'
[       0.7979] input-manager: Adding listener order 0.000 for event mast 0xffffffff
[       0.8760] init: KHR_debug supported
[       0.8761] fb: creating framebuffer f3D: handle=0x1, size=640 x 480
[       0.8762] gl-debug-opengl-api: [#131169] low prio:  other: Framebuffer detailed info: The driver allocated storage for renderbuffer 1.
[       0.8770] gl-debug-opengl-api: (FATAL) [#1282] error: GL_INVALID_OPERATION error generated. <first> + <count> must be less than the number of combined texture image units.%
[       0.8770] gl-debug-opengl-api: (FATAL) [#1282] error: GL_INVALID_OPERATION error generated. Function glTexCoordP3ui is deprecated and not available in preview contexts.
                                                                                                                                                                              ��%
[       0.8770] gl-debug-opengl-api: (FATAL) [#1280] error: GL_INVALID_ENUM error generated. <coord> enum is invalid; expected GL_TEXTURE_GEN_STR_OES
[       0.8770] gl-debug-opengl-api: (FATAL) [#1280] error: GL_INVALID_ENUM error generated. <coord> enum is invalid; expected GL_TEXTURE_GEN_STR_OES
[       0.8770] gl-debug-opengl-api: (FATAL) [#1282] error: GL_INVALID_OPERATION error generated. <first> + <count> must be less than the number of combined texture image units.%
[       0.8771] gl-debug-opengl-api: (FATAL) [#1282] error: GL_INVALID_OPERATION error generated. <texture> is not the name of an existing texture.
[       0.8771] fb:     completed: texhandle=0x1, rbohandle=0x1
[       0.8771] fb: creating framebuffer fGUI: handle=0x2, size=640 x 480
[       0.8771] gl-debug-opengl-api: [#131169] low prio:  other: Framebuffer detailed info: The driver allocated storage for renderbuffer 2.
[       0.8776] gl-debug-opengl-api: (FATAL) [#1282] error: GL_INVALID_OPERATION error generated. <first> + <count> must be less than the number of combined texture image units.%
[       0.8776] gl-debug-opengl-api: (FATAL) [#1282] error: GL_INVALID_OPERATION error generated. Function glTexCoordP3ui is deprecated and not available in preview contexts.
                                                                                                                                                                              ��%
[       0.8777] gl-debug-opengl-api: (FATAL) [#1280] error: GL_INVALID_ENUM error generated. <coord> enum is invalid; expected GL_TEXTURE_GEN_STR_OES
[       0.8777] gl-debug-opengl-api: (FATAL) [#1280] error: GL_INVALID_ENUM error generated. <coord> enum is invalid; expected GL_TEXTURE_GEN_STR_OES
[       0.8777] gl-debug-opengl-api: (FATAL) [#1282] error: GL_INVALID_OPERATION error generated. <first> + <count> must be less than the number of combined texture image units.%
[       0.8777] gl-debug-opengl-api: (FATAL) [#1282] error: GL_INVALID_OPERATION error generated. <texture> is not the name of an existing texture.
[       0.8777] fb:     completed: texhandle=0x2, rbohandle=0x2
[       0.8777] input-listener: Created input listener 'gui-listener'
[       0.8777] input-manager: Adding listener order 0.800 for event mast 0x7
[       0.8822] gl-debug-opengl-api: [#131185] other: Buffer detailed info: Buffer object 3 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STATIC_DRAW) will use VIDEO memory as the source for buffer object operations.
[       0.8822] gl-debug-opengl-api: [#131185] other: Buffer detailed info: Buffer object 4 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STATIC_DRAW) will use VIDEO memory as the source for buffer object operations.
[       0.8822] gl-debug-opengl-api: (FATAL) [#1282] error: GL_INVALID_OPERATION error generated. <first> + <count> must be less than the number of combined texture image units.%
640.00 480.00[       0.8822] gl-debug-opengl-api: (FATAL) [#1282] error: GL_INVALID_OPERATION error generated. Function glTexCoordP3ui is deprecated and not available in preview contexts.
                                                                                                                                                                                           ��%
[       0.8823] gl-debug-opengl-api: (FATAL) [#1280] error: GL_INVALID_ENUM error generated. <coord> enum is invalid; expected GL_TEXTURE_GEN_STR_OES
[       0.8823] gl-debug-opengl-api: (FATAL) [#1280] error: GL_INVALID_ENUM error generated. <coord> enum is invalid; expected GL_TEXTURE_GEN_STR_OES
[       0.8823] gl-debug-opengl-api: (FATAL) [#1282] error: GL_INVALID_OPERATION error generated. <first> + <count> must be less than the number of combined texture image units.%
[       0.8823] gl-debug-opengl-api: (FATAL) [#1281] error: GL_INVALID_VALUE error generated. <maxLength> must not be negative.��%
[       0.8823] texture: Discovered texture max size: -1x-1
[       0.8823] texture: (FATAL) Invalid texture max size. Something is wrong
[       0.8823] gl-debug-opengl-api: (FATAL) [#1281] error: GL_INVALID_VALUE error generated. <maxLength> must not be negative.��%
[       0.8823] texture: Discovered texture max size: -1x-1
[       0.8823] texture: (FATAL) Invalid texture max size. Something is wrong
[       0.8823] texture: maximum tex size: 0 x 0
[       1.2121] gui-image-control: opening image './icons//familyline-logo.png'
[       1.2121] gui-image-control: image has size 794.00 x 937.00
[       1.2236] gl-debug-opengl-api: (FATAL) [#1280] error: GL_INVALID_ENUM error generated. <buffer> enum is invalid; expected GL_DEPTH_STENCIL.�
[       1.2236] gl-debug-opengl-api: (FATAL) [#1281] error: GL_INVALID_VALUE error generated. Object handle does not refer to an object generated by OpenGL.
Segmentation fault

lspci output is

01:00.0 3D controller: NVIDIA Corporation GP107M [GeForce GTX 1050 Mobile] (rev ff) (prog-if ff)
    !!! Unknown header type 7f
    Kernel modules: nouveau, nvidia_drm, nvidia
arthurmco commented 4 years ago

Ran gdb

[       1.0315] gl-debug-opengl-api: (FATAL) [#1282] error: GL_INVALID_OPERATION error generated. <first> + <count> must be less than the number of combined texture image units.�
640.00 480.00[       1.0316] gl-debug-opengl-api: (FATAL) [#1282] error: GL_INVALID_OPERATION error generated. Function glTexCoordP3ui is deprecated and not available in preview contexts.;)��
[       1.0316] gl-debug-opengl-api: (FATAL) [#1280] error: GL_INVALID_ENUM error generated. <coord> enum is invalid; expected GL_TEXTURE_GEN_STR_OES
[       1.0316] gl-debug-opengl-api: (FATAL) [#1280] error: GL_INVALID_ENUM error generated. <coord> enum is invalid; expected GL_TEXTURE_GEN_STR_OES
[       1.0316] gl-debug-opengl-api: (FATAL) [#1282] error: GL_INVALID_OPERATION error generated. <first> + <count> must be less than the number of combined texture image units.�
[       1.0316] gl-debug-opengl-api: (FATAL) [#1281] error: GL_INVALID_VALUE error generated. Object handle does not refer to an object generated by OpenGL.
[       1.0316] texture: Discovered texture max size: -1x-1
[       1.0316] texture: (FATAL) Invalid texture max size. Something is wrong
[       1.0316] gl-debug-opengl-api: (FATAL) [#1281] error: GL_INVALID_VALUE error generated. Object handle does not refer to an object generated by OpenGL.
[       1.0316] texture: Discovered texture max size: -1x-1
[       1.0316] texture: (FATAL) Invalid texture max size. Something is wrong
[       1.0317] texture: maximum tex size: 0 x 0
[       1.0545] gui-image-control: opening image './icons//familyline-logo.png'
[       1.0545] gui-image-control: image has size 794.00 x 937.00
[       1.0681] gl-debug-opengl-api: (FATAL) [#1280] error: GL_INVALID_ENUM error generated. <buffer> enum is invalid; expected GL_DEPTH_STENCIL.�
[       1.0682] gl-debug-opengl-api: (FATAL) [#1281] error: GL_INVALID_VALUE error generated. <maxLength> must not be negative. GL_DEPTH_STENCIL.�

Thread 1 "familyline" received signal SIGSEGV, Segmentation fault.
0x00007ffff10bc29e in ?? () from /usr/lib/libnvidia-glcore.so.418.113
(gdb) bt
#0  0x00007ffff10bc29e in ?? () from /usr/lib/libnvidia-glcore.so.418.113
#1  0x00007ffff100045d in ?? () from /usr/lib/libnvidia-glcore.so.418.113
#2  0x00005555555b42e0 in familyline::graphics::gui::GUIManager::renderToScreen (this=0x555555cc1730) at /home/manjaro/familyline/src/client/graphical/gui/GUIManager.cpp:314
#3  0x0000555555562d9f in show_starting_menu () at /home/manjaro/familyline/src/client/Tribalia.cpp:365
#4  0x000055555556225c in main (argc=1, argv=0x7fffffffe4f8) at /home/manjaro/familyline/src/client/Tribalia.cpp:230
arthurmco commented 4 years ago

Seems to be fixed!