Bug 104809 - anv: DOOM 2016 and Wolfenstein II:The New Colossus crash due to not having depthBoundsTest
Summary: anv: DOOM 2016 and Wolfenstein II:The New Colossus crash due to not having de...
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Vulkan/intel (show other bugs)
Version: git
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: 2018-01-27 14:57 UTC by Darius Spitznagel
Modified: 2018-08-26 19:43 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Darius Spitznagel 2018-01-27 14:57:06 UTC
Hello devs,

both games crash with GPU hang.
First I thought its and wine issue.
I use wine-vulkan from...
https://github.com/roderickc/wine-vulkan

I have reported my issues here...
https://github.com/roderickc/wine-vulkan/issues/6

What I've found out is that both games to not run with mesa higher that 17.1 because of commit 5dd96b1156e25e10d649d49377df02763fcd45a5.

anv: check support for enabled features in vkCreateDevice()
From Vulkan spec, 4.2.1. "Device Creation":

  "vkCreateDevice verifies that extensions and features requested in
   the ppEnabledExtensionNames and pEnabledFeatures members of
   pCreateInfo, respectively, are supported by the implementation."

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@gmail.com>

Simply reverting this commit in every mesa version higher that 17.2 makes both games run.
Otherwise you get "FATAL ERROR: vkCreateDevice failed with error (VK_ERROR_FEATURE_NOT_PRESENT)" error on launch.

Wolfenstein II has a free demo on steam you can test with.
There the GPU crash occurs directly when use start a campaign.

With DOOM 2016 the GPU crash happens during gameplay.

The gpu hangs/crashes are always reproducible and happen also in DOOM 2016 with mesa version lower than 17.2 where commit 5dd96b1156e25e10d649d49377df02763fcd45a5 isn't there.

If you need the gpu crash dumps please let me know.
Comment 1 Darius Spitznagel 2018-01-27 14:59:18 UTC
> Simply reverting this commit in every mesa version higher that 17.2 makes both games run.

I meant higher than 17.1 - sorry.
Comment 2 Darius Spitznagel 2018-01-27 15:01:57 UTC
This was tested with:
Kernel 4.9.77
libdrm 2.4.88
Mesa master, 17.0.x, 17.1.x, 17.2.x, 17.3.x, 18.0-rc2
Intel(R) Iris Pro 6200 (Broadwell GT3e)
Comment 3 Jason Ekstrand 2018-01-27 18:25:00 UTC
This is a known issue in the engine used for DOOM and Wolfenstein.  They require the depthBoundsTest feature without checking for whether or not it's actually there.  This is definitely an application bug.  That said, it should be easy enough to let those two games through with driver hack.
Comment 4 Darius Spitznagel 2018-01-27 19:34:33 UTC
Is this feature also responsible for the GPU hangs?

