Translation(s): none
Nvidia-xrun: A utility to run a separate X server with discrete Nvidia graphics with full performance.
From the README:
- These utility scripts aim to make the life easier for Nvidia cards users. It started with a revelation that bumblebee in current state offers very poor performance. This solution offers a bit more complicated procedure but offers a full GPU utilization (in terms of linux drivers).
As the Arch Wiki puts it:
- Nvidia-xrun is a utility to allow Nvidia optimus enabled laptops to run an X server with discrete Nvidia graphics on demand. This solution offers full GPU utilization, compatibility and better performance than Bumblebee.
Nvidia-xrun has not yet been packaged for Debian, but it can be used with some manual work and modification; this page explains the procedure for doing so (at least on Bullseye / Sid, on amd64).
Uninstall / purge Bumblebee. This may not be necessary, but Witko (the nvidia-xrun developer) recommends it.
- Make sure that all appropriate Debian Nvidia packages (kernel, X, and glx) are installed.
Download nvidia-xrun from https://github.com/Witko/nvidia-xrun.
Edit the file nvidia-xorg.conf as follows:
The section Files needs to be modified to reflect Debian’s directory hierarchy (see ?https://github.com/Witko/nvidia-xrun/issues/70). Delete all ModulePath lines and replace them with the following (they may not all be necessary):
ModulePath "/usr/lib/nvidia/current" ModulePath "/usr/lib/x86_64-linux-gnu/nvidia" ModulePath "/usr/lib/x86_64-linux-gnu/nvidia/xorg" ModulePath "/usr/lib/x86_64-linux-gnu/nvidia/xorg/modules" ModulePath "/usr/lib/xorg" ModulePath "/usr/lib/xorg/modules"
In the Device section, modify the BusID with the Nvidia card’s bus id, which can be found with lspci | grep -i nvidia | awk '{print $1}' It should be converted into a simple decimal triplet, with leading zeros removed, and preceded with PCI, so 01:00.0 (for example) becomes "PCI:1:0:0".
Copy nvidia-xorg.conf to the /etc/X11/ directory (and chown root:root nvidia-xorg.conf).
In the file nvidia-xinitrc, replace the line beginning export LD_LIBRARY_PATH with export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/nvidia:/usr/lib:${LD_LIBRARY_PATH}, copy the file to the /etc/X11/xinit directory, and chown root:root nvidia-xinitrc && chmod +x nvidia-xinitrc.
To use nvidia-xrun, switch to an open virtual terminal and run nvidia-xrun some_command, where some_command is either the name of the program to be run using the Nvidia card (e.g., nvidia-xrun glxgears), or a window manager like Openbox (e.g., nvidia-xrun openbox-session), from which other programs can be run.
See also
A guide to setting up nvidia-xrun
A blog post about nvidia-xrun