Bug 97890 - Kerbal Space Program freezes randomly when DRI3 is enabled
Summary: Kerbal Space Program freezes randomly when DRI3 is enabled
Status: RESOLVED NOTOURBUG
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: 12.0
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Intel 3D Bugs Mailing List
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 77449
  Show dependency treegraph
 
Reported: 2016-09-21 18:30 UTC by Jacek Konieczny
Modified: 2016-11-07 11:54 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Jacek Konieczny 2016-09-21 18:30:54 UTC
With recent KSP 1.2 pre-releases freeze randomly unless LIBGL_DRI3_DISABLE=1 is used.  (KSP 1.1 was hardly usable on Linux due to many bugs in the Unity 3D version used then)

I got best results (no freezes) on my Haswell laptop using the following steam launch options: 'LIBGL_DRI3_DISABLE=1 %command%_64 -force-glcore'

As soon I drop the 'LIBGL_DRI3_DISABLE=1', the game would freeze – it could happen as early as on the loading screen, or several minutes into the game play.

Mesa 12.0.2, 12.0.3
Linux kernel 4.7.1
libdrm 2.4.70

KSP builds 1.2.0.1473 – 1.2.0.1517

The same freezes happened on my work PC – Skylake-based.

KSP bug report: http://bugs.kerbalspaceprogram.com/issues/11420

It might be another Unity 3D bug, but it might be a driver problem.
Comment 1 Eero Tamminen 2016-09-27 16:07:12 UTC
I tried KSP v1.1.3.1289 that Steam currently provides, on SKL GT2 with Ubuntu 16.04 (i.e. v4.4 kernel with i915 backport for v4.6) configured for DRI3.

I got freeze at KSP startup when using Ubuntu 16.04 Mesa 11.2.  It was early in the loading phase.  There were 35(!) threads in total, most waiting in futexes & mutexes, but some were still active.  Game just didn't progress forward.

Using Git version of Mesa the game worked without freezes many times, until one time it again froze.

When it starts OK, there are some rendering issues.  E.g. when selecting settings, none of the setting tabs has any visible content.  In the game itself:
- "Choose flag" and Runway dialogs contents are also empty
- Lines shown on hangar floor are flickering and their texture is garbage

The game log file:
~/.config/unity3d/Squad/Kerbal\ Space\ Program/Player.log

Doesn't show any warnings from Mesa.  So yes, KSP 1.1 doesn't seem to work very well.


As to your KSP 1.2-pre version...

Do the KSP settings tabs look OK for you?

When the game freezes, if you do "strace -f -p PID" (e.g. as root through SSH console), is the game still active?

If you attach to it with Gdb, where it's stuck:
$ gdb /proc/$(pidof KSP.x86)/exe $(pidof KSP.x86)
(gdb) info threads
(gdb) bt
?
Comment 2 Jacek Konieczny 2016-09-27 17:53:28 UTC
> I tried KSP v1.1.3.1289 that Steam currently provides

1.2 prerelase is also available on steam, just select the 'prerelease' public beta.

> When it starts OK, there are some rendering issues.  E.g. when selecting settings, none of the setting tabs has any visible content.

That is a known problem of KSP 1.1: http://bugs.kerbalspaceprogram.com/issues/9341
With a known workaround: -force-glcore33

KSP 1.1 would often crash anyway. And those problems are known to affect very different Linux systems, not only those with Intel GPUs.

> As to your KSP 1.2-pre version...
> Do the KSP settings tabs look OK for you?

Yes, this problem is gone.

> When the game freezes, if you do "strace -f -p PID" (e.g. as root through SSH console), is the game still active?
> If you attach to it with Gdb, where it's stuck:

I will do this debugging later today, or tomorrow.
Comment 3 Jacek Konieczny 2016-09-27 18:15:35 UTC
Ok, managed to check it right now:

> When the game freezes, if you do "strace -f -p PID", is the game still active?

Yes, shows a lot of I/O on some pipes and sockets.

> If you attach to it with Gdb, where it's stuck:
> $ gdb /proc/$(pidof KSP.x86_64)/exe $(pidof KSP.x86_64)
> (gdb) info threads

(gdb) info threads
  Id   Target Id         Frame 
  37   Thread 0x7fb8dbf54700 (LWP 27994) "KSP.x86_64" 0x00007fb8db8d4478 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
  36   Thread 0x7fb8d462b700 (LWP 27995) "KSP.x86_64" 0x00007fb8db8d6597 in do_futex_wait.constprop () from /lib64/libpthread.so.0
  35   Thread 0x7fb8cffff700 (LWP 27996) "KSP.x86_64" 0x00007fb8db8d6597 in do_futex_wait.constprop () from /lib64/libpthread.so.0
  34   Thread 0x7fb8c7fff700 (LWP 27997) "KSP.x86_64" 0x00007fb8db8d40cf in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
  33   Thread 0x7fb8c77fe700 (LWP 27998) "KSP.x86_64" 0x00007fb8db8d6597 in do_futex_wait.constprop () from /lib64/libpthread.so.0
  32   Thread 0x7fb8c6ffd700 (LWP 27999) "KSP.x86_64" 0x00007fb8db8d6597 in do_futex_wait.constprop () from /lib64/libpthread.so.0
  31   Thread 0x7fb8c67fc700 (LWP 28000) "KSP.x86_64" 0x00007fb8db8d6597 in do_futex_wait.constprop () from /lib64/libpthread.so.0
  30   Thread 0x7fb8c5ffb700 (LWP 28001) "KSP.x86_64" 0x00007fb8db8d6597 in do_futex_wait.constprop () from /lib64/libpthread.so.0
  29   Thread 0x7fb8c57fa700 (LWP 28002) "KSP.x86_64" 0x00007fb8db8d6597 in do_futex_wait.constprop () from /lib64/libpthread.so.0
  28   Thread 0x7fb8c4ff9700 (LWP 28003) "KSP.x86_64" 0x00007fb8db8d6597 in do_futex_wait.constprop () from /lib64/libpthread.so.0
  27   Thread 0x7fb8abfff700 (LWP 28004) "KSP.x86_64" 0x00007fb8db8d6597 in do_futex_wait.constprop () from /lib64/libpthread.so.0
  26   Thread 0x7fb8ab7fe700 (LWP 28005) "KSP.x86_64" 0x00007fb8db8d6597 in do_futex_wait.constprop () from /lib64/libpthread.so.0
  25   Thread 0x7fb8aaffd700 (LWP 28006) "KSP.x86_64" 0x00007fb8db8d6597 in do_futex_wait.constprop () from /lib64/libpthread.so.0
  24   Thread 0x7fb8aa7fc700 (LWP 28007) "KSP.x86_64" 0x00007fb8db8d6597 in do_futex_wait.constprop () from /lib64/libpthread.so.0
  23   Thread 0x7fb8a9ffb700 (LWP 28008) "KSP.x86_64" 0x00007fb8db8d6597 in do_futex_wait.constprop () from /lib64/libpthread.so.0
  22   Thread 0x7fb8a97fa700 (LWP 28009) "KSP.x86_64" 0x00007fb8db8d6597 in do_futex_wait.constprop () from /lib64/libpthread.so.0
  21   Thread 0x7fb8a8ff9700 (LWP 28010) "KSP.x86_64" 0x00007fb8db8d6597 in do_futex_wait.constprop () from /lib64/libpthread.so.0
  20   Thread 0x7fb89ffff700 (LWP 28011) "KSP.x86_64" 0x00007fb8db8d6597 in do_futex_wait.constprop () from /lib64/libpthread.so.0
  19   Thread 0x7fb89f7fe700 (LWP 28012) "KSP.x86_64" 0x00007fb8db8d6597 in do_futex_wait.constprop () from /lib64/libpthread.so.0
  18   Thread 0x7fb89effd700 (LWP 28013) "KSP.x86_64" 0x00007fb8db8d6597 in do_futex_wait.constprop () from /lib64/libpthread.so.0
  17   Thread 0x7fb89e7fc700 (LWP 28014) "KSP.x86_64" 0x00007fb8db8d6597 in do_futex_wait.constprop () from /lib64/libpthread.so.0
  16   Thread 0x7fb89dffb700 (LWP 28015) "KSP.x86_64" 0x00007fb8db8d6597 in do_futex_wait.constprop () from /lib64/libpthread.so.0
  15   Thread 0x7fb89d7fa700 (LWP 28016) "KSP.x86_64" 0x00007fb8db8d6597 in do_futex_wait.constprop () from /lib64/libpthread.so.0
  14   Thread 0x7fb89cff9700 (LWP 28017) "KSP.x86_64" 0x00007fb8db8d6597 in do_futex_wait.constprop () from /lib64/libpthread.so.0
  13   Thread 0x7fb87ffff700 (LWP 28018) "KSP.x86_64" 0x00007fb8db8d6597 in do_futex_wait.constprop () from /lib64/libpthread.so.0
  12   Thread 0x7fb87f7fe700 (LWP 28019) "KSP.x86_64" 0x00007fb8db8d6597 in do_futex_wait.constprop () from /lib64/libpthread.so.0
  11   Thread 0x7fb87effd700 (LWP 28020) "KSP.x86_64" 0x00007fb8db8d6597 in do_futex_wait.constprop () from /lib64/libpthread.so.0
  10   Thread 0x7fb87e7fc700 (LWP 28021) "KSP.x86_64" 0x00007fb8db8d6597 in do_futex_wait.constprop () from /lib64/libpthread.so.0
  9    Thread 0x7fb87dffb700 (LWP 28022) "KSP.x86_64" 0x00007fb8db8d6597 in do_futex_wait.constprop () from /lib64/libpthread.so.0
  8    Thread 0x7fb87d7fa700 (LWP 28023) "KSP.x86_64" 0x00007fb8db8d6597 in do_futex_wait.constprop () from /lib64/libpthread.so.0
  7    Thread 0x7fb87cff9700 (LWP 28024) "KSP.x86_64" 0x00007fb8db8d6597 in do_futex_wait.constprop () from /lib64/libpthread.so.0
  6    Thread 0x7fb857fff700 (LWP 28028) "threaded-ml" 0x00007fb8da21628d in poll () from /lib64/libc.so.6
  5    Thread 0x7fb8cc11d700 (LWP 28029) "KSP.x86_64" 0x00007fb8db8d40b7 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
  4    Thread 0x7fb8cc111700 (LWP 28030) "KSP.x86_64" 0x00007fb8da1eeb7d in nanosleep () from /lib64/libc.so.6
  3    Thread 0x7fb8c408e700 (LWP 28033) "KSP.x86_64" 0x00007fb8db8d6597 in do_futex_wait.constprop () from /lib64/libpthread.so.0
  2    Thread 0x7fb83445a700 (LWP 28693) "KSP.x86_64" 0x00007fb8da1eeb7d in nanosleep () from /lib64/libc.so.6
