You are not logged in.

#1 2020-12-14 16:59:00

ashic
Member
Registered: 2020-01-22
Posts: 68

[solved] Multiple ramdisks and select one at boot time

I'm trying to get qemu with kvm going to enable use of my discrete gpu in my laptop in a Windows guest. I also have bumblebee working correctly on my host. I'm using grub as my bootloader.

So one of the steps in the guide I'm following tells me to isolate my discrete gpu via /etc/modprobe/vfio.conf

options vfio-pci ids=10de:13b1

And then I do:

sudo mkinitcpio -p linux    

(I have the necessary modules loaded in /etc/mkinit.cpio.conf).

Upon rebooting, I see that the gpu is isolated (as expected) but that also means optirun glxgears doesn't run as... well... the gpu is isolated.

Now it could be that since bumblebee already has the gpu "off", I don't need to isolate at all, and I'll test if that's the case too. But in case I do need to isolate it to pass it to the guest, is there an easy way to have two of the things that "sudo mkinitcpio -p linux" generates, and then select one or the other at boot time? My view would be to have the one for bumblebee be in use normally, with the one for vfio with the isolated gpu would be one I select when I wish to work in a guest vm that needs gpu.

Is this possible?

Last edited by ashic (2020-12-16 02:18:38)

Offline

#2 2020-12-14 17:07:48

loqs
Member
Registered: 2014-03-06
Posts: 19,029

Re: [solved] Multiple ramdisks and select one at boot time

Yes see Mkinitcpio#Customized_generation then update grub to add another boot entry using the custom initrd.

Offline

#3 2020-12-14 17:45:33

ashic
Member
Registered: 2020-01-22
Posts: 68

Re: [solved] Multiple ramdisks and select one at boot time

Thanks... upon further investigation, it appears I don't need a full fledged custom ramdisk, but just different kernel params. Does that make it simpler? My /etc/default/grub looks likes this:

GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="Antergos"
GRUB_CMDLINE_LINUX_DEFAULT="quiet resume=UUID=262d11e0-271e-4cdb-ba40-866bdbec1313 libata.allow_tpm=1 intel_iommu=on"
GRUB_CMDLINE_LINUX=""

# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos"
...

On my grub screen there's an entry for antergos (my distro installed when it was still a thing), and one for "advanced". Going into advanced gives a few more menu items, and it looks like the options can have additional kernel params. Is there a way to add an entry that's identical to the existing one only with the following:

GRUB_CMDLINE_LINUX_DEFAULT="quiet resume=UUID=262d11e0-271e-4cdb-ba40-866bdbec1313 libata.allow_tpm=1 intel_iommu=on" vfio-pci.ids=10de:13b1

I feel like there might be an easy way of doing this, but am learning this stuff.

Offline

#4 2020-12-14 18:16:22

ashic
Member
Registered: 2020-01-22
Posts: 68

Re: [solved] Multiple ramdisks and select one at boot time

Managed to add another entry by following https://askubuntu.com/questions/1155064 … ns-in-grub

Offline

#5 2020-12-14 21:05:16

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,652

Re: [solved] Multiple ramdisks and select one at boot time

Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.

Offline

Board footer

Powered by FluxBB