libcg / grvk

Vulkan-based Mantle API implementation
https://en.wikipedia.org/wiki/Mantle_(API)
zlib License
221 stars 14 forks source link

installed mesa 22.0 but receive error in grvk log #46

Closed goffy59 closed 2 years ago

goffy59 commented 2 years ago

I previously opened an issue and did as you suggested. I installed mesa 22.0.

Tried running this via steam/protonGE and origin/lutris. (both did not work)

What am I missing here?

=== GRVK 0.5.0 === I/000003B4/grInitAndEnumerateGpus: app "Battlefield" (01000000), engine "Frostbite" (00C00000), api 00018000 I/000003B4/quirkInit: enabled 0x4 W/000003B4/grInitAndEnumerateGpus: unhandled alloc callbacks W/000003B4/getGrPhysicalGpuType: unsupported type 4 W/000003B4/getGrPhysicalGpuType: unsupported type 4 I/000003B4/grCreateDevice: 1002:731F "AMD RADV NAVI10" (Vulkan 1.3.204, driver 22.0.99) I/000003B4/grCreateDevice: DMA queue remapped to compute queue 1 I/000003B4/grCreateDevice: 10005:0000 "llvmpipe (LLVM 13.0.1, 256 bits)" (Vulkan 1.2.204, driver 0.0.1) I/000003B4/grCreateDevice: compute queue remapped to universal queue 0 I/000003B4/grCreateDevice: DMA queue remapped to universal queue 0 E/000003B4/grCreateDevice: vkCreateDevice failed (-7) E/000003B4/grCreateDevice: missing extension. make sure your Vulkan driver supports: E/000003B4/grCreateDevice: - VK_EXT_custom_border_color E/000003B4/grCreateDevice: - VK_EXT_extended_dynamic_state E/000003B4/grCreateDevice: - VK_EXT_shader_demote_to_helper_invocation E/000003B4/grCreateDevice: - VK_KHR_dynamic_rendering E/000003B4/grCreateDevice: - VK_KHR_swapchain

I am not sure how to enable VK_KHR_dynamic_rendering other than ensuring I have the most up to date vulkan driver.

I see that LLVM shows 1.2 but my actual AMD driver shows vulkan 1.3 and when I checked "glxinfo | grep Mesa" It printed this: client glx vendor string: Mesa Project and SGI OpenGL core profile version string: 4.6 (Core Profile) Mesa 22.1.0-devel (git-8335fdf 2022-02-08 impish-oibaf-ppa) OpenGL version string: 4.6 (Compatibility Profile) Mesa 22.1.0-devel (git-8335fdf 2022-02-08 impish-oibaf-ppa) OpenGL ES profile version string: OpenGL ES 3.2 Mesa 22.1.0-devel (git-8335fdf 2022-02-08 impish-oibaf-ppa)

Looking for any suggestions or help you can provide. I'd really love to test this out.

libcg commented 2 years ago

That's interesting, Battlefield is trying to create two devices, one with RADV and the other with lavapipe (llvmpipe in the logs). The latter doesn't support the required extensions. One quick fix would be to disable lavapipe on your side, but I suppose GRVK could be a little smarter about this and not expose certain devices.

goffy59 commented 2 years ago

Well that kind of makes me feel better. I made some progress on this after-all.

I came across this. I will let you know if it works. I am going to try and remove the package as suggested or rename the file. https://forum.garudalinux.org/t/most-vulkan-applications-broken-due-to-llvmpipe/8599

My OS is POPOS 21.10

update edit*

It worked, I just renamed lvp_icd.x86_64.json to lvp_icd.x86_64.json.bu

Thanks again sir!

