VOGONS


QEMU MESA GL/Glide pass-through on Apple M1 macOS

Topic actions

  • This topic is locked. You cannot reply or edit posts.

First post, by kjliew

User metadata
Rank Oldbie
Rank
Oldbie

Glide pass-through now works!
It was exactly as I anticipated through XQuartz/OpenGL. SDL2 recompiled with X11 support in addition to Cocoa and OpenGlide X11 for Glide wrapping and use `export SDL_VIDEODRIVER=x11` to launch QEMU.
Tomb Raider 1 is locked 30 FPS for Apple M1 😁

Screen Shot 2021-05-15 at 4.44.54 PM.png
Filename
Screen Shot 2021-05-15 at 4.44.54 PM.png
File size
672.67 KiB
Views
729 views
File comment
TR1 Lost Valley
File license
Fair use/fair dealing exception
Last edited by kjliew on 2021-05-16, 19:15. Edited 2 times in total.

Reply 1 of 24, by kjliew

User metadata
Rank Oldbie
Rank
Oldbie

MESA GL pass-through now works!
However, I am experiencing several usability issues on running games in QEMU Windows VM on Apple M1 macOS. I am noob on macOS, the keys mapping on Macbook keyboard isn't quite matched up with my expectation. I can't get "Ctrl-Alt-{key}" to work for QEMU. SDL2 mouse grabbing currently has issues on Windows, mouse cursor disappeared and preventing any mouse point-and-click on Windows VM desktop.

As expected, XQuartz/OpenGL is capped at OpenGL 2.1. It is probably still OK for OpenGL games around 2002-ish, but I am not sure how well WineD3D could work with just OpenGL 2.1 and some APPLE extensions. Anyway, the biggest bottleneck is the CPU performance. Without hardware virtualization support, QEMU TCG is limited. My earlier performance estimation seemed correct, at most the OpenGL games that could sustain 30 FPS is up to Quake3 level.

Screen Shot 2021-05-15 at 5.57.04 PM.jpg
Filename
Screen Shot 2021-05-15 at 5.57.04 PM.jpg
File size
812.48 KiB
Views
717 views
File comment
QEMU TCG Quake3
File license
Fair use/fair dealing exception

Just ignore the FPS painted by the game screen, it was just that moment of frame time. Timedemo benchmark was ~37 FPS at 1024x768 32bpp.

Overall Apple M1 native code performance is inline with the best x86 CPU.

Reply 2 of 24, by kjliew

User metadata
Rank Oldbie
Rank
Oldbie

Carmageddon 1 3Dfx max view distance and details, 45-50 FPS all-time.
Apple M1 Macbook Air on battery powered.

Screen Shot 2021-05-15 at 11.55.28 PM.png
Filename
Screen Shot 2021-05-15 at 11.55.28 PM.png
File size
531.45 KiB
Views
698 views
File comment
Carmageddon 1 3Dfx on Apple M1
File license
Fair use/fair dealing exception

Reply 3 of 24, by kjliew

User metadata
Rank Oldbie
Rank
Oldbie

MDK2 OpenGL Win98 VM on Apple M1 Macbook Air
QEMU 6.0.0 TCG

Screen Shot 2021-05-16 at 11.33.18 PM.png
Filename
Screen Shot 2021-05-16 at 11.33.18 PM.png
File size
979.43 KiB
Views
662 views
File comment
MDK2 QEMU on M1
File license
Fair use/fair dealing exception

Without hardware virtualization, the in-game frame rate will fluctuate depend on current in-view distance. The average FPS from the game benchmark is ~47 FPS. Still very much playable. Not other ARM SBC/platform has been able to achieve such level of performance for running Windows games in emulation.

Reply 4 of 24, by kjliew

User metadata
Rank Oldbie
Rank
Oldbie

Half-Life 1 OpenGL Win98 VM on Apple M1 Macbook Air
QEMU 6.0.0 TCG

Screen Shot 2021-05-17 at 2.14.13 AM.jpg
Filename
Screen Shot 2021-05-17 at 2.14.13 AM.jpg
File size
356.24 KiB
Views
645 views
File comment
Half-Life 1 QEMU on M1
File license
Fair use/fair dealing exception

The game setting selected resolution 1024x768, but this is not the actual pixels rendered by the GPU due to macOS seamless desktop scaling. The number of pixels the GPU is actually pushing is quite amazing for such fan-less form-factor. XQuartz/OpenGL 2.1 is good enough for Half-Life 1.

