Void linux nvidia optimus

NVIDIA

This is a reverse engineered driver largely developed by the community, with some documentation provided by Nvidia. It tends to perform well on older hardware, and is required to use a large portion of the available Wayland compositors.

At the time of writing, graphics cards starting with second generation Maxwell (GTX 9xx) are unable to perform at their full potential with nouveau . This is because the linux-firmware collection is missing signed firmware blobs needed to reclock these cards past their boot frequencies.

To use nouveau with Wayland, you only need the mesa-dri package, which provides the accelerated OpenGL driver. On X11, you also need an appropriate Xorg driver. You can either install xf86-video-nouveau or use the universal modesetting driver bundled with Xorg (this is the only option on Tegra based ARM boards). The former can make use of GPU-specific 2D acceleration paths, which is primarily useful on older cards with specialized fixed function hardware (the modesetting driver will accelerate 2D using OpenGL via GLAMOR). When in doubt, it’s a good idea to try xf86-video-nouveau first.

Note: xf86-video-nouveau is usually installed by default if you use the xorg metapackage. If you use xorg-minimal , you will need to install it manually, either directly or through xorg-video-drivers .

nvidia (Proprietary Driver)

The proprietary drivers are available in the nonfree repository.

Check if your graphics card belongs to the legacy branch. If it does not, install the nvidia package. Otherwise you should install the appropriate legacy driver, nvidia470 or nvidia390 . The older legacy driver, nvidia340 , is no longer available, and users are encouraged to switch to nouveau.

Brand Type Model Driver Package
NVIDIA Proprietary 800+ nvidia
NVIDIA Proprietary 600/700 nvidia470
NVIDIA Proprietary 400/500 Series nvidia390

The proprietary driver integrates in the kernel through DKMS.

This driver offers better performance and power handling, and is recommended where performance is needed.

32-bit program support (glibc only)

In order to run 32-bit programs with driver support, you need to install additional packages.

If using the nouveau driver, install the mesa-dri-32bit package.

If using the nvidia driver, install the nvidia-libs-32bit package. represents the legacy driver version ( 470 or 390 ) or can be left empty for the main driver.

Reverting from nvidia to nouveau

Uninstalling nvidia

In order to revert to the nouveau driver, install the nouveau driver (if it was not installed already), then remove the nvidia , nvidia470 , or nvidia390 package, as appropriate.

If you were using the obsolete nvidia340 driver, you might need to install the libglvnd package after removing the nvidia340 package.

Читайте также:  Проверка существования email linux

Keeping both drivers

It is possible to use the nouveau driver while still having the nvidia driver installed. To do so, remove the blacklisting of nouveau in /etc/modprobe.d/nouveau_blacklist.conf , /usr/lib/modprobe.d/nvidia.conf , or /usr/lib/modprobe.d/nvidia-dkms.conf by commenting it out:

For Xorg, specify that it should load the nouveau driver rather than the nvidia driver by creating the file /etc/X11/xorg.conf.d/20-nouveau.conf with the following content:

Section "Device" Identifier "Nvidia card" Driver "nouveau" EndSection 

You may need to reboot your system for these changes to take effect.

Источник

NVIDIA Optimus

NVIDIA Optimus refers to a dual graphics configuration found on laptops consisting of an Intel integrated GPU and a discrete NVIDIA GPU.

There are different methods to take advantage of the NVIDIA GPU, which depend on the driver version supported by your hardware.

In order to determine the correct driver to install, it is not enough to look at the «Supported Products» list on NVIDIA’s website, because they are not guaranteed to work in an Optimus configuration. So the only way is to try installing the latest nvidia , rebooting, and looking at the kernel log. If your device is not supported, you will see a message like this:

NVRM: The NVIDIA GPU xxxx:xx:xx.x (PCI ID: xxxx:xxxx) NVRM: installed in this system is not supported by the xxx.xx NVRM: NVIDIA Linux driver release. Please see 'Appendix NVRM: A - Supported NVIDIA GPU Products' in this release's NVRM: README, available on the Linux driver download page NVRM: at www.nvidia.com. 

which means you have to uninstall nvidia and install the legacy nvidia390 .

