Bug 109020

Summary: i915 [drm]: GPU hang in dxvk in wine-4.0-rc1
Product: Mesa Reporter: Nikolay Borodin <monsterovich>
Component: Drivers/DRI/i965Assignee: Intel 3D Bugs Mailing List <intel-3d-bugs>
Status: RESOLVED DUPLICATE QA Contact: Intel 3D Bugs Mailing List <intel-3d-bugs>
Severity: major    
Priority: highest    
Version: git   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: the output with drm.debug is the same
error file
error file V2
Darksiders 3 DXVK Kabylake Intel HD

Description Nikolay Borodin 2018-12-11 18:35:44 UTC
Created attachment 142779 [details]
the output with drm.debug is the same

See: https://github.com/doitsujin/dxvk/issues/794

Glxinfo: https://pastebin.com/PFTDYDeE

monsterovich@dell ~ $ uname -a
Linux dell 4.19.8-xanmod5 #1.181209 SMP PREEMPT Sun Dec 9 10:18:38 -02 2018 x86_64 x86_64 x86_64 GNU/Linux

dmesg -w with drm.debug=0xe in kernel command line:
https://pastebin.com/TVTSAmMf
Comment 1 Lionel Landwerlin 2018-12-11 20:24:58 UTC
Could you include a copy of the /sys/devices/pci0000:00/0000:00:02.0/drm/card0/error file? Thanks.

