VOGONS


First post, by darry

User metadata
Rank l33t++
Rank
l33t++

While I have mentioned this in another thread [1], I thought it might be worth sharing in more detail in a fresh thread.
Apologies in advance if this is common knowledge in at least some circles and/or if there are better ways to do this but, in my search, I have not found any alternatives tp get this to work (please do share some links if I have missed the obvious).

Essentially, I got 3D acceleration (Glide) in a Windows 98 VM on an an actualy physical (via PCI passthrough) Vooodoo 3 . So far, I tried the Need For Speed 2 SE (Glide) demo and a few old Glide demoscene demos successfully . Some other siff crashes so far (Vertigo Nature, for example). And DOS (S)VGA performance (whether real mode DOS or Windows DOS box) seems slow (PCI bandwidth issue, maybe, to be investigated). This works with both Q35 and 440FX machine types (tried latest ones as included in Debian 12)

The host machine has a Ryzen 5 4600G CPU and a B450 chipset , by the way . Main GPU is a GTX 970 .

Under Windows 98 SE , 2D GUI acceleration seems to work, as does Glide (as mentioned above).

The "trick" to getting this to work is to force an init of the card's VGA bios from with the VM (autoexec.bat) . For some reason, SeaBIOS either does not init the Voodoo 3 or does not do it properly , AFAICT.
Without that "trick" the Voodoo 3 only displays a black screen, both in real mode DOS and when booted into Windows 98 SE .

I got the idea to try this from here [2] ( thank you @Predator99 ) .

I added

debug < c:\vga.txt

to autoexec.bat

And c:\vga.txt contains

a call c000:3 int 20 […]
Show full quote

a
call c000:3
int 20

g
q

Before anyone asks, specifying a path to the VGA BIOS dump in the hostdev definition did not work.

[1]
Re: What retro activity did you get up to today?
Re: What retro activity did you get up to today?

[2]

Predator99 wrote on 2022-02-11, 08:44:
I dont think the issue is related to the BIOS. If you are able to boot into DOS you can try to initialize the VGA manually: […]
Show full quote

I dont think the issue is related to the BIOS. If you are able to boot into DOS you can try to initialize the VGA manually:

debug
a
call c000:3
int 20
(enter)
g
q

What happens if you switch to another grpahics mode, i.e. by starting a game?

Reply 2 of 26, by Kahenraz

User metadata
Rank l33t
Rank
l33t

How does this kind of PCI passthrough work? The acceleration is done in the chip but the output is through the VGA connector. When using a PCI graphics card as a passthrough, does the VM end up output through the Voodoo card on a separate monitor?

Reply 3 of 26, by darry

User metadata
Rank l33t++
Rank
l33t++
Kahenraz wrote on 2023-11-20, 15:09:

How does this kind of PCI passthrough work? The acceleration is done in the chip but the output is through the VGA connector. When using a PCI graphics card as a passthrough, does the VM end up output through the Voodoo card on a separate monitor?

