ValveSoftware / Dota-2

Tracker for issues specific to Linux and Mac in the Reborn client. If you have a general issue or non-system-specific feature request please go to dev.dota2.com
472 stars 38 forks source link

NVidia 535.x VK_ERROR_INITIALIZATION_FAILED on Debian #2787

Open davidsl118 opened 3 months ago

davidsl118 commented 3 months ago

Dota failing to launch after the most recent update (Major update with compendium)

DotaVulkanIssue

kisak-valve commented 3 months ago

Hello @davidsl118, please copy the contents of Steam Runtime Diagnostics from Steam (Steam -> Help -> Steam Runtime Diagnostics) and put it in a gist, then include a link to the gist in this issue report.

davidsl118 commented 3 months ago

Diagnostic gist

kagmole commented 3 months ago

Same issue here on Debian Unstable. It looks like it's trying to start on the integrated graphics and not the discrete graphic card.

TormenTeDx commented 3 months ago

Same here... Debian (bookworm), can't start the game since the ringmaster update...

pavel-garmatyuk commented 3 months ago

Similar problem, after updates there is no initialization of Vulcan, then it crashes with an error 2024-08-23_16-18

TormenTeDx commented 2 months ago

any workaround for this?

kagmole commented 2 months ago

I tried some solutions like DRI_PRIME=1 %command% or using Proton but no chance. Looks like it's not working right now with Proton as well : https://www.protondb.com/app/570#EtQd9pA3uB

TormenTeDx commented 2 months ago

I tried with proton too, I have the same problem. It opens for like 5-10 seconds and then closes

TTimo commented 2 months ago

There was a problem earlier this week which could cause a system crash running out of descriptors shortly after startup. This has been fixed now, and OP's report is a different issue.

If you are not crashing on startup with a Failed to initialize Vulkan error, please consider opening a separate issue.

@davidsl118 can you go through the following steps to help diagnosing this:

kagmole commented 2 months ago

I ain't davids118 but here goes my own logs:

08/31 09:33:20 [RenderSystem] Loaded video settings config from 'cfg/video.txt'
08/31 09:33:20 [RenderSystem] vkCreateDevice failed with error VK_ERROR_INITIALIZATION_FAILED, unable to create Vulkan device.
TormenTeDx commented 2 months ago

Same here [logs]$ cat dota2.log 08/31 12:14:08 [RenderSystem] Loaded video settings config from 'cfg/video.txt' 08/31 12:14:08 [RenderSystem] vkCreateDevice failed with error VK_ERROR_INITIALIZATION_FAILED, unable to create Vulkan device.

kagmole commented 2 months ago

Tried to remove the file cfg/video.txt and launch (bad config maybe?) but it still doesn't work.

TTimo commented 2 months ago

Thanks but I would prefer to look at the entire set of logs, not just the error line.

TormenTeDx commented 2 months ago

Here I zipped all logs. steam-logs.tar.gz

TormenTeDx commented 2 months ago

@kagmole You should just run tar -zcvf ~/Desktop/steam-logs.tar.gz ~/.steam/steam/logs to grab all the logs

kagmole commented 2 months ago

And here's mine. Removed all files from logs then did a Steam launch and Dota 2 launch. steam-logs.tar.gz

kagmole commented 2 months ago

Tried to disable the iGPU (dGPU only) in the UEFI settings but no chance. :)

davidsl118 commented 2 months ago

@TTimo Here are the compressed logs. steam-logs.tar.gz

TTimo commented 2 months ago

Thanks @davidsl118, I appreciate your patience. The logs didn't reveal anything unfortunately.

It looks like you are on an Optimus laptop, so let's try a few things:

On my Optimus system this reports Selected GPU 0: NVIDIA GeForce RTX 4060 Laptop GPU, type: DiscreteGpu indicating it picked the eGPU over the iGPU.

If you don't specify the __NV_PRIME_RENDER_OFFLOAD=1 I expect it'll report your software vulkan backend instead (llvmpipe).

timo@eta-carinae ~/.s/s/s/c/dota 2 beta> cd ~/.steam/steam/steamapps/common/dota\ 2\ beta/game/
timo@eta-carinae ~/.s/s/s/c/d/game> __NV_PRIME_RENDER_OFFLOAD=1 ~/.local/share/Steam/steamapps/common/SteamLinuxRuntime_sniper/run-in-sniper -- ./dota.sh

You can find more information about Optimus at https://wiki.debian.org/NVIDIA%20Optimus

kagmole commented 2 months ago

The Steam Linux runtime folder may be here for Debian, if you used the Steam installer from the Debian repository:

~/.steam/debian-installation/steamapps/common/SteamLinuxRuntime_sniper/run-in-sniper
TormenTeDx commented 2 months ago

image

I ran these __NV_PRIME_RENDER_OFFLOAD=1 ~/.local/share/Steam/steamapps/common/SteamLinuxRuntime_sniper/run-in-sniper -- vkcube and with or without the argument I still get in both cases the same gpu nvidia rtx3080. and running dota through sniper gives the same vulkan error as it does via steam.

image

Sadly it didn't help for me

kagmole commented 2 months ago

Same as @TormenTeDx, except graphic card is:

Selected GPU 1: NVIDIA GeForce RTX 4070 Laptop GPU, type: DiscreteGpu
davidsl118 commented 2 months ago

Hi @TTimo. I get the vkcube rendered with or without the argument, and in both cases the same discrete GPU is selected. Since this was not what you expected, I did not test the next step.

TTimo commented 2 months ago

Ok .. so next thing to try, enabling verbose in the Vulkan loader:

VK_LOADER_DEBUG=all __NV_PRIME_RENDER_OFFLOAD=1 ~/.local/share/Steam/steamapps/common/SteamLinuxRuntime_sniper/run-in-sniper -- ./dota.sh 2>&1 | tee ~/verbose-loader.txt

That will save out a log to ~/verbose-loader.txt which you can attach and we'll see if it reveals anything.

TormenTeDx commented 2 months ago

Here you go: verbose-loader.txt

TTimo commented 2 months ago

I'll have to pour over the logs some more tomorrow, but can you also try setting NODEVICE_SELECT=1 and capturing another? Just in case an issue in the llvmpipe layer is collapsing the whole init for some reason.

TormenTeDx commented 2 months ago

You mean like this? NODEVICE_SELECT=1 VK_LOADER_DEBUG=all /home/ryszard/.steam/debian-installation/steamapps/common/SteamLinuxRuntime_sniper/run-in-sniper -- ./dota.sh 2>&1 | tee ~/verbose-loader-nodevice-select.txt Here, still getting vulkan error: verbose-loader-nodevice-select.txt

TTimo commented 2 months ago

Ok that makes the whole loading business cleaner, and at least removes that possibility of a problem.

At this point we're starting to suspect the combo of 535 drivers and recent NVidia hardware (3080 and up). We may be requesting extensions in the recent Dota2 update that the drivers are unhappy about. It'll take a few days but we'll add some options to test that out.

Corollary is that you should try with newer drivers, 550 or ideally 560 but it seems Debian is lagging behind, we've asked for those to be added in experimental.

TormenTeDx commented 2 months ago

cool, thanks. 535 are the newest one right now on stable debian afaik.

kagmole commented 2 months ago

Same for Debian Unstable. Version 535.183.06-1. But a friend on Ubuntu doesn't have the problem with an older version, 535.183.01. https://github.com/ValveSoftware/Dota-2/issues/2807#issuecomment-2323480228

smcv commented 2 months ago

a friend on Ubuntu doesn't have the problem with an older version, 535.183.01

535.183.01 happens to still be available in the Debian 12 repositories (versioned 535.183.01-1~deb12u1), so you could try downgrading to that and see whether it helps?

TormenTeDx commented 2 months ago

I have 535.183.01, so it won't help. image

kagmole commented 2 months ago

I tried to downgrade but the DKMS build fails with Linux kernel 6.10.9-amd64.

smcv commented 2 months ago

I have 535.183.01, so it won't help

If that's the case, then there must be some other factor in why you see this but @kagmole's friend does not. Everyone here seems to have mentioned dual-GPU (Nvidia + other), so perhaps that's part of it.

TormenTeDx commented 2 months ago

I have single gpu, 3080 rtx, its probably because of debian. I've heard it works on ubuntu fine

kagmole commented 2 months ago

I tried to disable the iGPU to only have one dGPU but no luck on this as well.

smcv commented 2 months ago

Do you have libnvidia-rtcore installed? If not, try installing that, at the same version as your Vulkan drivers?

As packaged in Debian, it's a Recommends (weak dependency, installed by default but possible to turn off), but there are indications that it should perhaps be a required dependency.

smcv commented 2 months ago

Or, more generally, if any of the dependencies of nvidia-driver-full are missing, try installing them, again with their version matching the parts of the driver that you already have installed.

kagmole commented 2 months ago

libnvidia-rtcore was indeed missing, no idea why. I installed it and now it works! Thanks a lot. :) I will reinstall all recommended packages as well, just to be sure. I didn't disable the installation of recommended packages though.

smcv commented 2 months ago

I didn't disable the installation of recommended packages though

Hmm, something must have gone wrong during installation or upgrade of your drivers: normally Recommends are selected for installation automatically, unless either (a) you explicitly turned them off (in which case you're accepting the risk that some things will not work), or (b) they were temporarily impossible to install for some reason.

kagmole commented 2 months ago

Must be option (b) since I'm on Unstable. I do admit I neglect to check on packages starting with lib.

TormenTeDx commented 2 months ago

I can't believe it, I installed libnvidia-rtcore and it works too. I think it wasn't installed since beggining and it just wasn't required for dota before... cause it basically stopped working after the ringmaster update

smcv commented 2 months ago

I think it wasn't installed since beggining and it just wasn't required for dota before

Perhaps it's actually only required for games that use particular Vulkan features, and Dota started using those features recently?

TTimo commented 2 months ago

Perhaps it's actually only required for games that use particular Vulkan features, and Dota started using those features recently?

Yep we do try to enable some raytracing extensions since recently.

davidsl118 commented 2 months ago

After installing libnvidia-rtcore the game launches fine. Many thanks!

smcv commented 2 months ago

Reported as https://bugs.debian.org/1081314