From 0efcf4ee19446bff0d3a5358244d5763ffc84980 Mon Sep 17 00:00:00 2001 From: HikariKnight <2557889+HikariKnight@users.noreply.github.com> Date: Mon, 6 Jan 2025 14:15:45 +0100 Subject: [PATCH 1/2] fix(dracut): force load vfio modules earlier this should make them load before any gpu drivers --- internal/configs/config_dracut.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/configs/config_dracut.go b/internal/configs/config_dracut.go index 1aa0f23..bc0b503 100644 --- a/internal/configs/config_dracut.go +++ b/internal/configs/config_dracut.go @@ -22,10 +22,10 @@ func Set_Dracut() { } // Write to logger - logger.Printf("Writing to %s:\nadd_drivers+=\" %s \"\n", dracutConf, strings.Join(vfio_modules(), " ")) + logger.Printf("Writing to %s:\nforce_drivers+=\" %s \"\n", dracutConf, strings.Join(vfio_modules(), " ")) // Write the dracut config file - fileio.AppendContent(fmt.Sprintf("add_drivers+=\" %s \"\n", strings.Join(vfio_modules(), " ")), dracutConf) + fileio.AppendContent(fmt.Sprintf("force_drivers+=\" %s \"\n", strings.Join(vfio_modules(), " ")), dracutConf) // Get the current kernel arguments we have generated kernel_args := fileio.ReadFile(config.Path.CMDLINE) From c1f11ce1c3a656667c91913c7c97a279d958adbf Mon Sep 17 00:00:00 2001 From: jedrw Date: Sun, 29 Dec 2024 18:54:20 +0000 Subject: [PATCH 2/2] fix: avoid potential index out of range error if ls-iommu cannot find a vbios path Signed-off-by: HikariKnight <2557889+HikariKnight@users.noreply.github.com> --- internal/pages/03_vbios_extract.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/internal/pages/03_vbios_extract.go b/internal/pages/03_vbios_extract.go index 598b584..44dcc04 100644 --- a/internal/pages/03_vbios_extract.go +++ b/internal/pages/03_vbios_extract.go @@ -26,9 +26,11 @@ func genVBIOS_dumper(config *configs.Config) { scriptdir, _ = os.Getwd() } - // Get the vbios path and generate the vbios dumping script - vbios_path := lsiommu.GetIOMMU("-g", "-i", config.Gpu_Group, "--rom")[0] - configs.GenerateVBIOSDumper(vbios_path) + // Search for a vbios path and generate the vbios dumping script if found + vbios_paths := lsiommu.GetIOMMU("-g", "-i", config.Gpu_Group, "--rom") + if len(vbios_paths) != 0 { + configs.GenerateVBIOSDumper(vbios_paths[0]) + } // Make the qemu config folder os.Mkdir(fmt.Sprintf("%s/%s", scriptdir, config.Path.QEMU), os.ModePerm) @@ -51,7 +53,7 @@ func genVBIOS_dumper(config *configs.Config) { "rom to the VM along with the card in order to get a functional passthrough.\n", "In many cases you can find your vbios at https://www.techpowerup.com/vgabios/\n", "\n", - "You can also attempt to dump your own vbios from TTY using the script in\n", + "If we found a romfile for your GPU you can also attempt to dump your own vbios from TTY using the script in\n", fmt.Sprintf("%s/utils/dump_vbios.sh\n", scriptdir), "\n", )