Reply 5 of 24, by kjliew

User metadata
Rank Oldbie
Rank
Oldbie

PC Player Direct3D Benchmark V2.10 - Win98 VM with WineD3D on M1.
WineD3D works, but startup is kind of slow. Performance may not be as great due to WineD3D CPU overhead.

Screen Shot 2021-05-18 at 2.47.05 AM.png
Filename
Screen Shot 2021-05-18 at 2.47.05 AM.png
File size
147.57 KiB
Views
586 views
File comment
PCPBench QEMU M1
File license
Fair use/fair dealing exception

Reply 6 of 24, by kjliew

User metadata
Rank Oldbie
Rank
Oldbie

3DMark99 MAX Win98 VM on QEMU M1.
QEMU 6.0.0 TCG
WineD3D startup/shutdown is very slow with TCG for 3DMark99. It took more than a minute every time it had to go through them. Once it started rendering, things were more tolerable. I usually don't bother with CPU 3DMarks if there was WHPX/KVM alike, but for TCG it makes sense to include it. The x86 emulation CPU 3DMarks is in the ballpark of Pentium II 350MHz. That was unheard of for prior AArch64/ARMv8 platforms.

I guess this is sufficient to handle lite Direct3D games with 640x480 rendering albeit with slow startup/shutdown.

Screen Shot 2021-05-18 at 3.58.18 PM.png
Filename
Screen Shot 2021-05-18 at 3.58.18 PM.png
File size
197.16 KiB
Views
563 views
File comment
3DMark99 QEMU M1
File license
Fair use/fair dealing exception

Reply 7 of 24, by kjliew

User metadata
Rank Oldbie
Rank
Oldbie

3DMark 2000 Win98 VM on QEMU M1
QEMU 6.0.0 TCG
I had to admit that the score was truly jaw dropping and mind blowing. Mere TCG performing at the level of desktop-class dGPU, on a fanless thin & light platform. It also trashed the score from Core M-6Y30 and Ryzen 2500U APU with QEMU KVM. The M1 GPU seems to enjoy enormous dGPU-like memory bandwidth from PDDR/on-package unified memory, a simple synthetic OpenGL pixel buffer object transfer test proved that. The pixel transfer rate is 10X that of Intel and AMD iGPU.

Screen Shot 2021-05-22 at 12.06.40 AM.png
Filename
Screen Shot 2021-05-22 at 12.06.40 AM.png
File size
166.81 KiB
Views
515 views
File comment
3Dmark2000 on QEMU M1
File license
Fair use/fair dealing exception

This is almost 3X of PCem v17 3DMark 2000 score with Voodoo3 on contemporary Core i5/i7 desktop class CPU overclocked at 4GHz+ (...ouch...🤣). 3DMark 2000 demo at 1024x768 on M1 is smoother and zero audio crackling vs PCem running the same demo at 640x480 on Ryzen 3700X with "whatever" GPU since PCem does not know how to use one. Even though QEMU on M1 would be an equal with PCem on x86 due to lack of hardware virtualization, the 3dfx recompiler software renderer is simply out of steam regardless of how many threads it can utilized. Simply said, if any Win98 games run great with PCem on x86 desktop class CPU overclocked at 4GHz+, the M1 will run them equally well if not better with native QEMU AArch64 in the comfort of MacBook Air form-factor.

Would new PCem on M1 be any better comparing with itself on x86 ... 🤣

Reply 8 of 24, by kjliew

User metadata
Rank Oldbie
Rank
Oldbie

Land of Lore Guardian of Destiny Win95 1.30 Direct3D
QEMU 6.0.0 TCG
I almost forgot that this game has a Direct3D renderer on the Win95 version after patch 1.30 and it indeed perfectly addressed the shortcomings of OpenGlide for all its rendering flaws. The M1 runs the game sweetly, movies plays great, sound effects and BGM are all perfect.

Screen Shot 2021-05-31 at 10.35.35 PM.png
Filename
Screen Shot 2021-05-31 at 10.35.35 PM.png
File size
158.44 KiB
Views
404 views
File license
Fair use/fair dealing exception
Screen Shot 2021-05-31 at 10.37.59 PM.jpg
Filename
Screen Shot 2021-05-31 at 10.37.59 PM.jpg
File size
862.62 KiB
Views
404 views
File license
Fair use/fair dealing exception

