luciusDXL / TheForceEngine

Modern "Jedi Engine" replacement supporting Dark Forces, mods, and in the future Outlaws.
https://TheForceEngine.github.io
GNU General Public License v2.0
946 stars 71 forks source link

[Linux] Native Linux version launch but black screen #395

Open 12sunflowers opened 4 months ago

12sunflowers commented 4 months ago

All compiled good But after launch ./theforceengine only black screen

freeartist-devuan@home:~/Downloads/TheDarkForces/TheForceEngine-1.09.540/tfe-build$ ./theforceengine
[Main] The Force Engine 
v1.09.530-13-gd029fe2b

[Paths] Program Path: "/home/freeartist-devuan/Downloads/TheDarkForces/TheForceEngine-1.09.540/tfe-build/"
[Paths] Program Data: "/home/freeartist-devuan/.local/share/TheForceEngine/"
[Paths] User Documents: "/home/freeartist-devuan/.local/share/TheForceEngine/"
[Paths] Source Data: "/home/freeartist-devuan/Downloads/TheDarkForces/DarkForces/"
[Startup] TFE_System::init
[Display] Vertical Sync enabled.
[RenderBackend] OpenGL Device Tier: 1
[Startup] TFE_AudioSystem::init
[Audio] SDLAudio using interface 'pulseaudio'
[Audio] Device 00: Built-in Audio Analog Stereo
[Audio] Starting up audio stream for device '<autoselect>'
[Startup] TFE_MidiPlayer::init
[Startup] TFE_Polygon::init
[Startup] TFE_Image::init
[Startup] TFE_FrontEndUI::init
[MemoryRegion] Allocated new memory block in region 'game' - new size is 1 blocks, total size is '8388608'
[MemoryRegion] Allocated new memory block in region 'level' - new size is 1 blocks, total size is '8388608'
[Progam Flow] The Force Engine Game Loop Started

Screenshot_2024-03-13_02-57-51

luciusDXL commented 4 months ago

The issue is most likely the GPU or driver - it is reporting [RenderBackend] OpenGL Device Tier: 1 - so imGui is likely failing to render. This suggests only OpenGL 2.x or earlier is supported, or there is an issue with the GPU driver.

12sunflowers commented 4 months ago

Thanks. Also here i am curious why all working good under Windows 10 at same GPU but video driver is bit newer 342.01 but Linux driver 340.108?

Also geforce 9800 gtx (g92) support OpenGL 3.3 https://www.techpowerup.com/gpu-specs/nvidia-g92.g58

So it all wired things Linux "problems" and no way to investigate them? I mean to fiind reasons why mouselook can freezing under Wine or why i can't see GUI of TFE in native Linux version?

mlauss2 commented 4 months ago

Thanks. Also here i am curious why all working good under Windows 10 at same GPU but video driver is bit newer 342.01 but Linux driver 340.108?

You could try to raise an issue with nvidia (linux-bugs@nvidia.com) about this. It does work with driver 470 on linux; but I guess your gpu is too old for this version now?

Alternatively, ditch the nvidia blob driver and try the mesa noveaou(sp?) driver.

12sunflowers commented 4 months ago

this gpu and driver have no support anymore by nvidia, 340.108 last driver with support my gpu, nouveau have slower perfofmance compare with proprietary in this case,

why other games running smooth under wine but TFE mouselook have lag spikes?

mlauss2 commented 4 months ago

Please paste the output of "glxinfo" somehwere. A 9800gtx should have GL3.3 support, and I remember nvidias drivers supporting GL very well. There must be something else broken, or an extension missing.

12sunflowers commented 4 months ago

https://pastebin.com/raw/t94tN0y7

12sunflowers commented 2 months ago

@JakeSmarter flush mesa cache

you can configure the Nvidia device driver to use some other GLSL compiler?

how do this?

try run flathub version

freeartist-devuan@home:~/Downloads/TheDarkForces/DarkForces$ flatpak run io.github.theforceengine.tfe
[Main] The Force Engine v1.09.540+ 
[Main] /home/freeartist-devuan/.var/app/io.github.theforceengine.tfe/data/
[Paths] Program Path: "/home/freeartist-devuan/"
[Paths] Program Data: "/app/share/TheForceEngine/"
[Paths] User Documents: "/home/freeartist-devuan/.var/app/io.github.theforceengine.tfe/config/"
[Paths] Source Data: "/home/freeartist-devuan/.var/app/io.github.theforceengine.tfe/data/"
[Startup] TFE_System::init
[Display] Fullscreen enabled.
[Display] Vertical Sync enabled.
*** stack smashing detected ***: terminated
[Error : CrashHandler] Received Signal 6 errno 2 code 0
[Error : CrashHandler] Backtrace 16:
[Error : CrashHandler] 000 theforceengine(+0x17adb3) [0x55656efc5db3]
[Error : CrashHandler] 001 /usr/lib/x86_64-linux-gnu/libc.so.6(+0x3ee80) [0x7fa26d568e80]
[Error : CrashHandler] 002 /usr/lib/x86_64-linux-gnu/libc.so.6(+0x90e14) [0x7fa26d5bae14]
[Error : CrashHandler] 003 /usr/lib/x86_64-linux-gnu/libc.so.6(raise+0x1e) [0x7fa26d568dce]
[Error : CrashHandler] 004 /usr/lib/x86_64-linux-gnu/libc.so.6(abort+0xdf) [0x7fa26d55083f]
[Error : CrashHandler] 005 /usr/lib/x86_64-linux-gnu/libc.so.6(+0x27710) [0x7fa26d551710]
[Error : CrashHandler] 006 /usr/lib/x86_64-linux-gnu/libc.so.6(+0x1250a9) [0x7fa26d64f0a9]
[Error : CrashHandler] 007 /usr/lib/x86_64-linux-gnu/libc.so.6(+0x126364) [0x7fa26d650364]
[Error : CrashHandler] 008 /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0(+0x11a685) [0x7fa26dc2a685]
[Error : CrashHandler] 009 /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0(+0xe9d81) [0x7fa26dbf9d81]
[Error : CrashHandler] 010 theforceengine(+0x166798) [0x55656efb1798]
[Error : CrashHandler] 011 theforceengine(+0x166959) [0x55656efb1959]
[Error : CrashHandler] 012 theforceengine(+0x19053) [0x55656ee64053]
[Error : CrashHandler] 013 /usr/lib/x86_64-linux-gnu/libc.so.6(+0x2808a) [0x7fa26d55208a]
[Error : CrashHandler] 014 /usr/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x8b) [0x7fa26d55214b]
[Error : CrashHandler] 015 theforceengine(+0x199b5) [0x55656ee649b5]
freeartist-devuan@home:~/Downloads/TheDarkForces/DarkForces$ 
mlauss2 commented 1 month ago