* 1    Thread 0x7fb8dc0d7800 (LWP 27991) "KSP.x86_64" 0x00007fb8db8d6597 in do_futex_wait.constprop () from /lib64/libpthread.so.0


> (gdb) bt

Nothing interesting:
(gdb) bt
#0  0x00007fb8db8d6597 in do_futex_wait.constprop () from /lib64/libpthread.so.0
#1  0x00007fb8db8d6644 in __new_sem_wait_slow.constprop.0 () from /lib64/libpthread.so.0
#2  0x0000000000f08819 in ?? ()
#3  0x0000000000f02d27 in ?? ()
#4  0x00000000007c8f73 in ?? ()
#5  0x00000000004661bb in ?? ()
#6  0x00007fb8da1567a0 in __libc_start_main () from /lib64/libc.so.6
#7  0x000000000046f695 in ?? ()
#8  0x00007ffc7cecdc28 in ?? ()
#9  0x000000000000001c in ?? ()
#10 0x0000000000000001 in ?? ()
#11 0x00007ffc7cecfec1 in ?? ()
#12 0x0000000000000000 in ?? ()


I guess the most interesting part will be this fragment from 'thread apply all bt':


Thread 34 (Thread 0x7fb8c7fff700 (LWP 27997)):
#0  0x00007fb8db8d40cf in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007fb8d845fb7f in ?? () from /home/users/jajcus/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu/libxcb.so.1
#2  0x00007fb8d8461002 in xcb_wait_for_special_event ()
   from /home/users/jajcus/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu/libxcb.so.1
