libretro / flycast

Flycast is a multiplatform Sega Dreamcast emulator. NOTE: No longer actively developed, use upstream repo for libretro from now on - https://github.com/flyinghead/flycast
http://reicast.com
GNU General Public License v2.0
152 stars 77 forks source link

Vulkan secondary GPU support is broken in new Flycast (CRTswitchres, chugging) #1147

Closed riggles1 closed 2 years ago

riggles1 commented 2 years ago

With CRTEmudriver one of the common setup with RA is to have dual GPU's, with the main GTX/RTX handling the Vulkan side of things. CRT being set to primary display and with working Switchres, worked flawlessly with my 1070 handling the graphics processing with Vulkan while the game was outputting through my HD5450 CRTEmudriver, as of the new Flycast update this is now broken.

The issue is that with the recent flycast update the game fails to run on the 1070, reverting to the HD5450, resulting in stuttery gameplay below 60fps. (it seems that it works at first, but then a minute or two in it fails and the game starts consistently running at 50fps and below suddenly).

After a lot of testing I had to revert back to Flycast v1.2-56-g0bb6fed, only after doing that would games play at a flawless 60fps and beyond if you were to fast forward.

No weird .opt files causing issues, same games, 64bit RA 1.10.3, Vulkan driver, and the CRT (HD5450) was primary display in Win10 in both cases which it should be for CRTSwitchres.

Hopefully this can be resolved since having CRTSwitchres and outputting to a separate display while your modern GPU handles the game graphics is one of the beauties of playing Flycast in RA, and gives you a lot more GPU power than what CRTEmudriver compatible old GPU's can do.

Thanks!

flyinghead commented 2 years ago

The core cannot choose which device it renders to. RA passes a single physical device handle to the core. So I'm not sure where to look. Also nothing has change since v1.2-56-g0bb6fed regarding vulkan context initialization.

It could be useful to gather some logs: one with v1.2-56-g0bb6fed and one with the latest version to compare.

flyinghead commented 2 years ago

Actually it's possible that RA doesn't choose a GPU, in which case the choice is done by the core. The algorithm is to choose the first discrete GPU (as opposed to integrated) if there is one, or the first GPU if not. This algorithm hasn't changed since before v1.2-56.

riggles1 commented 2 years ago

Gonna give this a couple of more tests and upload some logs as well, thanks for the reply! Yeah idk why this even works, when I first got into this I was expecting not to be able to do anything vulkan, but for some reason you can use vulkan with switchres and everything (5450 CRT set as primary display) and all the overhead from the modern GPU, no stutters or anything. Why it stops working with the newer flycast I have no clue. 5450 can't handly flycast on its own, especially not with all that overhead.

I know this is such a specific weird issue for a small number of people, but we're a few emudriver users that have this kind of modern+weak dual gpu setup, regularly help people with CRTEmudriver stuff as I have guides for this, and recommend 5450's for this purpose, easy to find cheap+fanless models.

Thanks again! Will try see what else I can find out about the quirks and at least get some logs.

riggles1 commented 2 years ago

Woah, okay weird, so I deleted the core manually, then downloaded with the core downloader to get the new flycast 1.3 again, and now it's working flawlessly, been playing with zero issues with enough overhead to fast forward to 400fps.

Here's my log playing Toy Fighters on the new v1.3 (also tried VF4, works brilliantly as well).

Yesterday when I was trying I was switching between the two core files when testing, seems like there's something faulty with the core I downloaded yesterday or something. So anyone facing a similar issue, just delete the core, and redownload with the core downloader again.

log, says it picks Vulkan and the 1070 despite being outputted to the 5450, so all is working well :D https://pastebin.com/VkrXG3TV