Dxvk: Games Using the Wrong GPU

Created on 6 Aug 2018  路  9Comments  路  Source: doitsujin/dxvk

Hello,

I am using Wine Staging 3.13 with dxvk 0.64. I am experiencing regular crashes about 5 minutes into the game, and am trying to debug that issue.

In doing so, however, i have discovered another, really strange issue.

My system has 2x Radeon RX580 GPUs. One is installed in the first PCI Express Slot (x16), and the second in a secondary x4 slot. The first has 8 GB of ram, and the second 4 GB.

The system is set to boot with the 8GB GPU first, and my primary monitor is connected to that GPU. An additional monitor is connected to the 4GB GPU.

When I play Linux games, they correctly use the GPU connected to the relevant monitor. If I start 7DTD on the monitor connected to the 8GB GPU, I see the temperature, fan speed, and power usage of that GPU increase.

However, when starting games with Wine/DXVK, it appears that the second gpu, with 4GB of ram, is the only one that gets used. I've tried disabling the first monitor, and it makes no difference.

Although the games play reasonably well (better than I expected, frankly), the temperature, fan speed, and power usage of the second gpu is the only one that experiences an increase.

I checked the DXVK logs in the game directory, and oddly enough, you can see that the 4GB GPU is enumerated first. I'm not sure why. It appears lower down on the PCI bus (.. 06:00, as opposed to 01:00). I don't know that this is causing the crashing issue, but it is certainly weird and unexpected behavior. I'm actually very surprised that it works with the such a high level of performance, at least until it crashes (60 FPS in Fallout4 on medium).

Software information

Name of the game, settings used etc.

System information

  • GPU: 2x Radeon RX580, 8GB and 4GB
  • Driver: RADV 18.2.99/LLVM 7.0.0-git
  • Wine version: 3.13-staging
  • DXVK version: 0.64

Apitrace file(s)

  • Put a link here

Log files

wontfix

Most helpful comment

FYI I will add a device filter to DXVK since it has been requested a number of times, but as it will only take the device name into account (or maybe the PCI IDs as well), it won't help in this scenario.

All 9 comments

Use environment variables to specify the ICD

If I'm not mistaken, that environment variable can set the correct driver, but you can't then specify which card is used if multiple require the same driver.

This is not a bug. The driver lists your 4GB card first, and DXVK forwards all your Vulkan-capable GPUs to the game. Most games just pick the first GPU they can find.

There's no way for me to guess which one might be the "right" one, i.e the one you actually want to use.

Small note, while it _is_ possible to implement some heuristics to list the "preferrable" GPU first - in fact, DXVK already kind of does this by always enumerating dedicated GPUs before integrated ones - things start getting messy when your GPUs are more or less identical. The amount of memory should not be the first or only criterion when sorting GPUs (think of those low-end OEM graphics cards that come with more VRAM than some mid-range gaming cards).

Ok, thank you. This sounds like a driver/complicated issue.

The surprising part to me is that I have not seen this behavior in other games/apps, but now I think about it this is probably the only Vulkan application I use, so it must be a particular issue with Vulkan. OpenGL stuff appears to use the "correct" GPU.

I'm assuming that this is impacting performance somewhat, as the framebuffer needs to be copied between GPUs for display.

Rather than implementing heuristics, would it be possible to use an environment variable (or registry key?) to specify the correct GPU? I've done some background reading, and some of the similar issues online refer to programs with launchers (I'm looking at this post) that allow some flexibility in choosing the GPU.

In an ideal world, I guess there would be some way to re-order Vulkan's enumeration of GPUs.

Since there is no reliable way to select the correct GPU on setups such as yours, I'll mark this as #wontfix.

I've had the same issue with native Linux ported games using Vulkan. I discussed it with Feral and RADV devs and eventually we came to the conclusion that it is a Vulkan problem and took it up with Khronos who acknowledged the issue and are looking for a solution, perhaps through a future Vulkan extension.

https://github.com/KhronosGroup/Vulkan-Ecosystem/issues/30

FYI I will add a device filter to DXVK since it has been requested a number of times, but as it will only take the device name into account (or maybe the PCI IDs as well), it won't help in this scenario.

Hi dotsujin!

So the DXVK_FILTER_DEVICE_NAME="Device Name" option understand the pci id too?
I have this problem with at least two games for now, (Two RX VEGA64 one of them is watercooled(thats my primary GPU), the other one is an AIR version, without screen attached to it, and yet, the game rendered on this secondary gpu then the frame passed to the primary GPU, what sends the picture to the screen,. Not counting its incrasing the input lag, but at the same time using the lesser cooled card now, what is crazy loud too..)

PS: Im an idiot, its still no go, since the two card have the same PCI ID too....

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yusdacra picture yusdacra  路  4Comments

SzDavidHUN picture SzDavidHUN  路  3Comments

AuroransSolis picture AuroransSolis  路  3Comments

t14462 picture t14462  路  4Comments

arabcian picture arabcian  路  3Comments