#Black screen on TTY after unloading nvidia_drm module

23 messages · Page 1 of 1 (latest)

knotty spoke
#

I'm setting up VFIO passthrough on my Arch system and running into an issue. When I switch to a TTY and unload the nvidia_drm module (using modprobe -r nvidia_drm), my screen goes black and I lose all video output — even in TTY.

I'm doing this to prepare for GPU passthrough to a VM. I’m on Arch Linux, using SDDM and KDE Plasma (Wayland), and I have an NVIDIA GPU (RTX 3060) that I want to unbind from the host.

Is there a safe way to unload nvidia_drm or prepare the GPU for passthrough without losing TTY output?

I’m manually unloading these: nvidia_uvm, nvidia_drm, nvidia_modeset, nvidia, i2c_nvidia_gpu, drm_kms_helper, drm

exotic leaf
#

In short no - when you unload the nvidia via something like

modprobe -r nvidia_drm nvidia_modeset nvidia_uvm nvidia

the device is no longer attached or able to communicated with in any way outside of re-attaching the device or routing it for use by a vm. As such there is no ability to output a TTY or other to it. The best course of action here is to have a secondary computer, be it a laptop so you can SSH into the box in case something goes wrong and you need a session on the machine you are using for gpu passthrough.

When you do

modprobe nvidia_drm
modprobe nvidia_modeset
modprobe nvidia_uvm
modprobe nvidia

You re-connect those devices to the OS and then need to re-hook up the TTYs with

echo 1 > /sys/class/vtconsole/vtcon0/bind 

Or similar to match your desired consoles.

After that you can should be able to get a TTY and it is up to you to start SDDM correctly in your script or from the tty that point. In mine I use GDM and its as easy as

systemctl start displaymanager 

because it is stopped in the prepare script

#

The VFIO process is actually pretty easy these days relatively - happy to help more with you getting it working

#

but SSH is going to be your best friend, even if you are just able to SSH into your machine from your phone

exotic leaf
#

@knotty spoke

knotty spoke
#

sorry i was sleeping

#

thanks i'll try that

#

I got a laptop running MacOS, I could probably use that

knotty spoke
#

but

#

i think the gpu is unbinded

#

i'm not sure how to check, and i'm definitely not sure how to bind it to the vfio

#

wait i think i got it working

#

LETS FUCKING GO I GOT IT WORKING

#

keyboard and mouse input is still not working for me tho

knotty spoke
#

how could I use evdev passthrough? @exotic leaf

exotic leaf
#

so

#

okay

#

you got the gpu working and vm booted

#

Personally I just pass through the pci devices that are associated with my usb ports in the back

knotty spoke
#

alright

#

i'll just use evdev