A summary of the methods supported by Void, which are mutually exclusive:

  • available on nvidia and nvidia470
  • allows to switch to the NVIDIA GPU on a per-application basis
  • more flexible but power saving capabilities depend on the hardware (pre-Turing devices are not shut down completely)

Offloading Graphics Display with RandR 1.4

  • available on nvidia , nvidia470 , and nvidia390
  • allows to choose which GPU to use at the start of the X session
  • less flexible, but allows the user to completely shut down the NVIDIA GPU when not in use, thus saving power
  • available on nvidia , nvidia470 , and nvidia390
  • allows to switch to the NVIDIA GPU on a per-application basis
  • unofficial method, offers poor performance
  • uses the open source driver nouveau
  • allows to switch to the NVIDIA GPU on a per-application basis
  • nouveau is a reverse-engineered driver and offers poor performance

You can check the currently used GPU by searching for renderer string in the output of the glxinfo command. It is necessary to install the glxinfo package for this. For the first two alternatives below, it is also possible to verify that a process is using the NVIDIA GPU by checking the output of nvidia-smi .

Читайте также:  Linux xbox 360 freeboot

PRIME Render Offload

In this method, GPU switching is done by setting environment variables when executing the application to be rendered on the NVIDIA GPU. The wrapper script prime-run is available from the nvidia package, and can be used as shown below:

For more information, see NVIDIA’s README

Bumblebee

Enable the bumblebeed service and add the user to the bumblebee group. This requires a re-login to take effect.

Run the application to be rendered on the NVIDIA GPU with optirun :

Nouveau PRIME

This method uses the open source nouveau driver. If the NVIDIA drivers are installed, it is necessary to configure the system to use nouveau .

Set DRI_PRIME=1 to run an application on the NVIDIA GPU:

Источник

Dual Intel and Nvidia graphics on Void Linux

Nvidia Optimus technology allows seamlessly switch between two graphics cards on a laptop. An Intel integrated card is used to safe battery life when performance is not needed. A discrete Nvidia card is turned on for certain applications, like games, mining. It was a big tricky to setup dual graphics on Void Linux. A few hints below could help you to take advantage of this technology on Linux.

It is well describe on wiki.voidlinux.eu how to setup either Nvidia or Intel graphics card on Void Linux. The issue comes when you try to install OpenGL libraries for both Nvidia and Intel graphics. It does not work, because these libraries conflict with each other. It is possible to upgrade from mesa libGL to libGL from Nvidia, but not in another direction. If you already installed OpenGL libraries for Nvidia, you have to remove them first (including all dependencies) before installing mesa OpenGL libraries for Intel graphics.

I ended up re-installing Nvidia and mesa OpenGL libraries for at least 5 times when trying to setup Nvidia Optimus on my laptop, HP Envy 13. That’s why I describe hints below which could help you to achieve the same. I say hints, because I don’t remember exact steps and I don’t want to remove everything again 🙂

1.Start with mesa OpenGL libraries for integrated Intel graphics card. Make sure that you install it correctly and it works. I mainly used glmark2 to verify my video drivers. With integrated Intel graphics output should look something like that:

$ glmark2 ======================================================= glmark2 2017.07 ======================================================= OpenGL Information GL_VENDOR: Intel Open Source Technology Center GL_RENDERER: Mesa DRI Intel(R) UHD Graphics 620 (Kabylake GT2) GL_VERSION: 3.0 Mesa 18.3.1 ======================================================= [build] use-vbo=false: FPS: 758 FrameTime: 1.319 ms [build] use-vbo=true: FPS: 780 FrameTime: 1.282 ms ======================================================= glmark2 Score: 769 ======================================================= 

2.Per Jan 12 2019: do not install Nvidia drivers from default Void Linux repository. If you try to install Bumblebee (for Optimus) with Nvidia drivers and libraries, it would remove mesa libraries and Nvidia becomes your default graphics without an option to switch back to Intel integrated graphics.

Читайте также:  Linux отключить автозапуск nginx

3.Install Nvidia kernel module only (without Nvidia libraries). Download Nvidia libraries manually. You could do it either from official website Nvidia libraries or from Void Linux repository.

4.Extract Nvidia libraries into a separate folder. I have used the blob from Nvidia website with the following parameters:

