Bug 108179 - [ivb] gpu hang on Star Ruler 2
Summary: [ivb] gpu hang on Star Ruler 2
Status: RESOLVED NOTOURBUG
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Intel 3D Bugs Mailing List
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-03 21:20 UTC by Sergey Alirzaev
Modified: 2018-10-31 11:08 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
GPU crash dump (101.51 KB, text/plain)
2018-10-03 21:20 UTC, Sergey Alirzaev
Details

Description Sergey Alirzaev 2018-10-03 21:20:41 UTC
Created attachment 141864 [details]
GPU crash dump

[  281.853616] [drm] GPU HANG: ecode 7:0:0x85ffdff8, in StarRuler2.bin [15069], reason: hang on rcs0, action: reset
[  281.853619] [drm] GPU hangs can indicate a bug anywhere in the entire gfx stack, including userspace.
[  281.853620] [drm] Please file a _new_ bug report on bugs.freedesktop.org against DRI -> DRM/Intel
[  281.853630] [drm] drm/i915 developers can then reassign to the right component if it's not a kernel issue.
[  281.853631] [drm] The gpu crash dump is required to analyze gpu hangs, so please always attach it.
[  281.853632] [drm] GPU crash dump saved to /sys/class/drm/card0/error
[  281.853672] i915 0000:00:02.0: Resetting chip for hang on rcs0
[  289.947765] i915 0000:00:02.0: Resetting chip for hang on rcs0
[  297.837398] i915 0000:00:02.0: Resetting chip for hang on rcs0
[  305.943597] i915 0000:00:02.0: Resetting chip for hang on rcs0
[  313.836562] i915 0000:00:02.0: Resetting chip for hang on rcs0
[  321.942939] i915 0000:00:02.0: Resetting chip for hang on rcs0

It always occurs when one starts a new game of Star Ruler 2: Rising Stars as Bluuhbi species (supposedly because they come with Ringworlds).

Reproduced it on drm-tip; the dump was made on 97b376a5213463a70eb977282f5486ded096648f

x86_64, Gentoo GNU/Linux, Thinkpad X230, eDP
Comment 1 Marina Chernish 2018-10-08 13:56:59 UTC
Hi Sergey,

Could you please specify which kind of mod have you used. I've found several versions of Rising Stars and tried 1.2.0 one.
Also it would be helpful if you could clarify mesa version you had this hang on.
By the way, should this game be launched using Vulkan or OpenGL?
Also have you started game from Steam or directly using game launch file?

I've tried to reproduce this hang using following configuration:

Ivybridge; CPU: Intel Core i5-3470; GPU: Intel® HD Graphics 2500
Linux Arch x86_64; kernel 4.14.52
mesa-18.2.0

but everything works good. Have no hang you've described.
Comment 2 Sergey Alirzaev 2018-10-08 13:59:51 UTC
(In reply to Marina Chernish from comment #1)
> Hi Sergey,
> 
> Could you please specify which kind of mod have you used. I've found several
> versions of Rising Stars and tried 1.2.0 one.

https://github.com/DaloLorn/Rising-Stars

> Also it would be helpful if you could clarify mesa version you had this hang
> on.

18.2.1

> By the way, should this game be launched using Vulkan or OpenGL?

OpenGL apparently as i don't have vulkan built in my mesa.

> Also have you started game from Steam or directly using game launch file?

I've built it from https://github.com/BlindMindStudios/StarRuler2-Source
Comment 4 Danylo 2018-10-18 13:18:28 UTC
Compiling the offending shader "ringworld_procedural_ps.txt" produces warnings about uninitialized variable "atmoSteps".

> atmoSteps = 4 - int(atmoSteps * 2.0);
As could be seen in shader it is used without being initialized.

Later it is passed to cloudMaker function where is used for the loop as iterations count.

Accessing uninitialized variable is a valid operation but yields undefined result, "atmoSteps" became a huge value in some of invocations thus hanging the GPU.  

GLSL 4.4 spec says:

> Reading a variable before writing (or initializing) it is legal, however the value is undefined.

I don't know what value it should be initialized to but initializing it resolves the hang.
Comment 5 Danylo 2018-10-31 11:08:11 UTC
The discussion of the issue continued in https://github.com/DaloLorn/Rising-Stars/issues/66

Unless we want to implicitly initialize variables to 0 which is not defined by spec and doesn't really look like something we want - I would consider this bug as 100% not ours.


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.