@12sunflowers: care to try this branch? I've added a few debug statements. https://github.com/mlauss2/TheForceEngine/tree/test1

run cmake with the following compiler flags to get at least some symbols: CXXFLAGS="-O2 -ggdb3" CFLAGS="-O2 -ggdb3" cmake -DDISABLE_SYSMIDI=ON /path/to/tfe-src

12sunflowers commented 1 month ago

@mlauss2 hi, build ok, but

freeartist-devuan@home:~/Downloads/TheDarkForces/TheForceEngine-test1/tfe-test1-build$ ./theforceengine
[Main] The Force Engine 
v1.09.540-257-g2a559b4f

[Paths] Program Path: "/home/freeartist-devuan/Downloads/TheDarkForces/TheForceEngine-test1/tfe-test1-build/"
[Paths] Program Data: "/home/freeartist-devuan/.local/share/TheForceEngine/"
[Paths] User Documents: "/home/freeartist-devuan/.local/share/TheForceEngine/"
[Paths] Source Data: "/home/freeartist-devuan/Downloads/TheDarkForces/DarkForces/"
[Startup] TFE_System::init
[Display] Vertical Sync enabled.
[RenderBackend] GL Info: (null), (null), (null)
[RenderBackend] OpenGL Device Tier: 0
[Error : RenderBackend] OpenGL capabilities insufficient for ImGUI
[Critical : GPU] Cannot initialize GPU/Window.

freeartist-devuan@home:~/Downloads/TheDarkForces/TheForceEngine-test1/tfe-test1-build$ 
mlauss2 commented 1 month ago

you have apparently no OpenGL support at all (either missing in libSDL2 or on your system). Can you paste the "glxinfo" or "eglinfo" output somewhere please?

12sunflowers commented 1 month ago

My old gf9800gtx not fully supports all opengl 3.3 extensions eglinfo.txt glxinfo.txt

12sunflowers commented 1 month ago

you have apparently no OpenGL support at all (either missing in libSDL2 or on your system).

others games running well ezquake zandronum ut99

mlauss2 commented 1 month ago

I have a hunch, could you please test my "test2" branch? https://github.com/mlauss2/TheForceEngine/tree/test2

EDIT or do this change manually in the top-level CMakeLists.txt file:

index 00046ba5..c6050ea9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -61,7 +61,7 @@ if(ENABLE_TFE)
        find_package(Threads REQUIRED)
        find_package(SDL2 2.0.20 REQUIRED)
        pkg_check_modules(SDL2_IMAGE REQUIRED SDL2_image)
-       set(OpenGL_GL_PREFERENCE GLVND)
+       set(OpenGL_GL_PREFERENCE LEGACY)
        find_package(OpenGL REQUIRED)
        target_include_directories(tfe PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
        target_include_directories(tfe PRIVATE ${SDL2_INCLUDE_DIRS})
12sunflowers commented 1 month ago

Screenshot_2024-06-03_00-24-58

I have a hunch, could you please test my "test2" branch?

Amazing! You are a wizard! All working good now!) Thanks for magic! Where is was an issue?

mlauss2 commented 1 month ago

Great! The 340.xx nvidia driver series is the last that does not support glvnd (which is a method to have multiple libGL.so files on your system if you have e.g. intel igpu + nvidia dgpu and want to do opengl on both), however modern CMake sets it as default (I did as well in the CMakeLists.txt file), which links the binary against "libOpenGL.so" which does exist on your system, but the nvidia driver cannot work with it. Almost all applications still just open libGL.so which is why the rest worked for you.

I'll prepare a PR.

12sunflowers commented 1 month ago

Great! The 340.xx nvidia driver series is the last that does not support glvnd (which is a method to have multiple libGL.so files on your system if you have e.g. intel igpu + nvidia dgpu and want to do opengl on both), however modern CMake sets it as default (I did as well in the CMakeLists.txt file), which links the binary against "libOpenGL.so" which does exist on your system, but the nvidia driver cannot work with it. Almost all applications still just open libGL.so which is why the rest worked for you.

I'll prepare a PR.

Thanks for explanations. It's all bit mess for me but very exiting. Can you suggest some reading about all of that stuff? Radeon drivers also use same way as nvidia, i mean GLX or GLVND?

mlauss2 commented 2 days ago

Hello @12sunflowers, could you please test lucius' latest tree whether it works for you? Some other changes have gone it, notably one which removed the whole OpenGL stuff from CMakeLists altogether.

Thanks!

12sunflowers commented 1 day ago

@mlauss2 Hello man! Build current master - worked like a charm!) Thanks a lot for bring back us childhood) Screenshot_2024-07-17_04-42-58

mlauss2 commented 1 day ago

fixed by #419

Thanks for testing!