You are not logged in.

#1 2022-01-04 05:28:22

manray
Member
Registered: 2022-01-01
Posts: 21

[SOLVED] nvidia-xrun doesn't work

Mahchine: Dell XPS 15 9510
GPU: NVIDIA Geoforce RTX 3050
Display manager: XDM

So I have installed and stup nvidia-xrun, following the instructions here. I followed every single instruction except for the secion on enabling an eGPU which I assume is an external GPU (which I do not have). Everything seems to work fine. The Nvidia GPU isn't even recognized at all anymore after booting. Note that the GPU worked perfectly well before, I just wanted the option to turn it on and off when I needed to to save battery life.

My understanding is that I should be able to run `nvidia-xrun <program>` and the GPU will startup and be used in the execution of that program. If I run emacs, for example using
`nvidia-xrun emacs`, I get:

Couldn't get a file descriptor referring to the console.
Turning the PCIe controller on to allow card rescan
on
Waiting 1 second
Turning the card on
on

It hangs here and never returns. I can't even kill the process with Ctrl-c. I have to close the terminal. After closing the terminal, it appears that the system gets stuck on `sudo tee /sys/bus/pci/devices/0000:01:00.0/remove`. I can't kill it no matter what signal I send it. This process even causes me to not be able to shutdown properly.

Side note: if while it's hanging, I can see the NVIDIA card in lspci, which indicates to me that it is somewhat working properly. Before running nvidia-xrun, lspci doesn't display anything about a NVIDIA card.

If I just run `nvidia-xrun -d` I get

Couldn't get a file descriptor referring to the console.
Turning the PCIe controller on to allow card rescan
>>Dry run. Command: sudo tee /sys/bus/pci/devices/0000:00:01.0/power/control <<<on
Waiting 1 second
>>Dry run. Command: sleep 1
Turning the card on
>>Dry run. Command: sudo tee /sys/bus/pci/devices/0000:01:00.0/power/control <<<on
Loading module nvidia
>>Dry run. Command: sudo modprobe nvidia
Loading module nvidia_uvm
>>Dry run. Command: sudo modprobe nvidia_uvm
Loading module nvidia_modeset
>>Dry run. Command: sudo modprobe nvidia_modeset
Loading module nvidia_drm modeset=1
>>Dry run. Command: sudo modprobe nvidia_drm modeset=1
>>Dry run. Command: xinit /etc/X11/xinit/nvidia-xinitrc "" -- :1 vt -nolisten tcp -br -config nvidia-xorg.conf -configdir nvidia-xorg.conf.d
Unloading module nvidia_drm
>>Dry run. Command: sudo modprobe -r nvidia_drm
Unloading module nvidia_modeset
>>Dry run. Command: sudo modprobe -r nvidia_modeset
Unloading module nvidia_uvm
>>Dry run. Command: sudo modprobe -r nvidia_uvm
Unloading module nvidia
>>Dry run. Command: sudo modprobe -r nvidia
Removing Nvidia bus from the kernel
>>Dry run. Command: sudo tee /sys/bus/pci/devices/0000:01:00.0/remove <<<1
Enabling powersave for the PCIe controller
>>Dry run. Command: sudo tee /sys/bus/pci/devices/0000:00:01.0/power/control <<<auto

This returns just find and does not hang at all.

I do not want to run XDM through my GPU, but for the sake of getting nvidia-xrun to work at all, I attempted to follow the article and do so. When I am in the actual arch console (before loading xdm) I rn nvidia-xrun and get:

Turning the PCIe controller on to allow card rescan
on
Waiting 1 second
Rescanning PCI devices
1
Waiting 1 second for rescan
Turning the card on
on
Loading module nvidia
Loading module nvidia_uvm
Loading module nvidia_modeset
Loading module nvidia_drm modeset=1
Unloading module nvidia_drm
Unloading module nvidia_modeset
Unloading module nvidia_uvm
Unloading module nvidia
Removing Nvidia bus from the kernel
1
Enabling powersave for the PCIe controller
auto

It then attempts to start the xserver. All the output looks normal until it errors with:

XF86EnableIO: failed to enable I/O ports 0000-03ff (Operation not permitted) EE Fatal server error: EE no screens found ...etc
xinit: giving up
xinit: unable to connect to xserver: connection refused
xinit: server error

Again, I have no desire to run my window manager through the GPU. I really only want to be able to turn the GPU on (very rarely) if I might want to play a game or something.

One thing that I noted as weird is the BusIDs. When I ran `lspci | grep -i nvidia | awk '{print $1}'` (before installing nvidia-xrun) I would get `0000:01:00.0`. So in all the conf files in /etc/X11, I put `0000:01:00.0`. Every single BusID that I saw online was something like `1:0:0` or somehting like that. I'm not really sure if this is significant, just thought I'd mention it.

Any ideas? If I can provide any additional info, please let me know.

Last edited by manray (2022-01-05 21:29:49)

Offline

#2 2022-01-04 07:58:29

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,223

Re: [SOLVED] nvidia-xrun doesn't work

Your understanding is incorrect, nvidia-xrun is for running the entire session on the graphics card and it uses the old method of setting up Optimus systems (the first sentence of the article does mention running an entire x server, which is explicitly not what you want). What you actually want to do is remove nvidia-xrun and any xorg.confs you've adjusted in an attempt to set it up and instead follow: https://wiki.archlinux.org/title/PRIME# … er_offload

Last edited by V1del (2022-01-04 08:02:10)

Offline

#3 2022-01-05 21:29:31

manray
Member
Registered: 2022-01-01
Posts: 21

Re: [SOLVED] nvidia-xrun doesn't work

V1del wrote:

Your understanding is incorrect, nvidia-xrun is for running the entire session on the graphics card and it uses the old method of setting up Optimus systems (the first sentence of the article does mention running an entire x server, which is explicitly not what you want). What you actually want to do is remove nvidia-xrun and any xorg.confs you've adjusted in an attempt to set it up and instead follow: https://wiki.archlinux.org/title/PRIME# … er_offload


You're totally right. I configured nvidia-prime and it's working exactly as I expect. Solved.

Offline

Board footer

Powered by FluxBB