scp-fs2open / fs2open.github.com

Origin Repository for SCP FreeSpace 2 Open
https://www.hard-light.net/
Other
407 stars 163 forks source link

FSO crash on start (Linux/Nvidia) #986

Closed niffiwan closed 8 years ago

niffiwan commented 8 years ago

As of commit efdd4fae68f299a2cfaafd62e2af915efb92b5db FSO logs this error on startup:

Error: Unable to initialize display device!

File: gropengl.cpp
Line: 1546

Full log: fs2_open.log.txt

OS is Mint 17.3 with GTS 450. Prior commits produce this in the log:

Initializing OpenGL graphics device at 1600x900 with 32-bit color...
  Initializing SDL video...
  Requested SDL Video values = R: 8, G: 8, B: 8, depth: 24, stencil: 8, double-buffer: 1, FSAA: 4
  Actual SDL Video values    = R: 8, G: 8, B: 8, depth: 24, stencil: 8, double-buffer: 1, FSAA: 4
  OpenGL Vendor    : NVIDIA Corporation
  OpenGL Renderer  : GeForce GTS 450/PCIe/SSE2
  OpenGL Version   : 4.4.0 NVIDIA 340.96

  Using extension "GL_EXT_fog_coord".
  Using extension "GL_ARB_multitexture".
  Using extension "GL_ARB_texture_env_add".
  Using extension "GL_ARB_texture_compression".
  Using extension "GL_EXT_texture_compression_s3tc".
  Using extension "GL_EXT_texture_filter_anisotropic".
  Using extension "GL_ARB_texture_env_combine".
  Using extension "GL_EXT_compiled_vertex_array".
  Using extension "GL_EXT_draw_range_elements".
  Using extension "GL_ARB_texture_mirrored_repeat".
  Using extension "GL_ARB_texture_non_power_of_two".
  Using extension "GL_ARB_vertex_buffer_object".
  Using extension "GL_ARB_pixel_buffer_object".
  Using extension "GL_SGIS_generate_mipmap".
  Using extension "GL_EXT_framebuffer_object".
  Using extension "GL_ARB_texture_rectangle".
  Using extension "GL_EXT_bgra".
  Using extension "GL_ARB_texture_cube_map".
  Using extension "GL_EXT_texture_lod_bias".
  Using extension "GL_ARB_point_sprite".
  Using extension "GL_ARB_shading_language_100".
  Using extension "GL_ARB_shader_objects".
  Using extension "GL_ARB_vertex_shader".
  Using extension "GL_ARB_fragment_shader".
  Using extension "GL_ARB_shader_texture_lod".
  Using extension "GL_ARB_texture_float".
  Using extension "GL_ARB_draw_elements_base_vertex".
  Using extension "GL_EXT_framebuffer_blit".
  Using extension "GL_EXT_geometry_shader4".
  Using extension "GL_EXT_texture_array".
  Using extension "GL_ARB_uniform_buffer_object".
  Found extension "GL_EXT_transform_feedback", but can't find the required function "glBeginTransformFeedbackEXT()".  Extension will be disabled!
  Using extension "GL_ARB_draw_instanced".
  Using extension "GL_ARB_texture_buffer_object".
  Using extension "GL_ARB_color_buffer_float".
  Using extension "GL_ARB_seamless_cube_map".
  Found special extension function "glXSwapIntervalSGI".

Compiling new shader:
    Particle Effects
   Loading built-in default shader for: effect-v.sdr
   Loading built-in default shader for: effect-particle-f.sdr
Shader Variant Features:
Compiling new shader:
    Particle Effects
   Loading built-in default shader for: effect-v.sdr
   Loading built-in default shader for: effect-particle-f.sdr
   Loading built-in default shader for: effect-screen-g.sdr
Shader Variant Features:
    Geometry shader point-based particles
Compiling new shader:
    Distortion Effects
   Loading built-in default shader for: effect-distort-v.sdr
   Loading built-in default shader for: effect-distort-f.sdr
Shader Variant Features:
Compiling new shader:
    Deferred Lighting
   Loading built-in default shader for: deferred-v.sdr
   Loading built-in default shader for: deferred-f.sdr
Shader Variant Features:
Compiling new shader:
    Clear Deferred Lighting Buffer
   Loading built-in default shader for: deferred-clear-v.sdr
   Loading built-in default shader for: deferred-clear-f.sdr
Shader Variant Features:
Compiling passthrough shader...
Compiling new shader:
    Passthrough
   Loading built-in default shader for: passthrough-v.sdr
   Loading built-in default shader for: passthrough-f.sdr
Shader Variant Features:

Compiling new shader:
    Post Processing
   Loading built-in default shader for: post-v.sdr
   Loading built-in default shader for: post-f.sdr
Shader Variant Features:
Compiling new shader:
    Bloom Brightpass
   Loading built-in default shader for: post-v.sdr
   Loading built-in default shader for: brightpass-f.sdr
Shader Variant Features:
Compiling new shader:
    Gaussian Blur
   Loading built-in default shader for: post-v.sdr
   Loading built-in default shader for: blur-f.sdr
Shader Variant Features:
    Horizontal blur pass
Compiling new shader:
    Gaussian Blur
   Loading built-in default shader for: post-v.sdr
   Loading built-in default shader for: blur-f.sdr
Shader Variant Features:
    Vertical blur pass
Compiling new shader:
    Bloom Compositing
   Loading built-in default shader for: post-v.sdr
   Loading built-in default shader for: bloom-comp-f.sdr
Shader Variant Features:
Compiling new shader:
    FXAA
   Loading built-in default shader for: fxaa-v.sdr
   Loading built-in default shader for: fxaa-f.sdr
Shader Variant Features:
Compiling new shader:
    FXAA Prepass
   Loading built-in default shader for: post-v.sdr
   Loading built-in default shader for: fxaapre-f.sdr
Shader Variant Features:
  Max texture units: 4 (32)
  Max client texture states: 4 (8)
  Max elements vertices: 1048576
  Max elements indices: 1048576
  Max texture size: 16384x16384
  Max render buffer size: 16384x16384
  Can use compressed textures: YES
  Texture compression available: YES
  Post-processing enabled: YES
  Using trilinear texture filter.
  OpenGL Shader Version: 4.40 NVIDIA via Cg compiler
... OpenGL init is complete!
asarium commented 8 years ago

Try disabling anti aliasing. I have seen some issues with that.

niffiwan commented 8 years ago

Cool, setting Anti-aliasing to Off in wxLauncher has resolved the issue (and wow, look at all that OpenGL debug info now being logged to STDOUT)

niffiwan commented 8 years ago

actually, I might leave it open for a little longer in case there's some way to add a more graceful error message in this situation...

Also confirming that FXAA doesn't seem to trigger the crash, only setting OGL_AntiAliasSamples to a non-zero value in fs2_open.ini

asarium commented 8 years ago

FXAA uses post processing but OGL_AntiAliasSamples enables the multi sampling on the driver level. I have no idea why it fails for Nvida but I also can't test any code that may fix it since the Mesa drivers work fine. We could try lowering the multisample level if the requested level cannot be used but it's very hard to do that since there is no clear feedback from SDL wich explains why the OpenGL context creation failed.

niffiwan commented 8 years ago

I've tried 2x & 4x settings, neither works so I don't think a graceful reduction of the level will work. Just settled for providing a suggestion in the error message.