#3  0x00007fb8db49aea7 in ?? () from /usr/lib64/libGL.so.1
#4  0x00007fb8db49bc70 in ?? () from /usr/lib64/libGL.so.1
#5  0x00007fb8cf2f3a7d in intel_update_image_buffers (drawable=0x2b61970, brw=0x2d05de8) at brw_context.c:1682
#6  intel_update_renderbuffers (context=context@entry=0x3883020, drawable=drawable@entry=0x2b61970) at brw_context.c:1397
#7  0x00007fb8cf2f3ee1 in intel_prepare_render (brw=brw@entry=0x2d05de8) at brw_context.c:1418
#8  0x00007fb8cf2e6da0 in brw_clear (ctx=0x2d05de8, mask=50) at brw_clear.c:232
#9  0x0000000000f0dd91 in ?? ()
#10 0x0000000000f1111f in ?? ()
#11 0x0000000000f077c7 in ?? ()
#12 0x00000000008e4f08 in ?? ()
#13 0x00007fb8db8ce46d in start_thread () from /lib64/libpthread.so.0
#14 0x00007fb8da21f65d in clone () from /lib64/libc.so.6
#15 0x0000000000000000 in ?? ()

Maybe, I should try removing '/home/users/jajcus/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu/libxcb.so.1', in case libxcb from Steam Runtime is broken?
Comment 4 Eero Tamminen 2016-09-28 16:40:11 UTC
Missing dialog content is there only with Ubuntu 11.2 Mesa (there's both x86 & x64 version of KSP and Steam runs by default 32-bit one, I had installed only x64 Mesa Git).

With today's Mesa Git, dialog content is rendered fine even with KSP v1.1 (both in 32 & 64-bit versions).

(Hangar floor lines texture is still broken in it though.)


(In reply to Jacek Konieczny from comment #3)
> Maybe, I should try removing
> '/home/users/jajcus/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/
> lib/x86_64-linux-gnu/libxcb.so.1', in case libxcb from Steam Runtime is
> broken?

There have been a lot updates needed all over 3D stack for DRI3.  Libxcb from 2012 is definitely too old for DRI3.

-> This looks like Steam run-time libs issue.


You may need to remove also other X libraries to get things working well with DRI3.

If you get it working, please comment here so that this can be marked as NOTOURBUG.
Comment 5 Jacek Konieczny 2016-09-28 19:19:52 UTC
> There have been a lot updates needed all over 3D stack for DRI3.  Libxcb from 2012 is definitely too old for DRI3.
> 
> -> This looks like Steam run-time libs issue.
> 
> You may need to remove also other X libraries to get things working well with DRI3.

I removed all libxcb* and libX* from the steam runtime and have not been able to make KSP freeze any more.

> If you get it working, please comment here so that this can be marked as NOTOURBUG.

Feel free to do that. In case it was just luck today (do to the random nature of the bug), I will reopen this, but for now it seems like it is a steam runtime bug, indeed.

I have filed a Steam on Linux bug report: https://github.com/ValveSoftware/steam-for-linux/issues/4638, one like many similar for current system libraries being overridden by outdated ones.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.