I bet QEMU is the **ONLY** emulation solution that can run this game perfectly on M1. Well, even commercial competition won't match what QEMU can offer. Perhaps they can try virtualize Windows 10 ARM and use its x86 binary translation to see if the game can even be played on Windows 10 ARM ... 🤣.

Unfortunately, because WineD3D is required, the complexity of enjoying the game at no-cost is high. More reason to support qemu-3dfx and be a donor. I may consider increasing the donation value for macOS support to recoup my expense on Macbook Air M1 .... 🤣.

Reply 9 of 24, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

ugh, without x11 I'd even try it 😀
I was wondering how Xquartz got natively on your M1, but then saw that xquartz.org finally released a new version 😀

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 11 of 24, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Yeah, but the emulated 3dfx does not look that good yet (or at least last time I tried), with many blacked out areas.
But come to think of it, I guess that was openglide, not the 3dfx emu

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 12 of 24, by Bruninho

User metadata
Rank Oldbie
Rank
Oldbie

I'm bloody amazed at this progress. I knew the M1 would be heaven for emulation. These results are exactly what I was expecting for the current iteration of M1 - and soon @ WWDC next week we might see the next generation of M1 with 32GB RAM and more cores unlocked. New benchmarks will be required for these new batch of M1 Macs...

@Dominus: Yeah, I agree it is OpenGlide to blame for, but still, @almeath's efforts to bring OpenGlide for macOS were a very good first step in that direction. It works as expected for DOSBox-X, though there is still only one issue for me - sound. Some games using Glide passthrough (with OpenGlide) for macOS build of DOSBox-X struggle and crash due to sound not being able to keep up with the game speed. Once I start without a sound card, the games were buttery smooth. OpenGlide can improve, though, with more work.

"Design isn't just what it looks like and feels like. Design is how it works."
JOBS, Steve.

List of ALL Android vulnerabilities

Reply 13 of 24, by kjliew

User metadata
Rank Oldbie
Rank
Oldbie

It was both depends on how one runs DOS 3Dfx games with DOSBox but both OpenGlide and Voodoo chip emulation did not render the games correctly. OpenGlide tends to have issues with fog, chromakey and transparency effects, but it is all we got for anything non-Windows for Glide wrapping. Outside of the issues with Glide wrappers, QEMU TCG/KVM/WHPX overall architecture is more optimized with full protected-mode OS than 32-bit DOS extenders that still depend on DOS 16-bit services and real-mode mouse/CD-ROM drivers. DOSBox is impervious to that, hence DOSBox is the best for DOS games.

If Zeckensack's GlideWrapper had open-sourced the codes (which he once promised but never materialized), then both DOSBox and QEMU would enjoy a much better cross-platform Glide wrappers. QEMU is still able to use Zeckensack's GlideWrapper for Windows Glide games. QEMU MESA GL pass-through was specifically designed and validated with Zeck's and Sven's Glide wrappers to enhance cross-platform Glide compatibility from the void of dgVoodoo2 and nGlide outside of Windows.

Reply 14 of 24, by Bruninho

User metadata
Rank Oldbie
Rank
Oldbie
kjliew wrote on 2021-06-01, 20:27:

OpenGlide tends to have issues with fog, chromakey and transparency effects, but it is all we got for anything non-Windows for Glide wrapping.

Yeah, I see that. When I am attempting to play FIFA 9x (98 RTWC and 99) on DOSBox-X with high level voodoo emulation (glide passthrough) this happens. Particularly when I am in a match with fog, all I see is transparent squares from certain angles, when they were supposed to be... well... "the fog", hehehe.

Without 3Dfx, FIFA doesn't even render the fog.

"Design isn't just what it looks like and feels like. Design is how it works."
JOBS, Steve.

List of ALL Android vulnerabilities

Reply 15 of 24, by kjliew

User metadata
Rank Oldbie
Rank
Oldbie

If Apple HVF worked for Win98/ME/2K/XP VM on macOS, then Intel Mac with QEMU HVF would have beaten the M1 hands-down for retro DOS/Windows games on VM. Well, maybe not in 3DMark 2000, that benchmark really loves the M1 GPU but in actual games CPU virtualization will make a huge difference. However, for TCG the Intel Mac will be lagging behind the M1 considerably.

Bruninho wrote on 2021-06-01, 21:00:

Yeah, I see that. When I am attempting to play FIFA 9x (98 RTWC and 99) on DOSBox-X with high level voodoo emulation (glide passthrough) this happens. Particularly when I am in a match with fog, all I see is transparent squares from certain angles, when they were supposed to be... well... "the fog", hehehe.

If you had QEMU Glide passthrough with OpenGlide, then it would be the same, but QEMU has additional option for using 3rd-party Glide pass-through with Zeckensack's GlideWrapper for Windows Glide games. Both games also have additional Direct3D renderer ... 😉

Reply 16 of 24, by kjliew

User metadata
Rank Oldbie
Rank
Oldbie

I am sorry if you find these teasing ... 😉

I tried both FIFA98RTWC and FIFA99 demos with OpenGlide and I couldn't seem to find any rendering flaws. They looked great and are absolutely playable on M1 with perfect audio on QEMU TCG on M1. It would probably be the same on your Intel Mac. Intel GPU does not have good track records, but shouldn't be that bad. FIFA98RTCW seems to be similar to NFS2SEA with an internal 3Dfx Glide renderer while FIFA99 seems to use the same 3rash renderer drivers as NFS3/NFS4 supporting both Glide and Direct3D. OpenGlide has been stellar in NFS2SEA/NFS3/NFS4 with fog, smog and projected head-lights special effects on those games. But you know those FIFA games better than I do. Perhaps the demos do not feature a match with with weather effects such as fog.

Screen Shot 2021-06-01 at 6.37.28 PM.jpg
Filename
Screen Shot 2021-06-01 at 6.37.28 PM.jpg
File size
834.67 KiB
Views
277 views
File license
Fair use/fair dealing exception
Screen Shot 2021-06-01 at 6.00.33 PM.jpg
Filename
Screen Shot 2021-06-01 at 6.00.33 PM.jpg
File size
1.01 MiB
Views
277 views
File license
Fair use/fair dealing exception

Perhaps something wasn't right on how DOSBox-X made things work. Those EA games have always been having troubles with DOSBox but DOSBox didn't really support Win9x as well. Again, I have nothing to gain by telling you this ... 🤣 When OpenGlide works great, it is as simple as compiling on macOS. And with all the recent updates I made for Macbook Air M1, I think compiling for macOS had been simpler compared to last time we argued.

Reply 17 of 24, by Bruninho

User metadata
Rank Oldbie
Rank
Oldbie

I saw your post before, but I chose to wait until I was in a better position to give a proper comment (on my Mac instead of my phone). First, I want to congratulate you for achieving the results I was expecting for the M1 with regards to emulation of these games. These benchmarks & games running are exactly what I was expecting for, the Mx Mac generations to come have much more room for improvement so there is more performance to come for your QEMU MESA GL/Glide Passthrough. I am glad that you could finally see what I was talking about before, the last time we argued about it.

It’s also good news for @almeath (if you are using his OpenGlide implementation for macOS, of course), because he felt a bit unmotivated to continue due to the issues we saw with DOSBox-X, but seeing that its not a problem with OpenGlide but yes with the way OpenGlide and DOSBox “talk with eachother”, he will be happy to hear the news.

I do not own a M1 Mac yet, because I chose to wait at least one or two years, when the transition is expected to be nearly finished. I plan to get one when I complete my move to Spain after I am fully vaccinated (I’ve just taken the 1st Astrazeneca/Oxford vaccine), so in some time between 2022 and 2023, when the AS Macs will be in a much better shape than they are right now (already a beast, though). Newer Apple devices are outrageously expensive here in Brazil, and in Spain I have a little bit more chances to upgrade my devices. I am still using a 2017 iPhone and iPad Pro, and a fully upgraded Late 2013 retina MBP 13-inch which is still working in a great shape for me so far, and for my remote work as an UI/UX Designer.

I need to explain one thing. My plan was always to be ready to a future move to the AS Macs, using any kind of emulation that would give me what I need to play games from my childhood days like Grand Prix 3/4, FIFA 9x, NFS II SE, NBA 97/98, Counter Strike 1.5/1.6, just to name a few that I have installed here to test on my Windows 98SE VM for both QEMU and DOSBox-X. Your implementation is the closest thing to my goal. Right now, I can play them all on VMware Fusion for Intel Mac, using Windows XP and VMware SVGA3D. But yours is the right tool for my next future Mac.