=== GRVK 0.5.0 === I/000008B0/grInitAndEnumerateGpus: app "Battlefield" (01000000), engine "Frostbite" (00C00000), api 00018000 I/000008B0/quirkInit: enabled 0x4 W/000008B0/grInitAndEnumerateGpus: unhandled alloc callbacks I/000008B0/grCreateDevice: 1002:731F "AMD RADV NAVI10" (Vulkan 1.3.204, driver 22.0.99) I/000008B0/grCreateDevice: DMA queue remapped to compute queue 1 W/000008B0/grWsiWinGetDisplayModeList: semi-stub W/000008B0/grWsiWinGetDisplayModeList: semi-stub W/000008B0/grWsiWinSetMaxQueuedFrames: semi-stub W/000008D8/ilcCompileKernel: unhandled hull/domain shader type W/000008CC/ilcCompileKernel: unhandled hull/domain shader type W/000008D8/ilcCompileKernel: unhandled hull/domain shader type W/000008CC/grCreateQueueSemaphore: unhandled shareable semaphore flag W/000008CC/grCreateQueueSemaphore: unhandled shareable semaphore flag W/000008CC/grCreateQueueSemaphore: unhandled shareable semaphore flag W/000008CC/ilcCompileKernel: unhandled hull/domain shader type W/000008D0/ilcCompileKernel: unhandled hull/domain shader type W/000008CC/ilcCompileKernel: unhandled hull/domain shader type W/000008D0/ilcCompileKernel: unhandled hull/domain shader type W/000008CC/grCreateQueueSemaphore: unhandled shareable semaphore flag W/000008CC/grCreateQueueSemaphore: unhandled shareable semaphore flag W/000008CC/grCreateQueueSemaphore: unhandled shareable semaphore flag W/000008CC/grCreateQueueSemaphore: unhandled shareable semaphore flag W/000008CC/grCreateQueueSemaphore: unhandled shareable semaphore flag W/000008CC/grCreateQueueSemaphore: unhandled shareable semaphore flag W/000008B0/grCreateDepthStencilView: unhandled flags 0x1 W/000008B0/grCreateImageView: non-identity swizzle 3.4.5.2 for storage image 122 W/000008B0/grCreateDepthStencilView: unhandled flags 0x1 W/000008B0/grCreateImageView: non-identity swizzle 3.4.5.2 for storage image 122 W/000008B0/grCreateDepthStencilView: unhandled flags 0x1

goffy59 commented 2 years ago

I am a noob when it comes to developing or anything like that. But for those that have made it this far and got the right ppa there is another issue that comes up. Basically when the ppa updates it adds the file back in which undermines the little fix mentioned above: "renaming lvp_icd.x86_64.json to lvp_icd.x86_64.json.bu" and causes GRVK to see the lavapipe device. So I made a little simple thing I run each time Mesa 22.0 ppa updates:

#!/bin/bash
if [ -e "/usr/share/vulkan/icd.d/lvp_icd.x86_64.json" ]
then
    mv -f "/usr/share/vulkan/icd.d/lvp_icd.x86_64.json" "/usr/share/vulkan/icd.d/lvp_icd.x86_64.json.bu"
    echo "patching"
else
    echo "patched"
fi

I am unaware of this breaking anything and basically anytime the ppa updates it adds the file back anyway. If there is a more effective way to disable this device from being created let me know. Or if GRVK could differentiate better as mentioned above by the developer would also work. In either case I have been using GRVK to play BF4 since I first opened this issue and I have noticed better performance in my situation with mantle and will continue to use it. I play on 4k auto settings which sets it at medium basically. I am running Steam/Proton-ge 7.1 to play BF4 on POPOS 21.10

**Adding this in case someone like me struggled with getting the right ppa for mesa 22.0:

I added the PPA:

sudo add-apt-repository ppa:oibaf/graphics-drivers

Then I modified /etc/apt/preferences.d/pop-default-settings:

Package: *
Pin: release o=pop-os-release
Pin-Priority: 1001
Package: *
Pin: release o=LP-PPA-oibaf/graphics-drivers
Pin-Priority: 1002

I then ran "sudo apt update -y" and "sudo apt upgrade -y" and checked "glxinfo | grep Mesa" to confirm if Mesa 22.0 was present.

libcg commented 2 years ago

I have noticed better performance in my situation with mantle and will continue to use it.

That's great. What kind of hardware do you have, and what's the perf impact, roughly?

goffy59 commented 2 years ago

Previously when I would run it in DirectX instead of mantle, every now and again (intermittent) it would stutter or micro freeze for less than a second. There are other reports of this on proton/lutris pages for bf4 on linux and I have tried some of these fixes which is what lead me to use proton-ge 6-7 versions (tried many of them because i continue to update it when a new version comes out). While proton-ge has solved most of my problems, every now and again this slight micro stutter would occur). It wasn't that much of a problem but previously when I was on windows 10 on my old system I would use mantle which was faster for me. I got the idea of trying to get mantle to work on bf4 on my current system to see if it would fix this small issue I had or have any benefit. I was surprised that mantle was gone from the options to I went to google and found your github. I'd be willing to test or try things out for you or help in anyway I can such as providing data or etc.

I hope I am not fooling myself into thinking that I am getting gains that aren't actually there or related to using this API. So just as a warning, I could be misjudging what the actual issue is. But bottom line when I am playing with 63 other players on larger maps the game doesn't bother me with any micro stutter/etc. So I am continuing to use this API instead of DXVK (directx)