I'm glad to test a hack.
Comment 5 Jason Ekstrand 2018-01-27 20:29:34 UTC
(In reply to Darius Spitznagel from comment #4)
> Is this feature also responsible for the GPU hangs?

No, there are two separate bugs here.  Please open a second bug report for the hang.  We had GPU hangs with DOOM quite some time ago but I thought I'd fixed them.  It's possible that more recent driver changes have brought them back.
Comment 6 Darius Spitznagel 2018-08-22 19:47:21 UTC
Hello Jason, hello Intel devs,

currently I'm a little bit disappointed.

As you know we have now Proton (wine fork) in the linux Steam client.
But i965 still has not workaround for depthBoundstest for DOOM 2016 and Wolfenstein2 :(

So I have enabled it again in mesa-18.2-rc4 and gave it a try > Still GPU hangs with Boradwell IrisPro 2600 :(
See https://bugzilla.freedesktop.org/show_bug.cgi?id=104816

Don't take this personal but I really consider to switch from Intel to complete AMD System.
AMD/RADV developers seem to take much more care these days:
1. OpenGL compatibility profiles
2. Kens GL threaded support still not upstream for Intel
3. Many fixes for broken games

Whats the biggest purpose for OpenGL? CAD oder Games???

Hopefully the new Iris driver can change things, but when I remeber correctly it will only work with newer chips than Broadwell :(

And then we have always new Intel vulnerabilities :(
I don't really know what I should think about Intel these days!?

I'm really frustrated.
Comment 7 Darius Spitznagel 2018-08-23 11:46:21 UTC
Sorry guys - was in bad mood yesterday:(

For DOOM and Wolfenstein2 I meant of course anv.

Let me know If I can do something although I don't know how to trace Proton.

Regards
Darius
Comment 8 Sergii Romantsov 2018-08-23 14:40:29 UTC
Hello, Darius.
Could you, please, try to install package 'mesa-vulkan-drivers' and check if it changes launching error (related to vkCreateDevice)? At least with Wolfenstein2 in Steam client (with Proton).
Comment 9 Jason Ekstrand 2018-08-23 15:15:08 UTC
The last time I sat down to look at this, I wrote a patch series which claims the depthBoundsTest feature whenever it sees that the engine name is "idTech" but I never sent them out because I got stuck trying to figure out the hang.  I just sent them.  Still no progress on the hang. :(
Comment 10 Darius Spitznagel 2018-08-23 21:19:15 UTC
(In reply to Sergii Romantsov from comment #8)
> Hello, Darius.
> Could you, please, try to install package 'mesa-vulkan-drivers' and check if
> it changes launching error (related to vkCreateDevice)? At least with
> Wolfenstein2 in Steam client (with Proton).

Hello Sergii,

I don't have mesa-vulkan-drivers installed because I compile mesa from source.
Currently I have mesa 17.3.9, 18.0.5, 18.1.6 and 18.2.0-rc4 installed.

My mesa install is currently linked against 18.2.0-rc4...

darius@pc1:~$ glxinfo | grep string
server glx vendor string: SGI
server glx version string: 1.4
client glx vendor string: Mesa Project and SGI
client glx version string: 1.4
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) Iris Pro 6200 (Broadwell GT3e) 
OpenGL core profile version string: 4.5 (Core Profile) Mesa 18.2.0-rc4 (git-86aa912dda)
OpenGL core profile shading language version string: 4.50
OpenGL version string: 3.0 Mesa 18.2.0-rc4 (git-86aa912dda)
OpenGL shading language version string: 1.30
OpenGL ES profile version string: OpenGL ES 3.1 Mesa 18.2.0-rc4 (git-86aa912dda)
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10

darius@pc1:~$ vulkaninfo | grep api
	apiVersion     = 0x401050  (1.1.80)

My configure script is:
./configure \
    --prefix=/opt/mesa/64/`pwd | awk -F/ '{print $NF}'` \
    --enable-dri \
    --with-dri-drivers=i965 \
    --with-gallium-drivers= \
    --with-vulkan-drivers=intel \
    --enable-osmesa \
    --enable-glx-tls \
    --enable-shared-glapi \
    --enable-texture-float \
    --disable-xvmc \
    --disable-omx-bellagio \
    --enable-driglx-direct \
    --enable-gbm \
    --disable-gles1 \
    --enable-gles2 \
    --enable-dri3 \
    --with-platforms=x11,surfaceless,drm

configure result:
        prefix:          /opt/mesa/64/18.2
        exec_prefix:     ${prefix}
        libdir:          ${exec_prefix}/lib
        includedir:      ${prefix}/include

        OpenGL:          yes (ES1: no ES2: yes)

        OSMesa:          libOSMesa

        DRI platform:    drm
        DRI drivers:     i965 
        DRI driver dir:  ${libdir}/dri
        GLX:             DRI-based

        EGL:             yes
        EGL drivers:     builtin:egl_dri2 builtin:egl_dri3
        GBM:             yes
        EGL/Vulkan/VL platforms:   x11 surfaceless drm

        Vulkan drivers:  intel 
        Vulkan ICD dir:  ${datarootdir}/vulkan/icd.d

        llvm:            no

        Gallium:         no

        HUD extra stats: no
        HUD lmsensors:   no


        Shared libs:     yes
        Static libs:     no
        Shared-glapi:    yes

        CFLAGS:          -g -O2 -Wall -Werror=implicit-function-declaration -Werror=missing-prototypes -Wmissing-prototypes -Wno-missing-field-initializers -fno-math-errno -fno-trapping-math -std=c99
        CXXFLAGS:        -g -O2 -Wall -fno-math-errno -fno-trapping-math -Wno-missing-field-initializers
        CXX11_CXXFLAGS:  
        LDFLAGS:         
        Macros:          -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D_GNU_SOURCE -DUSE_SSE41 -DUSE_GCC_ATOMIC_BUILTINS -DNDEBUG -DUSE_X86_64_ASM -DHAVE_XLOCALE_H -DHAVE_SYS_SYSCTL_H -DHAVE_DLFCN_H -DHAVE_STRTOF -DHAVE_MKOSTEMP -DHAVE_TIMESPEC_GET -DHAVE_STRTOD_L -DHAVE_DL_ITERATE_PHDR -DHAVE_POSIX_MEMALIGN -DHAVE_ZLIB -DHAVE_LINUX_FUTEX_H -DHAVE_LIBDRM -DGLX_USE_DRM -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING -DGLX_USE_TLS -DHAVE_X11_PLATFORM -DHAVE_SURFACELESS_PLATFORM -DHAVE_DRM_PLATFORM -DHAVE_DRI3 -DHAVE_DRI3_MODIFIERS -DENABLE_SHADER_CACHE -DHAVE_MINCORE

        PYTHON2:         python2.7

        Run 'make' to build Mesa
Comment 11 Darius Spitznagel 2018-08-23 21:36:36 UTC
@Sergii

In january I have tested Wolfenstein2 only with the free demo and it doesn't start  like DOOM 2016 because of depthBoundsTest.
After applying ".depthBounds = true" in src/intel/vulkan/anv_device.c both games startet to work.

Will give this another try now. I think the demo was updated in the meantime. lets see.
Comment 12 Darius Spitznagel 2018-08-23 22:04:23 UTC
@Sergii
Good news - the current Wolfenstein2 (german) demo does work (start to game menu) with mesa 18.2.0-rc4 without ".depthBounds = true" in anv_device.c.
Will play it tomorrow (maybe later) to check against gpu-hangs I had with the demo in january.

@Jason
I'm currently downloading DOOM 2016 and will test again as I did yesterday... 45 minutes left at best.
Also downloaded your depthBounds patch series from Patchwork Mesa (ID 46825) in preparation.
Comment 13 Darius Spitznagel 2018-08-23 23:08:49 UTC
@Jason
DOOM 2016 running with "pure" mesa-18.2.0-rc4 does not work as expected.

Applying your patch series (ID 46825) to mesa 18.2.0-rc4 made it work (started to game menu), thank you Jason.
Also the patch series seem not to impact Wolfenstein2 (again started only to game menu).

It's late now... will try both of games tomorrow and report back.
Comment 14 Darius Spitznagel 2018-08-24 20:36:19 UTC
DOOM 2016:
GPU hang when hit by enemy (expected).

Wolfenstein2:
Intro plays well. It tells what happend in Wolfenstein: The New Order.
Gameplay starts where the first one ended and than everythings goes black.
You can still hear whats going on but see nothing.
Comment 15 Jason Ekstrand 2018-08-25 22:28:24 UTC
Got it!

https://patchwork.freedesktop.org/patch/245985/

I've read through that code more times than I can count and gone, "We really shouldn't have those holes in here" but I never figured they'd hurt anything. :-(  Feel free to reply with a tested-by or something. :-)
Comment 16 Jason Ekstrand 2018-08-25 23:48:20 UTC
Fixed by the following commit in master:

commit 76b0e4d8c9d3cd8af0b665cec88bded7a61e8ad6
Author: Jason Ekstrand <jason.ekstrand@intel.com>
Date:   Sat Aug 25 17:08:04 2018 -0500

    anv: Fill holes in the VF VUE to zero
    
    This fixes a GPU hang in DOOM 2016 running under wine.
    
    Cc: mesa-stable@lists.freedesktop.org
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104809
    Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Comment 17 Darius Spitznagel 2018-08-26 19:43:43 UTC
THANK YOU SO MUCH Jason.
DOOM 2016 works now like it should.

Sorry, I did not answer earlier.

I hope both patches - deptBoundsTest workaround for idTech AND the fix for DOOM 2016 can still land for 18.2.0 stable.

Thanks again, Darius


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.