Hence why I am following the UTM app development and testing the app on both iOS and macOS, although it is just a frontend for QEMU without 3d acceleration, the performance is very good for a vanilla QEMU implementation. My 2017 iPad Pro (A10 CPU) can emulate a Win 98SE with Pentium III to play games like FIFA 9x and Grand Prix 2 or 3 without 3d acceleration. My 2013 Intel Mac performs a little better by a little margin of difference.

Think about this for a bit. Current scenario for emulation/virtualization on M1 Macs is... VMware is developing a version that will only run ARM Linux (Because Microsoft did not have licensed ARM Win 10 yet), while Parallels has an insider program running not only ARM Linux, but also Windows 10 ARM from the Microsoft Insider Program as well. In this scenario, VMware is lagging behind Parallels, who are currently leading the “race for Windows ARM virtualization on M1 Macs”, and I realized that QEMU, with the right frontend for easier usage as a complete app, is a much better choice and has more chance of being the clear winner against VMware and Parallels. God, QEMU on M1 has just beaten native Microsoft Surface performance running the ARM Windows 10 version, thanks to the hypervisor framework. When you see this, and what UTM has been doing lately, you can’t just ignore the fact that if UTM had patches like yours and Akihiko Odaki’s implementation of Virgl 3D acceleration for Linux Guests on M1, then this is the perfect scenario here for QEMU to win that emulation/virtualization battle against the big players in gaming. I think that you should consider talking to the UTM developer to find a way to work together to bring your patch to UTM for users who are looking for a gaming emulation solution. He’s selling UTM on App Store and this is going well for him.

Right now, UTM has been upgraded to add a fork of QEMU PPC for audio emulation (the Screamer fork), so OS X and macOS 9 emulation is much better than, say, SheepShaver and Basilisk II, for example. Heck, UTM is already much better than DOSBox in many aspects (ie. Networking) and PCem. One more step, and VMware & Parallels could have a run for their money. Wouldn’t be nice to see it?

Now, back on the subject here, I have deviated a lot from the topic here... sorry guys! Anyway, your FIFA 9X screenshots are matching the exact same thing I am seeing on VMware Fusion with SVGA 3D acceleration enabled. Every tiny detail is the same thing on Vw Fusion. Really good to see. I would be willing to test it on my Intel Mac so we could compare M1 x Intel performance, but I’d need a step by step guide “for dummies” on how to compile, install and run. At least the Win 98SE VM I already have one here. I’ll pass the news on OpenGlide to almeath later, that might help him with his DOSBox implementation, thanks!

file.php?id=84855&mode=view

This is FIFA 98 RTWC as seen on VMware Fusion in a 40” TV screen. As you can see, it enables the full, wide screen version. The round white on screen is a reflection from my room. I think that you’ve pretty much matched the same graphics on QEMU.

"Design isn't just what it looks like and feels like. Design is how it works."
JOBS, Steve.

List of ALL Android vulnerabilities

Reply 18 of 24, by digger

User metadata
Rank Oldbie
Rank
Oldbie

Again, splendid work, kjliew!

I still wonder why exactly XQuartz is necessary, though. What dependencies on X11 remain? Isn't there a way to leverage the legacy OpenGL 4.2 implementation in native macOS instead of being stuck with OpenGL 2.x through XQuartz?

Reply 19 of 24, by kjliew

User metadata
Rank Oldbie
Rank
Oldbie

Age of Empire Gold Win98 VM on QEMU M1
QEMU 6.0.0 TCG
The game was rendering native at 1024x768. This is the best resolution together with MacBook Air 13" retina display default scaling. The game is simple DirectDraw 2D game which QEMU always manages it perfectly. No S3 ViRGE, no Voodoo3 *BS* just the lame VBEMP 9x dumb buffer, but it works ... 🤣 Any DirectDraw 2D games will just work out-of-box, StarCraft 1, Diablo 1, Hexplore, Pitfall, Fallout etc. No Rosetta 2, no WineD3D except for DDRAW 2D scaling for games that only support 640x480, but QEMU own borderless fullscreen mode also works for any 2D games.

Screen Shot 2021-06-02 at 6.47.22 PM.jpg
Filename
Screen Shot 2021-06-02 at 6.47.22 PM.jpg
File size
1.44 MiB
Views
186 views
File license
Fair use/fair dealing exception

On the contrary, someone was playing the same game with PCem v17 on M1 suffering graphical glitches ... was it 2D ViRGE driver issue or ARM specific bug, what a mess ... 🤣