quickpassthrough icon indicating copy to clipboard operation
quickpassthrough copied to clipboard

The app crashes on AMD iGPU

Open kaanchinar opened this issue 1 year ago • 9 comments

I have AMD Ryzen 7600X CPU with Raphael iGPU and RTX 4060 dGPU.

I want to make iGPU pass to guest OS while Linux host using NVIDIA GPU. But after select the IOMMU groups the app crashes and returns panic.

panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
github.com/HikariKnight/quickpassthrough/internal/pages.genVBIOS_dumper(0xc000100870)
/home/runner/work/quickpassthrough/quickpassthrough/internal/pages/03_vbios_extract.go:30 +0x37f
github.com/HikariKnight/quickpassthrough/internal/pages.viewGPU(0xc000100870, {0x0?, 0x0, 0x2?})
/home/runner/work/quickpassthrough/quickpassthrough/internal/pages/02_select_gpu.go:107 +0x4de
github.com/HikariKnight/quickpassthrough/internal/pages.SelectGPU(0xc000100870)
/home/runner/work/quickpassthrough/quickpassthrough/internal/pages/02_select_gpu.go:36 +0x105
github.com/HikariKnight/quickpassthrough/internal/pages.Welcome()
/home/runner/work/quickpassthrough/quickpassthrough/internal/pages/01_welcome.go:48 +0x271
github.com/HikariKnight/quickpassthrough/internal.Tui()
/home/runner/work/quickpassthrough/quickpassthrough/internal/ui_main.go:23 +0xbb
main.main()
/home/runner/work/quickpassthrough/quickpassthrough/cmd/main.go:23 +0xa5

By the way, in the error log, the home directory is not same as mine. My /home is /home/kaan.

How can I solve that issue?

kaanchinar avatar Apr 19 '24 20:04 kaanchinar

can you provide the output of debug.log?

HikariKnight avatar Apr 20 '24 23:04 HikariKnight

can you provide the output of debug.log?

Sure!

2024/04/21 11:45:27
Welcome to Quickpassthrough 3bda7ca!

2024/04/21 11:45:29
/etc/modprobe.d found on the system
Creating config/etc/modprobe.d

2024/04/21 11:45:29
Backup directory does not exist!
Creating backup directory for first run backup
2024/04/21 11:45:29
/etc/default found on the system
Creating config/etc/default

2024/04/21 11:45:29
/etc/mkinitcpio.conf found on the system
Creating config/etc/mkinitcpio.conf

2024/04/21 11:45:29
No first time backup of /etc/mkinitcpio.conf detected.
Creating a backup at backup/etc/mkinitcpio.conf

2024/04/21 11:45:29
/etc/default/grub found on the system
Creating config/etc/default/grub

2024/04/21 11:45:29
No first time backup of /etc/default/grub detected.
Creating a backup at backup/etc/default/grub

2024/04/21 11:45:29
Executing: utils/ls-iommu -g -F vendor:,prod_name,optional_revision:,device_id

2024/04/21 11:45:30
ls-iommu query returned
IOMMU Group  12: NVIDIA Corporation: AD107 [GeForce RTX 4060] (rev a1): [10de:2882]
IOMMU Group  26: Advanced Micro Devices, Inc. [AMD/ATI]: Raphael (rev c7): [1002:164e]

2024/04/21 11:45:32
Executing: utils/ls-iommu -g -r -i 26 -F vendor:,prod_name,optional_revision:,device_id

2024/04/21 11:45:32
ls-iommu query returned
IOMMU Group  26: Advanced Micro Devices, Inc. [AMD/ATI]: Raphael (rev c7): [1002:164e]

2024/04/21 11:45:35
Executing: utils/ls-iommu -g -r -i 26 --id

2024/04/21 11:45:35
ls-iommu query returned
1002:164e

2024/04/21 11:45:35
Executing: utils/ls-iommu -g -i 26 --rom

2024/04/21 11:45:36
ls-iommu query returned

kaanchinar avatar Apr 21 '24 07:04 kaanchinar

Seems like you are trying to setup passthrough for the igpu, this will not work from my knowledge.

a valid config (if the motherboard allows it) would be igpu for host and dgpu for the guest(VM).

I do however see where it is crashing and it is because you selected a card that has no vbios (since it is part of the cpu), so the crash actually stopped you from doing something you shouldn't. I will fix it and put in a warning.

HikariKnight avatar Apr 21 '24 12:04 HikariKnight

Seems like you are trying to setup passthrough for the igpu, this will not work from my knowledge.

a valid config (if the motherboard allows it) would be igpu for host and dgpu for the guest (VM).

I do however see where it is crashing and it is because you selected a card that has no vbios (since it is part of the cpu), so the crash actually stopped you from doing something you shouldn't. I will fix it and put in a warning.

So, it is impossible to pass iGPU to VM? Because my monitor connected to NVIDIA, and I have only 1 cable for my monitor.

kaanchinar avatar Apr 21 '24 12:04 kaanchinar

I would also love to pass iGPU to VM (in desktop)

zen0bit avatar Apr 22 '24 08:04 zen0bit

i believe only intel supports passing through igpus and it is not well documented and the process is completely different to how you would pass through a pcie gpu which this is intended for, i should change the readme to reflect that since i didnt think people would try to passthrough an igpu to be honest.

amd has no support for it i believe.

and I have only 1 cable for my monitor.

look up "ghost display adapter" on amazon, get one (ideally displayport but hdmi works fine too) that is what i use when using https://looking-glass.io with the pcie gpu i passed through to the windows VM

HikariKnight avatar Apr 22 '24 11:04 HikariKnight

But should be doable no? If iGPU is in IOMMU group alone (yes) Not bound to system (yes) Upgraded to CPU + iGPU with that in mind...

zen0bit avatar Apr 22 '24 15:04 zen0bit

But should be doable, no? If iGPU is in IOMMU group alone (yes) Not bound to system (yes) Upgraded to CPU + iGPU with that in mind...

well, i unplugged my hdmi from dgpu to igpu and all IOMMU stuff works well. the problem is with igPU i guess.

kaanchinar avatar Apr 22 '24 17:04 kaanchinar

But should be doable, no? If iGPU is in IOMMU group alone (yes) Not bound to system (yes) Upgraded to CPU + iGPU with that in mind...

well, i unplugged my hdmi from dgpu to igpu and all IOMMU stuff works well. the problem is with igPU i guess.

you will need to get a ghost display adapter for your dgpu to work in the VM though and then you setup looking-glass and you will be good (or you can setup sunshine, both options will need a ghost adapter)

There is a sampledriver for a fake display that you can also use but it is not recommended as it does not give the same performance. :)

HikariKnight avatar Apr 22 '24 19:04 HikariKnight

Closing as the issue was with trying to passthrough an igpu which is not supported. (and i have definitively not forgotten to close this earlier :joy: )

HikariKnight avatar Jun 09 '24 12:06 HikariKnight