Gallium R300 crash

Discussion in 'Mac and Linux' started by exterminans, June 15, 2013.

  1. exterminans

    exterminans Post Master General

    Messages:
    1,881
    Likes Received:
    986
    First of all, I'm aware that the used GPU (AMD X1400, DirectX 9c, Shader 3.0, 256MB) is actually far below recommended specs and that I'm also using the open source driver, so I'm not entitled for support.

    However, this card should be able to run PA with shadows turned off and all details on minimum, if it wasn't for a crash. Got enough games running on that card, despite it being so old.

    Version of libgl1-mesa-dri is 9.0.3

    Code:
    [09:33:28.310] INFO Building planet of radius 186 detail 0
    [09:33:28.421] INFO 0 features generated.
    [09:33:28.422] INFO 112. msec
        PlanetBuilder::buildAsync: 112. msec
            GenSurface: 259. usec
            UpdateBVH: 934. usec
            PreCsg: 34.0 msec
                Create Surface Meshes: 22.3 msec
                    Connectivity: 19.7 msec
                    other: 2.60 msec
                other: 11.7 msec
            Csg: 32.4 msec
            BuildMeshes: 26.1 msec
                Water: 6.08 usec
                Final: 2.80 msec
                SetupVT: 23.3 msec
                other: 9.64 usec
            getFeatures: 538. usec
            other: 17.3 msec
        other: 8.59 usec
    build complete
    
    [Thread 0x7fffe1e21700 (LWP 31806) exited]
    [09:33:40.328] INFO Brush not manifold fix it! TEST/pa/terrain/desert/fbx/desert_crack_09.papa
    [09:33:44.292] INFO Building planet of radius 552 detail 2
    [09:33:48.588] INFO CSGFilter 28.7 sec
    
    Program received signal SIGSEGV, Segmentation fault.
    rc_variable_list_get_writers_one_reader (var_list=var_list@entry=0x7fff6cc2cb28, 
        src_type=src_type@entry=0, src=src@entry=0x44f14bc) at compiler/radeon_variable.c:511
    511	compiler/radeon_variable.c: Datei oder Verzeichnis nicht gefunden.
    (gdb) backtrace 
    #0  rc_variable_list_get_writers_one_reader (var_list=var_list@entry=0x7fff6cc2cb28, 
        src_type=src_type@entry=0, src=src@entry=0x44f14bc) at compiler/radeon_variable.c:511
    #1  0x00007ffff37eee1f in peephole_mul_omod (var_list=0x7fff6cc2cb28, inst_mul=0x44f14a8, 
        c=0x7fffffffd3f0) at compiler/radeon_optimize.c:782
    #2  rc_optimize (c=0x7fffffffd3f0, user=<optimized out>) at compiler/radeon_optimize.c:886
    #3  0x00007ffff37e13be in rc_run_compiler_passes (c=c@entry=0x7fffffffd3f0, 
        list=list@entry=0x7fffffffd040) at compiler/radeon_compiler.c:463
    #4  0x00007ffff37e1467 in rc_run_compiler (c=c@entry=0x7fffffffd3f0, 
        list=list@entry=0x7fffffffd040) at compiler/radeon_compiler.c:489
    #5  0x00007ffff37f1b00 in r3xx_compile_fragment_program (c=c@entry=0x7fffffffd3f0)
        at compiler/r3xx_fragprog.c:146
    #6  0x00007ffff37e8b96 in r300_translate_fragment_shader (r300=r300@entry=0xbe1280, 
        shader=0x44e2640, tokens=0x4399e70) at r300_fs.c:517
    #7  0x00007ffff37e9ba7 in r300_pick_fragment_shader (r300=r300@entry=0xbe1280) at r300_fs.c:595
    #8  0x00007ffff37dc1f8 in r300_validate_fragment_shader (r300=0xbe1280)
        at r300_state_derived.c:995
    #9  r300_update_derived_state (r300=r300@entry=0xbe1280) at r300_state_derived.c:1022
    #10 0x00007ffff37d3f2f in r300_draw_vbo (pipe=0xbe1280, dinfo=<optimized out>)
        at r300_render.c:805
    #11 0x00007ffff348375b in u_vbuf_draw_vbo (mgr=0xc99670, info=0x7fffffffd990)
        at util/u_vbuf.c:1015
    #12 0x00007ffff35189e3 in st_draw_vbo (ctx=0xc0fe20, prims=<optimized out>, 
        nr_prims=<optimized out>, ib=0x7fffffffda40, index_bounds_valid=<optimized out>, 
        min_index=4294967295, max_index=4294967295, tfb_vertcount=0x0)
        at ../../../../../src/mesa/state_tracker/st_draw.c:278
    #13 0x00007ffff2f8059a in vbo_handle_primitive_restart (ctx=<optimized out>, 
        prim=<optimized out>, nr_prims=<optimized out>, ib=<optimized out>, 
        index_bounds_valid=<optimized out>, min_index=<optimized out>, max_index=4294967295)
        at ../../../../../src/mesa/vbo/vbo_exec_array.c:570
    #14 0x00007ffff2f81574 in vbo_validated_drawrangeelements (ctx=ctx@entry=0xc0fe20, 
        mode=mode@entry=4, index_bounds_valid=index_bounds_valid@entry=0 '\000', 
        start=start@entry=4294967295, end=end@entry=4294967295, count=count@entry=61440, 
        type=type@entry=5123, indices=indices@entry=0x0, basevertex=basevertex@entry=0, 
        numInstances=numInstances@entry=1, baseInstance=baseInstance@entry=0)
        at ../../../../../src/mesa/vbo/vbo_exec_array.c:867
    #15 0x00007ffff2f818e4 in vbo_exec_DrawElements (mode=4, count=61440, type=5123, indices=0x0)
        at ../../../../../src/mesa/vbo/vbo_exec_array.c:997
    #16 0x00000000005a8363 in crom::ras::GLRasterizer::drawIndexedPrimitive (this=<optimized out>, 
        type=<optimized out>, base_vertex_index=<optimized out>, min_vertex_index=<optimized out>, 
        num_verts=<optimized out>, start_index=<optimized out>, primitive_count=20480)
        at /home/jenkins/jobs/Planetary_Annihilation_Linux64/workspace/pa/live/engine/crom/gl_rasterizer.cpp:1194
    #17 0x00000000006748b1 in crom::RasRenSceneViewport::renderMeshes(std::vector<crom::RasRenDrawCall const*, std::allocator<crom::RasRenDrawCall const*> >&, zu::Mat4x4f const&, zu::StringRange, std::function<void (crom::RasRenDrawCall const&)> const&) (this=0x43bee00, drawcalls=..., viewproj=..., 
        technique=..., perCall=...)
        at /home/jenkins/jobs/Planetary_Annihilation_Linux64/workspace/pa/live/engine/crom/rasren_private/rasren_scene_viewport.cpp:835
    #18 0x0000000000677df2 in crom::RasRenSceneViewport::render (this=0x43bee00)
        at /home/jenkins/jobs/Planetary_Annihilation_Linux64/workspace/pa/live/engine/crom/rasren_private/rasren_scene_viewport.cpp:330
    #19 0x00000000005d3079 in crom::RasRen::present (this=0x1304110)
        at /home/jenkins/jobs/Planetary_Annihilation_Linux64/workspace/pa/live/engine/crom/rasren.cpp:207
    #20 0x000000000046100b in ClientGame::present (this=0xbcd210)
        at /home/jenkins/jobs/Planetary_Annihilation_Linux64/workspace/pa/live/client/client_main.cpp:1024
    #21 0x000000000040ad6a in main (argc=<optimized out>, argv=<optimized out>)
        at /home/jenkins/jobs/Planetary_Annihilation_Linux64/workspace/pa/live/engine/game/linux_game_main.cpp:88
    (gdb) quit
    A debugging session is active.
    
    	Inferior 1 [process 31671] will be killed.
    
    All settings in PA on minimum.
  2. compholio

    compholio New Member

    Messages:
    22
    Likes Received:
    0
    I'd contact the r300 folks, they can probably give you some debug options to turn out that will tell them why the shader is causing it to crash.
  3. radistmorse

    radistmorse Member

    Messages:
    59
    Likes Received:
    1
    Just launched using gallium r600 (amd TURKS). Looks fine, runs even on "uber", although slowly. Can't see fps, but feels like ~15 on calm spots (with lots of units&explosions perhaps it'll be even less).

    So the problem is either something r300 specific or the hardware. Or just try to update the mesa, I'm using the latest Mesa 9.2.0-devel (git-ce1f851).
  4. SXX

    SXX Post Master General

    Messages:
    6,896
    Likes Received:
    1,812
    Press "P" in game, it'w will show FPS information.
  5. exterminans

    exterminans Post Master General

    Messages:
    1,881
    Likes Received:
    986
    I will try with 9.1.3 first before I start experimenting with unstable versions. Reports follow as soon as distro upgrade has finished.
  6. exterminans

    exterminans Post Master General

    Messages:
    1,881
    Likes Received:
    986
    9.1.3 didn't solve the issue, but I managed to identify the reason for the crash and it won't be fixed in 9.2 either, at least not the cause of the SIGSEGV.

    Code:
    struct rc_list * rc_variable_list_get_writers_one_reader(
    	struct rc_list * var_list,
    	unsigned int src_type,
    	void * src)
    {
    	struct rc_list * writer_list =
    		rc_variable_list_get_writers(var_list, src_type, src);
    	struct rc_list * reader_list =
    		rc_variable_readers_union(writer_list->Item);
    	if (rc_list_count(reader_list) > 1) {
    		return NULL;
    	} else {
    		return writer_list;
    	}
    }
    That part crashes at "writer_list->Item", most likely because writer_list is NULL. rc_variable_list_get_writers can return NULL if a variable is read without being ever set.

    Tried it again with RADEON_DEBUG=noopt (because that error happens during shader optimization), but that won't work either (although for a different reason):
    One of the fragment shaders (most likely the terrain shader with the virtual texturing stuff) is to big for my poor old X1400. -.-

    Next step: Breaking my system git version of Mesa, hoping that some of the fixes on the optimizer which have been made for Unigine Heaven 3.0 will also fix the issue with the PA shader...

    UPDATE:
    And it did work.
    peephole_mul_omod() is fixed in 9.2.x, the Ubuntu xorg-edgers PPA has a version of the mesa package which is functional.

    Surprisingly enough, it works. Somehow. Partly...


    It think memory management can be considered utterly broken in that driver. For sure.
    And the performance isn't very appealing either yet, although playable. Which IS surprising.

    I suspected for over a year that memory management is broken (overlapping memory section), but this can be considered proof...

    Attached Files:

Share This Page