For later reference on this bug, the mesa version is : Mesa 19.0.0-devel - padoka PPA
Comment 2 Nikolay Borodin 2018-12-11 20:42:38 UTC
(In reply to Lionel Landwerlin from comment #1)
> Could you include a copy of the
> /sys/devices/pci0000:00/0000:00:02.0/drm/card0/error file? Thanks.
> 
> For later reference on this bug, the mesa version is : Mesa 19.0.0-devel -
> padoka PPA

How can I do that if my system freezes instantly and after reboot I just get: "No error state collected".
Comment 3 Nikolay Borodin 2018-12-11 20:53:33 UTC
(In reply to Lionel Landwerlin from comment #1)
> Could you include a copy of the
> /sys/devices/pci0000:00/0000:00:02.0/drm/card0/error file? Thanks.
> 
> For later reference on this bug, the mesa version is : Mesa 19.0.0-devel -
> padoka PPA

"tail -f" and output to file don't work
Comment 4 Lionel Landwerlin 2018-12-12 11:24:32 UTC
(In reply to Nikolay Borodin from comment #3)
> (In reply to Lionel Landwerlin from comment #1)
> > Could you include a copy of the
> > /sys/devices/pci0000:00/0000:00:02.0/drm/card0/error file? Thanks.
> > 
> > For later reference on this bug, the mesa version is : Mesa 19.0.0-devel -
> > padoka PPA
> 
> "tail -f" and output to file don't work

I assume the machine isn't available on the network anymore? You can't remotely copy the file?

Maybe try to run the following command as root, trying to copy the file every 1 second : 

while true; do sleep 1; lines=`wc -l /sys/devices/pci0000:00/0000:00:02.0/drm/card0/error | cut -d ' ' -f 1`; if [ $lines -gt 5 ]; then cp /sys/devices/pci0000:00/0000:00:02.0/drm/card0/error /home/; fi; done
Comment 5 Nikolay Borodin 2018-12-12 14:46:27 UTC
(In reply to Lionel Landwerlin from comment #4)
> (In reply to Nikolay Borodin from comment #3)
> > (In reply to Lionel Landwerlin from comment #1)
> > > Could you include a copy of the
> > > /sys/devices/pci0000:00/0000:00:02.0/drm/card0/error file? Thanks.
> > > 
> > > For later reference on this bug, the mesa version is : Mesa 19.0.0-devel -
> > > padoka PPA
> > 
> > "tail -f" and output to file don't work
> 
> I assume the machine isn't available on the network anymore? You can't
> remotely copy the file?
> 
> Maybe try to run the following command as root, trying to copy the file
> every 1 second : 
> 
> while true; do sleep 1; lines=`wc -l
> /sys/devices/pci0000:00/0000:00:02.0/drm/card0/error | cut -d ' ' -f 1`; if
> [ $lines -gt 5 ]; then cp
> /sys/devices/pci0000:00/0000:00:02.0/drm/card0/error /home/; fi; done

It doesn't make any sense because my system freezes before it will copy a file and it also fails to reset GPU.

Game Over.
Comment 6 Lionel Landwerlin 2018-12-12 14:55:25 UTC
My experience is the system doesn't immediately become unresponsive.
Proof is, the i915 driver is detecting the hang by using a timer after which no operation currently running has made any progress.

So there is a pretty good chance you'll be able to capture the file.
That loop might need an additional sync to ensure the file makes it to the disk.
Comment 7 Lionel Landwerlin 2018-12-12 17:20:10 UTC
(In reply to Lionel Landwerlin from comment #6)
> My experience is the system doesn't immediately become unresponsive.
> Proof is, the i915 driver is detecting the hang by using a timer after which
> no operation currently running has made any progress.
> 
> So there is a pretty good chance you'll be able to capture the file.
> That loop might need an additional sync to ensure the file makes it to the
> disk.

I forgot this but adding i915.reset=0 to the command line of the kernel might also help so that the i915 driver doesn't attempt to touch anything once the hang is detected.
Comment 8 Nikolay Borodin 2018-12-12 21:45:34 UTC
Created attachment 142796 [details]
error file
Comment 9 Nikolay Borodin 2018-12-12 21:45:54 UTC
(In reply to Lionel Landwerlin from comment #7)
> (In reply to Lionel Landwerlin from comment #6)
> > My experience is the system doesn't immediately become unresponsive.
> > Proof is, the i915 driver is detecting the hang by using a timer after which
> > no operation currently running has made any progress.
> > 
> > So there is a pretty good chance you'll be able to capture the file.
> > That loop might need an additional sync to ensure the file makes it to the
> > disk.
> 
> I forgot this but adding i915.reset=0 to the command line of the kernel
> might also help so that the i915 driver doesn't attempt to touch anything
> once the hang is detected.

That's better.

https://bugs.freedesktop.org/attachment.cgi?id=142796
Comment 10 Lionel Landwerlin 2018-12-15 15:17:35 UTC
I would like to see if I can reproduce to test a potential fix.
Unfortunately using Mesa 19.0.0-devel I'm running into a warning the prevents me from running the game : "DX11 feature level 10.0 is required to run the engine"

Can you share the setup you're using?
I assumed you were launching that game from Steam.
Comment 11 Nikolay Borodin 2018-12-15 19:54:31 UTC
(In reply to Lionel Landwerlin from comment #10)
> I would like to see if I can reproduce to test a potential fix.
> Unfortunately using Mesa 19.0.0-devel I'm running into a warning the
> prevents me from running the game : "DX11 feature level 10.0 is required to
> run the engine"
> 
> Can you share the setup you're using?
> I assumed you were launching that game from Steam.

- Can you provide me your glxinfo output?
- What version of dxvk do you use?
- Do you have vulkan libraries installed?
Comment 12 Lionel Landwerlin 2018-12-16 15:37:29 UTC
(In reply to Nikolay Borodin from comment #11)
> (In reply to Lionel Landwerlin from comment #10)
> > I would like to see if I can reproduce to test a potential fix.
> > Unfortunately using Mesa 19.0.0-devel I'm running into a warning the
> > prevents me from running the game : "DX11 feature level 10.0 is required to
> > run the engine"
> > 
> > Can you share the setup you're using?
> > I assumed you were launching that game from Steam.
> 
> - Can you provide me your glxinfo output?
> - What version of dxvk do you use?

I'm using Proton 3.16 which seems to be using dxvk : 20353f6f62f802bab9618b19940748af19cc1812 dxvk (v0.90-141-g20353f6)

I'm guessing that's the issue.


> - Do you have vulkan libraries installed?

Yes, latest loader & mesa master.
Comment 13 Nikolay Borodin 2018-12-17 19:41:14 UTC
(In reply to Lionel Landwerlin from comment #10)
> I would like to see if I can reproduce to test a potential fix.
> Unfortunately using Mesa 19.0.0-devel I'm running into a warning the
> prevents me from running the game : "DX11 feature level 10.0 is required to
> run the engine"
> 
> Can you share the setup you're using?
> I assumed you were launching that game from Steam.

Btw, can I test this potential fix too?
Comment 14 Lionel Landwerlin 2018-12-17 19:59:53 UTC
(In reply to Nikolay Borodin from comment #13)
> (In reply to Lionel Landwerlin from comment #10)
> > I would like to see if I can reproduce to test a potential fix.
> > Unfortunately using Mesa 19.0.0-devel I'm running into a warning the
> > prevents me from running the game : "DX11 feature level 10.0 is required to
> > run the engine"
> > 
> > Can you share the setup you're using?
> > I assumed you were launching that game from Steam.
> 
> Btw, can I test this potential fix too?

Sure, if you can just cherry pick that commit for Mesa : https://github.com/djdeath/mesa/commit/02da2df87f59ac784117727d986a40df173df0ae

Unfortunately I haven't managed to compile a newer version of proton (including the right version of wine & dxvk) that actually manages to start the game yet.
Comment 15 Nikolay Borodin 2018-12-17 20:43:20 UTC
Created attachment 142839 [details]
error file V2
Comment 16 Nikolay Borodin 2018-12-17 20:46:37 UTC
(In reply to Lionel Landwerlin from comment #14)
> (In reply to Nikolay Borodin from comment #13)
> > (In reply to Lionel Landwerlin from comment #10)
> > > I would like to see if I can reproduce to test a potential fix.
> > > Unfortunately using Mesa 19.0.0-devel I'm running into a warning the
> > > prevents me from running the game : "DX11 feature level 10.0 is required to
> > > run the engine"
> > > 
> > > Can you share the setup you're using?
> > > I assumed you were launching that game from Steam.
> > 
> > Btw, can I test this potential fix too?
> 
> Sure, if you can just cherry pick that commit for Mesa :
> https://github.com/djdeath/mesa/commit/
> 02da2df87f59ac784117727d986a40df173df0ae
> 
> Unfortunately I haven't managed to compile a newer version of proton
> (including the right version of wine & dxvk) that actually manages to start
> the game yet.

The crash is still present:

https://bugs.freedesktop.org/attachment.cgi?id=142839

I did these commands:

export LIBGL_DRIVERS_PATH=/home/monsterovich/Distfiles/compile/mesa/lib
export LD_LIBRARY_PATH=/home/monsterovich/Distfiles/compile/mesa/lib

glxinfo reported that valid driver is loaded.

OpenGL version string: 3.0 Mesa 19.0.0-devel (git-cdf5e03545)
Comment 17 Lionel Landwerlin 2018-12-19 17:48:07 UTC
(In reply to Nikolay Borodin from comment #16)
> (In reply to Lionel Landwerlin from comment #14)
> > (In reply to Nikolay Borodin from comment #13)
> > > (In reply to Lionel Landwerlin from comment #10)
> > > > I would like to see if I can reproduce to test a potential fix.
> > > > Unfortunately using Mesa 19.0.0-devel I'm running into a warning the
> > > > prevents me from running the game : "DX11 feature level 10.0 is required to
> > > > run the engine"
> > > > 
> > > > Can you share the setup you're using?
> > > > I assumed you were launching that game from Steam.
> > > 
> > > Btw, can I test this potential fix too?
> > 
> > Sure, if you can just cherry pick that commit for Mesa :
> > https://github.com/djdeath/mesa/commit/
> > 02da2df87f59ac784117727d986a40df173df0ae
> > 
> > Unfortunately I haven't managed to compile a newer version of proton
> > (including the right version of wine & dxvk) that actually manages to start
> > the game yet.
> 
> The crash is still present:
> 
> https://bugs.freedesktop.org/attachment.cgi?id=142839
> 
> I did these commands:
> 
> export LIBGL_DRIVERS_PATH=/home/monsterovich/Distfiles/compile/mesa/lib
> export LD_LIBRARY_PATH=/home/monsterovich/Distfiles/compile/mesa/lib
> 
> glxinfo reported that valid driver is loaded.
> 
> OpenGL version string: 3.0 Mesa 19.0.0-devel (git-cdf5e03545)

Thanks a lot for the update, that's really helpful.

Looking at the error state, I think there could be a disconnect between the shader and how the samplers/dataports are setup.
Are you sure you run the game with the validation layers?
I would expect some errors.
Comment 18 Nikolay Borodin 2018-12-22 11:11:26 UTC
(In reply to Lionel Landwerlin from comment #17)
> (In reply to Nikolay Borodin from comment #16)
> > (In reply to Lionel Landwerlin from comment #14)
> > > (In reply to Nikolay Borodin from comment #13)
> > > > (In reply to Lionel Landwerlin from comment #10)
> > > > > I would like to see if I can reproduce to test a potential fix.
> > > > > Unfortunately using Mesa 19.0.0-devel I'm running into a warning the
> > > > > prevents me from running the game : "DX11 feature level 10.0 is required to
> > > > > run the engine"
> > > > > 
> > > > > Can you share the setup you're using?
> > > > > I assumed you were launching that game from Steam.
> > > > 
> > > > Btw, can I test this potential fix too?
> > > 
> > > Sure, if you can just cherry pick that commit for Mesa :
> > > https://github.com/djdeath/mesa/commit/
> > > 02da2df87f59ac784117727d986a40df173df0ae
> > > 
> > > Unfortunately I haven't managed to compile a newer version of proton
> > > (including the right version of wine & dxvk) that actually manages to start
> > > the game yet.
> > 
> > The crash is still present:
> > 
> > https://bugs.freedesktop.org/attachment.cgi?id=142839
> > 
> > I did these commands:
> > 
> > export LIBGL_DRIVERS_PATH=/home/monsterovich/Distfiles/compile/mesa/lib
> > export LD_LIBRARY_PATH=/home/monsterovich/Distfiles/compile/mesa/lib
> > 
> > glxinfo reported that valid driver is loaded.
> > 
> > OpenGL version string: 3.0 Mesa 19.0.0-devel (git-cdf5e03545)
> 
> Thanks a lot for the update, that's really helpful.
> 
> Looking at the error state, I think there could be a disconnect between the
> shader and how the samplers/dataports are setup.
> Are you sure you run the game with the validation layers?
> I would expect some errors.

Are you talking about this?:

export VK_INSTANCE_LAYERS=VK_LAYER_LUNARG_standard_validation
Comment 19 Lionel Landwerlin 2018-12-22 16:05:21 UTC
(In reply to Nikolay Borodin from comment #18)
> (In reply to Lionel Landwerlin from comment #17)
> > (In reply to Nikolay Borodin from comment #16)
> > > (In reply to Lionel Landwerlin from comment #14)
> > > > (In reply to Nikolay Borodin from comment #13)
> > > > > (In reply to Lionel Landwerlin from comment #10)
> > > > > > I would like to see if I can reproduce to test a potential fix.
> > > > > > Unfortunately using Mesa 19.0.0-devel I'm running into a warning the
> > > > > > prevents me from running the game : "DX11 feature level 10.0 is required to
> > > > > > run the engine"
> > > > > > 
> > > > > > Can you share the setup you're using?
> > > > > > I assumed you were launching that game from Steam.
> > > > > 
> > > > > Btw, can I test this potential fix too?
> > > > 
> > > > Sure, if you can just cherry pick that commit for Mesa :
> > > > https://github.com/djdeath/mesa/commit/
> > > > 02da2df87f59ac784117727d986a40df173df0ae
> > > > 
> > > > Unfortunately I haven't managed to compile a newer version of proton
> > > > (including the right version of wine & dxvk) that actually manages to start
> > > > the game yet.
> > > 
> > > The crash is still present:
> > > 
> > > https://bugs.freedesktop.org/attachment.cgi?id=142839
> > > 
> > > I did these commands:
> > > 
> > > export LIBGL_DRIVERS_PATH=/home/monsterovich/Distfiles/compile/mesa/lib
> > > export LD_LIBRARY_PATH=/home/monsterovich/Distfiles/compile/mesa/lib
> > > 
> > > glxinfo reported that valid driver is loaded.
> > > 
> > > OpenGL version string: 3.0 Mesa 19.0.0-devel (git-cdf5e03545)
> > 
> > Thanks a lot for the update, that's really helpful.
> > 
> > Looking at the error state, I think there could be a disconnect between the
> > shader and how the samplers/dataports are setup.
> > Are you sure you run the game with the validation layers?
> > I would expect some errors.
> 
> Are you talking about this?:
> 
> export VK_INSTANCE_LAYERS=VK_LAYER_LUNARG_standard_validation

Yes. I just saw that Proton got upgrade with DXVk 0.94 so will give another try directly on Steam.
Comment 20 Nikolay Borodin 2018-12-22 16:11:15 UTC
> > Are you talking about this?:
> > 
> > export VK_INSTANCE_LAYERS=VK_LAYER_LUNARG_standard_validation
> 
> Yes. I just saw that Proton got upgrade with DXVk 0.94 so will give another
> try directly on Steam.

I always had it enabled.
Comment 21 Nikolay Borodin 2019-01-08 16:43:57 UTC
It is clear what is the cause of the bug? Can I help with anything else?
Comment 22 Jonathan Farrugia 2019-07-20 17:32:33 UTC
I encountered this GPU hang today and I think it's related to the way the Intel HD driver allocates VRAM for Vulkan in Linux. I tested the game Darksiders 3 with DXVK 1.3 (as of writing).

I have 2 systems both running a freshly installed Xubuntu 19.04.

1st System: Desktop with i3-7100 CPU and 8GB RAM (DDR4 2400MHZ) - The game freezes soon after Launch with no possibility to switch to any tty's and close it. A hard reset was required.

2nd System: Laptop with i3-5005U and 16GB RAM (DDR3 1600MHZ) - The game runs and plays without issues. See Screenshot: https://i.imgur.com/R3DLG9N.jpg


With these results I believe that the Intel HD allocates 1GB V-RAM on a system with 8GB Ram whereas with 16GB it allocates 2GB V-RAM.

Further inspection of this I ran the game on my main gaming system with a GTX1060 6GB, the game was already hitting 1GB V-RAM.

Unfortunately I lack the skills to go deeper in this.
Comment 23 Jonathan Farrugia 2019-07-20 23:56:45 UTC
(In reply to Jonathan Farrugia from comment #22)
> With these results I believe that the Intel HD allocates 1GB V-RAM on a
> system with 8GB Ram whereas with 16GB it allocates 2GB V-RAM.

Please disregard this part from my previous comment, I was wrong.


I found out something else though from my 2nd test tonight - After some gameplay on my 16GB laptop, DXVK allocated 3.9GB just for V-RAM, (pictured here: https://i.imgur.com/JzCY74f.jpg). According to intel's ark spec sheet, the GPU can allocate as much as 16GB for V-RAM.

Secondly I checked the specs on my desktop motherboard where the i3-7100 is installed (Link: https://www.asrock.com/mb/Intel/H110M-STX/index.asp) and at the "Graphics" part you can see it clearly states 'Max. shared memory 1024MB'. 

For comparison purposes I checked other motherboard specs and most of them list equal, lower and higher values and in some cases it's not listed (presumably as much as there is system ram).

I will run further tests tomorrow and also try to find an explanation of why the game doesn't crash with WineD3D.
Comment 24 Jonathan Farrugia 2019-07-21 14:10:25 UTC
Today I removed one of the two 8GB sticks on my laptop to rule out the ram disparity between the 2 test systems. The game ran fine.


On the desktop side I ran more games which would allocate a fair amount of V-RAM, one of test cases here was Guild Wars 2 which ran fine and this pretty much rules out it's not a memory issue as I was initially keen to believe. Screenshot: https://i.imgur.com/qSVVZ7Y.jpg  


I think the issue here is specific to Gen9 graphics.

Any suggestions how I can proceed and provide additional information?
Comment 25 Denis 2019-09-12 09:11:11 UTC
hello guys.
I found out that current issue with the game is the same to
https://bugs.freedesktop.org/show_bug.cgi?id=110228

and the fix was landed into kernel here https://bugs.freedesktop.org/show_bug.cgi?id=110998

I tested it and confirmed that Darksides 3 apitrace stopped hang the system after that patch. So I would say that current issue also can be closed.
Comment 26 Jonathan Farrugia 2019-09-12 20:11:04 UTC
I can happily confirm that the patch referred by Denis (https://bugs.freedesktop.org/show_bug.cgi?id=110998) fixes the issue with Darksiders 3 (UE4 game) on Kabylake GPU.

I think this bug may safely be considered fixed. Marking it as a duplicate to ticket 110998.

*** This bug has been marked as a duplicate of bug 110998 ***
Comment 27 Jonathan Farrugia 2019-09-12 20:13:15 UTC
Created attachment 145338 [details]
Darksiders 3 DXVK Kabylake Intel HD

Screenshot of the game running with DXVK on Kabylake i3-7100 using Intel HD GPU.

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.