Extra info on different graphics settings: I get a decrease in performance at ultra settings when using MANTLE versus DXVK. When running DXVK on auto (medium) I still get the micro stutter described above(but still around 150++ fps). So for whatever reason MANTLE seems to run better on auto settings for me. It does have lower FPS(90 ish) but the micro stutter is gone so that makes me happy. Maybe I am just getting old and my eyesight sucks but I dont see any benefit of having a really HIGH FPS.. I just want it to be smooth and not stutter. So 90fps (around) is perfect for me and my 4K resolution... it sure beats having a micro stutter. I would probably need to record this data to give you concrete/accurate result. If you would like that I could provide it just might take me a bit to get the results back to you. Lots of this is kind of just going off of memory.

I run in 4K resolution 3840 × 2160 (radeon 5700xt red dragon)

Software: PopOS 21.10 Steam/Proton-GE7.1) Battlefield 4

Hardware:

hwinfo --short
cpu:                                                            
                       Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz, 3700 MHz
                       Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz, 3700 MHz
                       Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz, 3700 MHz
                       Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz, 3700 MHz
                       Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz, 3700 MHz
                       Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz, 3700 MHz
                       Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz, 3700 MHz
                       Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz, 3700 MHz
                       Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz, 3700 MHz
                       Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz, 3700 MHz
                       Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz, 4395 MHz
                       Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz, 3700 MHz
keyboard:
  /dev/input/event13   Compx 2.4G Wireless Receiver
  /dev/input/event14   Feitian FIDO KB
  /dev/input/event5    Winbond Electronics Drevo keyboard
mouse:
  /dev/input/mice      Winbond Electronics Drevo keyboard
  /dev/input/mice      Compx 2.4G Wireless Receiver
monitor:
                       43S425
                       HP E241i
graphics card:
                       ATI Navi 10 [Radeon RX 5600 OEM/5600 XT / 5700/5700 XT]
sound:
                       ATI Navi 10 HDMI Audio
                       Intel 200 Series PCH HD Audio
                       SteelSeries ApS SteelSeries Arctis 1 Wireless
storage:
                       Intel 200 Series PCH SATA controller [AHCI mode]
                       Sandisk Non-Volatile memory controller
network:
  enp6s0               Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
  wlp5s0               Intel Wi-Fi 6 AX200
network interface:
  lo                   Loopback network interface
  enp6s0               Ethernet network interface
  wlp5s0               Ethernet network interface
disk:
  /dev/nvme0n1         Sandisk Disk
  /dev/sdb             Micron_5100_MTFD
  /dev/sdc             XF1230-1A1920
  /dev/sda             JAJS600M2TB
partition:
  /dev/nvme0n1p1       Partition
  /dev/nvme0n1p2       Partition
  /dev/nvme0n1p3       Partition
  /dev/nvme0n1p4       Partition
  /dev/sdb1            Partition
  /dev/sdc1            Partition
  /dev/sda1            Partition
usb controller:
                       Intel 200 Series/Z370 Chipset Family USB 3.0 xHCI Controller
bios:
                       BIOS
bridge:
                       Intel 200 Series PCH PCI Express Root Port #5
                       Intel 200 Series PCH PCI Express Root Port #12
                       Intel ISA bridge
                       ATI Navi 10 XL Downstream Port of PCI Express Switch
                       Intel Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x16)
                       ATI Navi 10 XL Upstream Port of PCI Express Switch
                       ASUSTeK PRIME H310M-D
                       Intel 200 Series PCH PCI Express Root Port #11
hub:
                       Genesys Logic USB3.1 Hub
                       Genesys Logic 4-port hub
                       Genesys Logic 4-port hub
                       Genesys Logic USB3.1 Hub
                       Linux Foundation 2.0 root hub
                       Genesys Logic 4-port hub
                       Linux Foundation 3.0 root hub
memory:
                       Main Memory 64GB DDR4 2666 (2x 32gb)
bluetooth:
                       Intel Bluetooth Device
unknown:
                       FPU
                       DMA controller
                       PIC
                       Keyboard controller
                       Intel 200 Series/Z370 Chipset Family Power Management Controller
                       Intel 200 Series PCH CSME HECI #1
                       Intel 200 Series/Z370 Chipset Family SMBus Controller
                       American Power Conversion Uninterruptible Power Supply
                       Feitian FIDO KB
  /dev/input/event3    SteelSeries ApS SteelSeries Arctis 1 Wireless
libcg commented 2 years ago

That makes sense. I recommend using the latest dev build from here to get the best performance, if you're not already doing that.

goffy59 commented 2 years ago

I grabbed it, I will let you know if I see any improvements. Thank you.

libcg commented 2 years ago

This last build should help CPU-bound scenarios.

goffy59 commented 2 years ago

I've tried to newer builds and see an improvement. I am wondering if you will fix GRVK to pick the correct device so I don't have to keep renaming the file as described up above. Thanks in advance!