dracutdevs / dracut

dracut the event driven initramfs infrastructure
https://github.com/dracutdevs/dracut/wiki
GNU General Public License v2.0
604 stars 400 forks source link

force_drivers not working in non-host mode #2121

Open daiaji opened 1 year ago

daiaji commented 1 year ago

Describe the bug As the title says, I configured force_drivers, but it doesn't seem to work.

Distribution used Manjaro Linux 22.0.0

Dracut version dracut-git-056.r270.43c16bfa-1-x86_64

Init system systemd 252 (252.3-1-manjaro)

To Reproduce 1.Configure dracut.

cat /etc/dracut.conf.d/myflags.conf
force_drivers+=" vfio_pci vfio vfio_iommu_type1 vfio_virqfd "

cat /etc/modprobe.d/vfio.conf 
options vfio-pci ids=10de:1c82,10de:0fb9

sudo dracut --force /boot/initramfs-6.0-x86_64.img
  1. reboot

  2. sudo lspci -n -v -s 2e:00.0
    2e:00.0 0300: 10de:1c82 (rev a1) (prog-if 00 [VGA controller])
        Subsystem: 7377:0000
        Flags: bus master, fast devsel, latency 0, IRQ 124, IOMMU group 27
        Memory at fb000000 (32-bit, non-prefetchable) [size=16M]
        Memory at 7f10000000 (64-bit, prefetchable) [size=256M]
        Memory at 7f20000000 (64-bit, prefetchable) [size=32M]
        I/O ports at e000 [size=128]
        Expansion ROM at fc000000 [disabled] [size=512K]
        Capabilities: [60] Power Management version 3
        Capabilities: [68] MSI: Enable+ Count=1/1 Maskable- 64bit+
        Capabilities: [78] Express Legacy Endpoint, MSI 00
        Capabilities: [100] Virtual Channel
        Capabilities: [250] Latency Tolerance Reporting
        Capabilities: [128] Power Budgeting <?>
        Capabilities: [420] Advanced Error Reporting
        Capabilities: [600] Vendor Specific Information: ID=0001 Rev=1 Len=024 <?>
        Capabilities: [900] Secondary PCI Express
        Kernel driver in use: nouveau
        Kernel modules: nouveau

Expected behavior Successfully attached vfio-pci to GTX1050TI.

Additional context https://wiki.archlinux.org/title/PCI_passthrough_via_OVMF#dracut

lsinitrd.log: https://gist.github.com/daiaji/5829d7170715b0906dc89e86d6d6a83d

LaszloGombos commented 1 year ago

sudo dracut --debug -v --force /boot/initramfs-6.0-x86_64.img

@daiaji, are you able to share the log for this command

daiaji commented 1 year ago

https://gist.github.com/daiaji/f9527594d2b683b34a0cb7a7f6ed5020

johannbg commented 1 year ago

What happens if you add the hostonly option when generating the image dracut -f -H /boot/initramfs-6.0-x86_64.img ?

daiaji commented 1 year ago

It's working, but documentation is missing.

johannbg commented 1 year ago

That's something that the editors of the wiki page need to look at but looking at the steps in the wiki page we probably should just turn those into a module and or add those to the existing modules so users dont have to jump through so many hoops to just enable this.

daiaji commented 1 year ago

Dedicated modules do enhance ease of use, but documentation is also important, and force_drivers not working in non-host mode is expected behavior?

Iceburgino commented 1 year ago

I have a similar issue but on EndeavourOS. H option doesn't work for me.

Edit: for anyone having the same problem, there's the solution to mine.