The virtual machine (VM) "sees" the video card (a Voodoo 3 in this case) as if it was connected to its (the VM's) PCI bus . The video card drivers installed in the OS running in the VM talk to the passed through video card through the PCI bus. Video is output through the physical port on the video card (VGA in the case of the Voodoo 3) onto a dedicated monitor.

This is not a new thing and is done regularly with moder video cards and and other PCI(E) devices . It has also been done successfully with a Voodoo 2 (I should try with the one I have) , AFAIK . The Voodoo 2 does not have a VGA BIOS, so it is likely simpler to get running on that front at least.

konc wrote on 2023-11-20, 10:01:

Nice! I call the BIOS code to display the initialization strings on demand, now there is another use.
Re: What retro activity did you get up to today?

Thank you for that utility. I'll try it .

Reply 4 of 26, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

that's pretty cool, I did not know that this is possible. If only I could put my V5 into my iMac:)

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 5 of 26, by darry

User metadata
Rank l33t++
Rank
l33t++
Dominus wrote on 2023-11-20, 19:22:

that's pretty cool, I did not know that this is possible. If only I could put my V5 into my iMac:)

Is it x86-64 based ?
Does it have an NVME drive ?
Is enabling hardware virtualization, including IOMMU possible ?

It just might be doable.

Reply 7 of 26, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator
darry wrote on 2023-11-21, 02:37:
Is it x86-64 based ? Does it have an NVME drive ? Is enabling hardware virtualization, including IOMMU possible ? […]
Show full quote
Dominus wrote on 2023-11-20, 19:22:

that's pretty cool, I did not know that this is possible. If only I could put my V5 into my iMac:)

Is it x86-64 based ?
Does it have an NVME drive ?
Is enabling hardware virtualization, including IOMMU possible ?

It just might be doable.

That sounds insane 😉

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 8 of 26, by hyoenmadan

User metadata
Rank Member
Rank
Member
darry wrote on 2023-11-21, 03:45:

A Matrox Millennium II works without the VGA init workaround.
It's also slow in (S)VGA mode, though.

This happens because the way VT-x (and the AMD implementation btw) works. It really doesn't like to do bank switching.
Check I'm not mentioning VT-d or the IOMMU. This is a purely CPU paravirtualization issue. I thought only SVGA/VGA software emulation was affected. Looks like it isn't.

For more information, check NTVDMx86 github issues pages. It has a detailed explanation about.

Reply 9 of 26, by darry

User metadata
Rank l33t++
Rank
l33t++
hyoenmadan wrote on 2023-11-22, 14:37:
This happens because the way VT-x (and the AMD implementation btw) works. It really doesn't like to do bank switching. Check I'm […]
Show full quote
darry wrote on 2023-11-21, 03:45:

A Matrox Millennium II works without the VGA init workaround.
It's also slow in (S)VGA mode, though.

This happens because the way VT-x (and the AMD implementation btw) works. It really doesn't like to do bank switching.
Check I'm not mentioning VT-d or the IOMMU. This is a purely CPU paravirtualization issue. I thought only SVGA/VGA software emulation was affected. Looks like it isn't.

For more information, check NTVDMx86 github issues pages. It has a detailed explanation about.

EDIT : I just tried QXL instead of a passed through PCI card and it is much faster in Doom under DOS, for example. So somthing else is wrong, I would guess .

EDIT2: I get the same slowness in DOS in Doom, for example, when passing through a spare GTX 750 (non need for the VGA init workaround on this card either).
In a quick test in Duke Nukem 3D using VESA 2.0 , I get the usual Nvidia VESA flashing issue, but everything is very fast (I did not try forcing VESA 1.1 to prevent use of the LFB) whereas chained and buffered modes are slow.
Duke Nukem 3D crashed on the passed through Voodoo 3 in VESA 2.0 and was slow in chained and buffered modes .
I ran all that all those tests running Windows 98 as I still have issues getting the keyboard to work in real mode (was planning to focus on that later) with GPU passthrough. I doubt that this changes anything.

Thank you for that information.

Did you mean NTVDMx64 ?

Could you share a link, please ? I seem to be having difficulty finding the specific issue.

Reply 10 of 26, by sKeletoN_SN

User metadata
Rank Newbie
Rank
Newbie

Hello

I know that this is out of topic but I was trying to actually make the GPU passthrough work with a normal PCIE graphics card under Debian 12. This process never worked for me and I wanted to ask if you managed to pull that off.

Reply 11 of 26, by darry

User metadata
Rank l33t++
Rank
l33t++
sKeletoN_SN wrote on 2023-11-24, 23:12:

Hello

I know that this is out of topic but I was trying to actually make the GPU passthrough work with a normal PCIE graphics card under Debian 12. This process never worked for me and I wanted to ask if you managed to pull that off.

Yes, I have a GTX 970 passed through to Windows 7 and XP VMs under Debian 12 on a B450 platform. As a test, I also got bith a GTX970 and a GTX 750TI passed through to the same Windows 7 VM at the same time with working multi-monitor support.

Not sure if I tried with Windows 10 on this setup, but I did get it working on Debian 11 on a different B450 setup.

If you are hitting a snag, you might want to start a new thread about it and share error messages/issues/how far you are getting.

Reply 12 of 26, by sKeletoN_SN

User metadata
Rank Newbie
Rank
Newbie
darry wrote on 2023-11-24, 23:23:
Yes, I have a GTX 970 passed through to Windows 7 and XP VMs under Debian 12 on a B450 platform. As a test, I also got bith a GT […]
Show full quote
sKeletoN_SN wrote on 2023-11-24, 23:12:

Hello

I know that this is out of topic but I was trying to actually make the GPU passthrough work with a normal PCIE graphics card under Debian 12. This process never worked for me and I wanted to ask if you managed to pull that off.

Yes, I have a GTX 970 passed through to Windows 7 and XP VMs under Debian 12 on a B450 platform. As a test, I also got bith a GTX970 and a GTX 750TI passed through to the same Windows 7 VM at the same time with working multi-monitor support.

Not sure if I tried with Windows 10 on this setup, but I did get it working on Debian 11 on a different B450 setup.

If you are hitting a snag, you might want to start a new thread about it and share error messages/issues/how far you are getting.

I just wanted to ask if you have a guide for it. I managed to successfully do it in Manjaro but I couldn't find a guide that's not outdated so far (for Debian 12).

Reply 13 of 26, by darry

User metadata
Rank l33t++
Rank
l33t++
sKeletoN_SN wrote on 2023-11-25, 00:15:
darry wrote on 2023-11-24, 23:23:
Yes, I have a GTX 970 passed through to Windows 7 and XP VMs under Debian 12 on a B450 platform. As a test, I also got bith a GT […]
Show full quote
sKeletoN_SN wrote on 2023-11-24, 23:12:

Hello

I know that this is out of topic but I was trying to actually make the GPU passthrough work with a normal PCIE graphics card under Debian 12. This process never worked for me and I wanted to ask if you managed to pull that off.

Yes, I have a GTX 970 passed through to Windows 7 and XP VMs under Debian 12 on a B450 platform. As a test, I also got bith a GTX970 and a GTX 750TI passed through to the same Windows 7 VM at the same time with working multi-monitor support.

Not sure if I tried with Windows 10 on this setup, but I did get it working on Debian 11 on a different B450 setup.

If you are hitting a snag, you might want to start a new thread about it and share error messages/issues/how far you are getting.

I just wanted to ask if you have a guide for it. I managed to successfully do it in Manjaro but I couldn't find a guide that's not outdated so far (for Debian 12).

I used these as reference points [1] . Some of the stuff is not absolutely necessary. For example a Q35 machine type version 7.2 works fine for me under XP.

[1]
https://forum.mattkc.com/viewtopic.php?t=206
https://forum.mattkc.com/viewtopic.php?t=188

Reply 14 of 26, by sKeletoN_SN

User metadata
Rank Newbie
Rank
Newbie
darry wrote on 2023-11-25, 05:13:
I used these as reference points [1] . Some of the stuff is not absolutely necessary. For example a Q35 machine type version 7.2 […]
Show full quote
sKeletoN_SN wrote on 2023-11-25, 00:15:
darry wrote on 2023-11-24, 23:23:

Yes, I have a GTX 970 passed through to Windows 7 and XP VMs under Debian 12 on a B450 platform. As a test, I also got bith a GTX970 and a GTX 750TI passed through to the same Windows 7 VM at the same time with working multi-monitor support.

Not sure if I tried with Windows 10 on this setup, but I did get it working on Debian 11 on a different B450 setup.

If you are hitting a snag, you might want to start a new thread about it and share error messages/issues/how far you are getting.

I just wanted to ask if you have a guide for it. I managed to successfully do it in Manjaro but I couldn't find a guide that's not outdated so far (for Debian 12).

I used these as reference points [1] . Some of the stuff is not absolutely necessary. For example a Q35 machine type version 7.2 works fine for me under XP.

[1]
https://forum.mattkc.com/viewtopic.php?t=206
https://forum.mattkc.com/viewtopic.php?t=188

Thank you for your answer.

This guide might come handy a bit later if I want to create a Windows 7 or Windows XP VM. However, the part that I cannot make it work in Debian 12 is GPU isolation (I should have mention that earlier).

Reply 15 of 26, by darry

User metadata
Rank l33t++
Rank
l33t++
sKeletoN_SN wrote on 2023-11-25, 10:10:
darry wrote on 2023-11-25, 05:13:
I used these as reference points [1] . Some of the stuff is not absolutely necessary. For example a Q35 machine type version 7.2 […]
Show full quote
sKeletoN_SN wrote on 2023-11-25, 00:15:

I just wanted to ask if you have a guide for it. I managed to successfully do it in Manjaro but I couldn't find a guide that's not outdated so far (for Debian 12).

I used these as reference points [1] . Some of the stuff is not absolutely necessary. For example a Q35 machine type version 7.2 works fine for me under XP.

[1]
https://forum.mattkc.com/viewtopic.php?t=206
https://forum.mattkc.com/viewtopic.php?t=188

Thank you for your answer.

This guide might come handy a bit later if I want to create a Windows 7 or Windows XP VM. However, the part that I cannot make it work in Debian 12 is GPU isolation (I should have mention that earlier).

By isolation, do you mean binding to vfio drivers to avoid use of the PCI(E) device by the host ?

Reply 16 of 26, by sKeletoN_SN

User metadata
Rank Newbie
Rank
Newbie
darry wrote on 2023-11-26, 07:42:
sKeletoN_SN wrote on 2023-11-25, 10:10:
darry wrote on 2023-11-25, 05:13:
I used these as reference points [1] . Some of the stuff is not absolutely necessary. For example a Q35 machine type version 7.2 […]
Show full quote

I used these as reference points [1] . Some of the stuff is not absolutely necessary. For example a Q35 machine type version 7.2 works fine for me under XP.

[1]
https://forum.mattkc.com/viewtopic.php?t=206
https://forum.mattkc.com/viewtopic.php?t=188

Thank you for your answer.

This guide might come handy a bit later if I want to create a Windows 7 or Windows XP VM. However, the part that I cannot make it work in Debian 12 is GPU isolation (I should have mention that earlier).

By isolation, do you mean binding to vfio drivers to avoid use of the PCI(E) device by the host ?

Exactly. This process always failed on me on Debian 12. So how did you obtain the result?

Reply 17 of 26, by darry

User metadata
Rank l33t++
Rank
l33t++
sKeletoN_SN wrote on 2023-11-26, 12:25:
darry wrote on 2023-11-26, 07:42:
sKeletoN_SN wrote on 2023-11-25, 10:10:

Thank you for your answer.

This guide might come handy a bit later if I want to create a Windows 7 or Windows XP VM. However, the part that I cannot make it work in Debian 12 is GPU isolation (I should have mention that earlier).

By isolation, do you mean binding to vfio drivers to avoid use of the PCI(E) device by the host ?

Exactly. This process always failed on me on Debian 12. So how did you obtain the result?

I have not bothered to do it cleanly, TBH.

I just boot to a non graphical target (set with systemctl) and I run rmmod -f nouveau (most often not even necessary, I only nedded to rmmod when passing through a second GPU, 750TI, as a test).

I did do it more cleanly a while back on another host running Debian 11, AFAICR.

Reply 18 of 26, by sKeletoN_SN

User metadata
Rank Newbie
Rank
Newbie
darry wrote on 2023-11-26, 18:08:
I have not bothered to do it cleanly, TBH. […]
Show full quote
sKeletoN_SN wrote on 2023-11-26, 12:25:
darry wrote on 2023-11-26, 07:42:

By isolation, do you mean binding to vfio drivers to avoid use of the PCI(E) device by the host ?

Exactly. This process always failed on me on Debian 12. So how did you obtain the result?

I have not bothered to do it cleanly, TBH.

I just boot to a non graphical target (set with systemctl) and I run rmmod -f nouveau (most often not even necessary, I only nedded to rmmod when passing through a second GPU, 750TI, as a test).

I did do it more cleanly a while back on another host running Debian 11, AFAICR.

So if I understand it corretly:
- You basically didn't take the GPU ids from its corresponding IOMMU group, adding them to grub and pass them to a VFIO driver.

Reply 19 of 26, by darry

User metadata
Rank l33t++
Rank
l33t++
sKeletoN_SN wrote on 2023-11-26, 23:17:
darry wrote on 2023-11-26, 18:08:
I have not bothered to do it cleanly, TBH. […]
Show full quote
sKeletoN_SN wrote on 2023-11-26, 12:25:

Exactly. This process always failed on me on Debian 12. So how did you obtain the result?

I have not bothered to do it cleanly, TBH.

I just boot to a non graphical target (set with systemctl) and I run rmmod -f nouveau (most often not even necessary, I only nedded to rmmod when passing through a second GPU, 750TI, as a test).

I did do it more cleanly a while back on another host running Debian 11, AFAICR.

So if I understand it corretly:
- You basically didn't take the GPU ids from its corresponding IOMMU group, adding them to grub and pass them to a VFIO driver.

No,I did not, at least not on my Debian 12 setup so far.

Additionally, in case the question pops up, as that board has arguably braindead device vs IOMMU grouping, if I passthrough any PCIE card, I also need to passthrough the onboard NIC, SATA controllers and chipset based USB controllers, which are all in the same IOMMU group. I use a USB NIC connected to the CPU provided USB controller (which is in its own IOMMU group). Working around the IOMMU issue would imply using a patched kernel which supports ACS override. I do not want to go there, less for the security concerns than because I do not want to have to patch and and compile kernel every time I want to update it I believe some distros offer precompiled kernels with that patch included but, last time I checked, Debian was not among them.