HansKristian-Work / vkd3d-proton

Fork of VKD3D. Development branches for Proton's Direct3D 12 implementation.
GNU Lesser General Public License v2.1
1.89k stars 198 forks source link

Intel GPU support -- it's good! #1516

Open hwertz opened 1 year ago

hwertz commented 1 year ago

Just wanted to report, since the main page indicates no testing on Intel GPUs -- I have one and the results are good! I have an Acer with (as Linux reports it) "11th Gen Intel(R) Core(TM) i3-1115G4 @ 3.00GHz" (this is a dual core with hyperthreading that actually clocks up to like 4.2ghz...) This has 11th/12th-gen style Intel Xe graphics. I upgraded it "a tad", I have 20GB RAM, 1TB SSD, and 1TB HDD crammed into this thing. I am running Ubuntu 22.04 with "kisak-mesa" ppa so I'm running Mesa 23.0.2 at the moment.

Not much to comment on -- everything works! Between dxvk and vkd3d (...and Proton for games in steam), everything that runs on my home system's GTX1650 has run on the Xe, usually on high settings. I have had no artifacts, and no unusual behaviors to report. In contrast to the god-awful OpenGL support (let alone Vulkan) in the Intel drivers in years past, the Intel GPU drivers now are very good, and support Vulkan 1.3 going back about 8 model years (whether those old GPUs are fast enough to run any DX12 games, that's another matter....but they won't refuse due to missing features.)

Cyberpunk 2077 even "walks" on it -- it got about 12-18FPS in the benchmark on low and "ultra performance" FSR. Not much to do about it! -- if you let the CPU cores rip, it clocks the GPU down from like 1250 to 900mhz... if you fiddle with the CPU settings to get it to the most-power-efficient 1.5-1.6ghz, the GPU gets close to full speed and it actually gains 1-2FPS but it's even more CPU-limited. Luckily the benchmark is close to "worst case scenario" and the rest of the game runs a little better.

I did just try "The Last of Us Part I", and found the card reports as supporting Feature Level 11.1 so it pops a message saying it needs FL 12.0; if I force 12.0, it crashes while the "dog tag" is spinning, i.e. before main menu (not surprising, the game wouldn't say it required FL12.0 if it wasn't using it, but I figured it was worth a shot). The Intel Vulkan driver must be missing some extension that is wanted for FL12.0 I suppose? No matter, given how the opening & menu run on the desktop I suspect it'd do about 5FPS on the notebook anyway.

Blisto91 commented 1 year ago

Some of the issues with Intel ANV is that it's missed some extension(s?) for proper feature parity with the other drivers. E.g. see https://gitlab.freedesktop.org/mesa/mesa/-/issues/5003

But that it works with alot of games in your experience is ofc nice 🙂

Blisto91 commented 1 year ago

https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23045 Just for info. Sparse support was just merged in anv. (Needs the upcoming Xe kernel driver not the current i915 one. At least as of writing)

hwertz commented 1 year ago

Nice! Although I've been using Kisak Mesa I've built a daily mesa build now and then, I actually already have the build deps installed. And I've built my own kernel now and then so I can definitely build one with Xe driver patched in (if it's out of tree) or enabled or whatever. I've got one or two DX12 games to try out with it. I'll definitely be able to provide feedback and testing!

hwertz commented 1 year ago

For those who wish to test this out (on Xe and Ubuntu) --

If you build a daily Mesa, you can in fact safely use "sudo ninja install" to go ahead and install it. I made a link to "/home/user/src/llvm15/llvm-config" pointing to /usr/bin/llvm-config-15 (otherwise mesa complains that LLVM15 isn't installed even though it is, llvm-config on mine is pointing to LLVM 14.) Then ran the build instructions they give, making an empty build directory and changing into it, running "PATH=/home/user/src/llvm15:$PATH meson -Dplatforms=x11 -Dintel-xe-kmd=enabled .." then "sudo ninja install". It installs under /usr/local/, and "sudo ninja uninstall" does cleanly uninstall it. The stock Mesa stuff is in /usr and it does work to have both installed side-by-side. You get errors about "MESA: error: unknown kernel mode driver" from the system also trying to load your existing Mesa drivers; but since none of these try to handle interfacing with the Xe kernel driver, the correct newer driver loads and takes over handling the card.

Kernel-wise, I found if you grab the drm-xe kernel, you can copy your existing ubuntu config over (from /boot/config-xxxxx) into the kernel source tree as ".config", run "make olddefconfig", run "make menuconfig" and turn on in device drivers->Graphics->Intel Xe Graphics as a module. Go to Cryptographic API -> Certificates for Singature Checking and remove the two debian/ubuntu*.pem entries (Additional X.509 keys and X.509 keys to be preloaded into system blacklist.) Replace them with an empty string. This is not related to Xe, but the Ubuntu build tree has these two files while the stock kernel doesn't, related to signed kernels and such. Then "make -j4 deb-pkg LOCALVERSION=-custom" and after a large amount of compiling and other faffing about, you have .deb packages to install just like your existing kernel (and more importantly, to remove if you change your mind.) You must add "i915.force_probe=!9a78 xe.force_probe=9a78" to your kernel boot line (I stuck it in /etc/default/grub), of course 9a78 is for the specific TGL2 model I have, see what lspci shows for your VGA and drop that number in instead. (It's the last 4 digits of the PCI ID, since Intel devices always have 8086 as the first four.)