$ ./nvidia-installer --x-prefix=/opt --x-module-path=/opt/lib/xorg/modules \ --x-library-path=/opt/lib --x-sysconfig-path=/opt/share/X11 --opengl-prefix=/opt \ --compat32-prefix=/opt --compat32-libdir=lib32 --utility-prefix=/opt --documentation-prefix=/opt \ --application-profile-path=/opt/share/nvidia 

It installs Nvidia libraries into /opt directory for x86_64 and x64 architectures. I had to play with —no-opengl-files parameters in order not to overwrite system (mesa) OpenGL libraries.

5.By that step you should have working mesa OpenGL, Nvidia kernel module and Nvidia libraries in /opt directory.

6.Install bbswitch kernel module to enable/disable discrete graphics.

7.Clone nvidia-xrun script. It starts a separate X session with Nvidia graphics enabled.

8.Create file /etc/X11/nvidia-xorg.conf

Section "Files" ModulePath "/opt/lib32" ModulePath "/opt/lib" ModulePath "/opt/lib32/vdpau" ModulePath "/opt/lib/vdpau" ModulePath "/opt/lib/xorg/modules" ModulePath "/opt/lib/xorg/modules/drivers" ModulePath "/opt/lib/xorg/modules/extensions" ModulePath "/opt/lib/tls" ModulePath "/usr/lib/xorg/modules" EndSection Section "Module" Load "modesetting" EndSection Section "Device" Identifier "nvidia" Driver "nvidia" # Use lspci to find proper BusID BusID "PCI:1:0:0" Option "AllowEmptyInitialConfiguration" EndSection 

9.Copy nvidia-xrun/nvidia-xinitrc to /etc/X11/xinit/nvidia-xinitrc .

10.Specify which window manager or a program to start with Nvidia enabled. For that create file ~/.nvidia-xinitrc

if [ $# -gt 0 ]; then $* else xrandr --setprovideroutputsource modesetting NVIDIA-0 xrandr --auto xrandr --dpi 96 # use your own window manager exec mate-session fi 

11.Modify nvidia-xrun (probably can be done in /etc/X11/xinit/nvidia-xinitrc as well) to add /opt/lib (or /opt/lib32 for x86) to dynamic loader when starting new Nvidia X session:

diff --git a/nvidia-xrun b/nvidia-xrun old mode 100644 new mode 100755 index 39b1b94..6153811 --- a/nvidia-xrun +++ b/nvidia-xrun @@ -69,6 +69,9 @@ EXECL="/etc/X11/xinit/nvidia-xinitrc $EXECL" COMMAND="xinit $EXECL -- $NEWDISP vt$LVT -nolisten tcp -br -config nvidia-xorg.conf -configdir nvidia-xorg.conf.d" +echo "adding /opt/lib to ldconfig" +execute "sudo ldconfig /opt/lib" + # --------- TURNING ON GPU ----------- echo 'Waking up nvidia GPU' if ! [ -f /proc/acpi/bbswitch ] @@ -117,3 +120,6 @@ then else echo "Bbswitch kernel module not loaded." fi + +echo "removing /opt/lib to ldconfig" +execute "sudo ldconfig" 

12.Switch to tty1 (with Ctrl+Alt+F1) and run nvidia-xrun . Verify with glmark2 that Nvidia graphics is used:

$ glmark2 ======================================================= glmark2 2017.07 ======================================================= OpenGL Information GL_VENDOR: NVIDIA Corporation GL_RENDERER: GeForce MX150/PCIe/SSE2 GL_VERSION: 4.6.0 NVIDIA 410.78 ======================================================= [build] use-vbo=false: FPS: 1668 FrameTime: 0.600 ms ======================================================= glmark2 Score: 1668 ======================================================= 

13.To see whether Nvidia graphics cards is turned on or turned off you could run cat /proc/acpi/bbswitch . In daily life when Nvidia is not used you should see something similar to

You might need to blacklist nouveau module to avoid conflicts with Nvidia module. For that create a file /etc/modprobe.d/blacklist-nouveau.conf

You could also blacklist Nvidia kernel modules by default.

As far as I remember I had to manually remove /opt/lib/xorg/modules/libwfb.so library.

Источник

Оцените статью
Adblock
detector