felixdoerre / primus_vk

Vulkan GPU-offloading layer
BSD 2-Clause "Simplified" License
230 stars 18 forks source link

Installing Nvidia 430 (GLVND) from Debian 10 backports break PrimusVK #58

Closed Arucard1983 closed 4 years ago

Arucard1983 commented 4 years ago

Recently Debian 10 updates the Nvidia drivers to version 430 on Buster Backports repositories, and due to compatibility issues, the new drivers are GLVND compilant.

While Nvidia 418 drivers with PrimusVK 1.1 builds and runs fine without issues, the upgrade to 430 breaks primusVK. Using the Debian's pvkrun 1.3 script all OpenGL programs runs without issues on NVidia, but Vulkan programs will fail and display errors, which points to be a library issue.

The main error points to the following message: primusvk: error! nvidia driver could not be loaded from '/usr/lib/i386-linux-gnu/nvidia/current/libGL.so.1'. primusvk: error! nvidia driver could not be loaded from '/usr/lib/x86_64-linux-gnu/nvidia/current/libGL.so.1'.

And I confirmed that GLVND drivers removed this compatibility library, required to PrimusVK handles the switching.

There's a way to hotfix this issue, or waiting to Debian backports more libraries to upgrade ? I don't think that an forced upgrade to Debian 11 (which now contains a patched PrimusVK for the new GLVND drivers) would be a good idea.

felixdoerre commented 4 years ago

So essentially you need two things: The patched laucher (that you already have) https://salsa.debian.org/nvidia-team/primus-vk/blob/6b449d3321cb5d26a747d0928d65269cf6eadd99/debian/rules#L6 and the nvidia driver that is named differently (this is what you are missing): https://salsa.debian.org/nvidia-team/primus-vk/blob/6b449d3321cb5d26a747d0928d65269cf6eadd99/debian/pvkrun.nvidia#L5 So to solve your problem, you should set NV_DRIVER_PATH to libGLX_nvidia.so.0 (or the combination where we have compatibility with GLVND and non-GLVND drivers, that is set in the debian package)

Arucard1983 commented 4 years ago

The next issue are the ICD files, as demonstrated on this log:

info: Game: Artemis.exe info: DXVK: v1.5.3 info: Built-in extension providers: info: Win32 WSI info: OpenVR warn: OpenVR: Failed to locate module info: Enabled instance extensions: info: VK_KHR_surface info: VK_KHR_win32_surface Xlib: extension "NV-GLX" missing on display ":0.0". Xlib: extension "NV-GLX" missing on display ":0.0". Xlib: extension "NV-GLX" missing on display ":0.0". Xlib: extension "NV-GLX" missing on display ":0.0". PrimusVK: Getting devices PrimusVK: Searching for display GPU: PrimusVK: 0x7c3dfc50: PrimusVK: Got integrated gpu! PrimusVK: Device: Intel(R) HD Graphics 630 (Kaby Lake GT2) PrimusVK: Type: 1 PrimusVK: Searching for render GPU: PrimusVK: 0x7c3dfc50. PrimusVK: 0x7b84e6a0. PrimusVK: No device for the rendering GPU found. Is the correct driver installed? PrimusVK: VK_ICD_FILENAMES not set 0009:err:vulkan:wine_vkCreateInstance Failed to create instance, res=-3 err: DxvkInstance::createInstance: Failed to create Vulkan 1.1 instance

Arucard1983 commented 4 years ago

Never mind I found the solution. The launcher will need the following export:

export VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/nv_vulkan_wrapper.json:/usr/share/vulkan/icd.d/intel_icd.i686.json:/usr/share/vulkan/icd.d/intel_icd.x86_64.json

Once edited the pvkrun script and place the new export line with those three ICD files, every Vulkan and OpenGL program are now working!

Problem fixed!