What I can say in initial testing, so far the one game I had quit running after a recent update (CP2077) still didn't run; I tried a few other games and they came up fine. I haven't tried the couple games I have that require DX12 FL12.x to see if they run yet, but can at least say that running the Xe driver hasn't lead to immediately apparent regressions compared to i915, it seems fine to go ahead and try out!

(I actually use tilde for /home/user above but tilde is used to start and stop text crossouts here.)

Blisto91 commented 11 months ago

Sparse support merged for gen12+ on the i915 driver https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25512

hwertz commented 9 months ago

Just switched PPA over to one that is installing daily Mesa build, so running a Mesa 24.0 daily build (with the existing i915 driver on my Tiger Lake notebook) and can verify at least that "Deep Rock Galactic" now comes up in DX12 mode (it didn't before.). I got 7FPS higher with DX11, but from what I've read that's just the nature of this game (DX11 faster on some DX12-capable hardware and DX12 faster on other.) I'm running the Ubuntu 6.5.0-series kernel, haven't tried booting back up into a kernel with Xe driver to see how that runs. But anyway can verify this support does work with vkd3d!

stereomato commented 4 months ago

@hwertz is there any game where you get better fps in dx12 with an intel igpu? I have a laptop with a i5-12500h, and I get like 10 fps less on palworld, and similar or more with DRG.

hwertz commented 4 months ago

@hwertz is there any game where you get better fps in dx12 with an intel igpu? I have a laptop with a i5-12500h, and I get like 10 fps less on palworld, and similar or more with DRG.

Well I tried CP2077 on there and it was pretty grim -- 1.60 would run even on the earlier drivers (like it was using DX12, but not actually using the memory binding part of it maybe?) while 1.62 oddly patches in the CP2077 2.0 graphics engine with it's stricter graphics requirements. (You'd think you'd either not mess with it or at least call it 1.7 rather than doing that in a .01 patch am I right?).

CP2077 2.0 gets very poor FPS on there (this is when you hit "benchmark" and it goes through the bar), I think it was down to like 8-12FPS (versus about 20-24FPS with 1.60.) I have a i3-1115G4 though, which (I didn't realize this earlier) actually has the "half-size" 48CU GPU (as well as being a 2C4T, and 35W TDP, so I can't even say if the GPU is maxing out first, CPU is maxing out, or (I think more likely) both are pegged + it's probably hitting TDP and cutting the clock on both. Just for laughs I decided to see if TLOUI would start on it; since it's a shared VRAM setup the game immediately grabbed 16GB VRAM (successfully) (it "only" has 20GB RAM in it :roll_eyes:) so with 4GB system RAM left to try to load TLOUI into it kind of just thrashed to death until I rebooted it.

I haven't done any further experimentation. Last I checked DRG still got better FPS in DX11 mode. ) I fired up like... I forget, it was a car racing game that used DX12. It oddly got extremely poor FPS, like it was probably getting 2-4FPS in the menu, showing this car gleaming and glinting in the background. I decided to start the game anyway and figured it'd also be a slideshow; surprisingly the game ran fine! However I didn't find the F1 racing suited me, I enjoy some WRC style more.

I kind of expect quite a few DX12-requiring games will simply be too heavy for my minimal-spec GPU, but I'd still like to check at some point if there's any big difference between Xe and i915. When I checked before I found a small improvement (like 1-2FPS) in DRG in DX12 mode (out of 7FPS lower). But the specific Mesa or Xe driver or something had bugs causing some other games to fail, so I switched back. I should try it again at some point here. I do have cvs copy of "linux-stable" set to build with Xe driver enabled (I think it's at 6.9.0 at the moment?"), I should give it a go again at some point (I don't think I'd need a daily build mesa any more, just the reasonably recent one from kisak PPA.)

stereomato commented 4 months ago

I'll be very honest, I think that vkd3d on intel gpus is just weirdly wonky because it shouldn't have bad performance. I'll see if I can get CP2077 to test, and then report

stereomato commented 4 months ago

Hitman 2016 is awful with dx12/vkd3d. 50% performance of the dx11 mode, constant stuttering, graphics glitching