Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unbinding efi-framebuffer causes segmentation fault #69

Open
twenty405 opened this issue Jun 27, 2021 · 2 comments
Open

Unbinding efi-framebuffer causes segmentation fault #69

twenty405 opened this issue Jun 27, 2021 · 2 comments

Comments

@twenty405
Copy link

Hi,
I have set up the scripts for my win10 VM and have attached them below. When running the start script via SSH, a segmentation fault occurs after the EFI framebuffer unbinding line and the rest of the script does not execute, so the VM does not start. I believe I have set up the virt-manager config correctly, passed through the PCI devices, provided a rom file for the GPU and it boots fine without passing the GPU through. I'm not sure what I'm doing wrong here and can't find any useful information about this online, so I am asking for support here.
GPU: AMD RX 570
OS: Manjaro, Linux 5.12.9

kvm.conf:

VIRSH_GPU_VIDEO=pci_0000_07_00_0
VIRSH_GPU_AUDIO=pci_0000_07_00_1

start.sh:

# debugging
set -x

# load variables
source "/etc/libvirt/hooks/kvm.conf"

# stop display manager
systemctl stop sddm.service

# Unbind VTconsoles
echo 0 > /sys/class/vtconsole/vtcon0/bind

# Unbind EFI-framebuffer
echo "efi-framebuffer.0" > /sys/bus/platform/drivers/efi-framebuffer/unbind

# Avoid race condition
sleep 10

# unbind gpu
virsh nodedev-detach $VIRSH_GPU_VIDEO
virsh nodedev-detach $VIRSH_GPU_AUDIO

# load vfio
modprobe vfio
modprobe vfio_pci
modprobe vfio_iommu_type1

revert.sh:

# Debug
set -x

# Load variables
source "/etc/libvirt/hooks/kvm.conf"

# unload vfio-pci
modprobe -r vfio_pci
modprobe -r vfio_iommu_type1
modprobe -r vfio

# Rebind GPU
virsh nodedev-reattach $VIRSH_GPU_VIDEO
virsh nodedev-reattach $VIRSH_GPU_AUDIO

# rebind VTconsoles
echo 1 > /sys/class/vtconsole/vtcon0/bind

# Read nvidia x config
# Unneeded (AMD)

# Bind EFI-framebuffer
echo "efi-framebuffer.0" > /sys/bus/platform/drivers/efi-framebuffer/bind

# load AMD
modprobe amdgpu
modprobe drm_kms_helper
modprobe drm

# Restart Display service
systemctl start sddm.service
@thebiblelover7
Copy link

I am having the exact same issue.
@joeknock90 Any idea what it could be?

@HoodedDeath
Copy link

I've been fighting with this for a while and found the solution for it. @twenty405 @adrielsand if you two are still having this issue, I hope I can be helpful.

I posted basically this same question to the VFIO subreddit here. One commenters pointed out to me that, for AMD, you don't need to unbind the EFI-frambuffer. Remove the lines involving the VT consoles and the EFI-framebuffer from your script, let the virsh nodedev-detach and virsh nodedev-reattach lines handle that automatically. After those lines, unload and load the modules as needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants