[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
howtos:hardware:nvidia_optimus [2014/05/12 13:57 (UTC)] – tommyc | howtos:hardware:nvidia_optimus [2020/12/24 22:57 (UTC)] (current) – Add section on new official Optimus support with proprietary driver; update intro and sources accordingly poprocks | ||
---|---|---|---|
Line 1: | Line 1: | ||
<!-- Reviewed 20130114 by hazel --> | <!-- Reviewed 20130114 by hazel --> | ||
====== Nvidia Optimus ====== | ====== Nvidia Optimus ====== | ||
- | Some newer laptops nowadays come with what is known as " | ||
- | Despite this disappointment, there is an open source project called Bumblebee that aims to fix this problem. | + | Some laptops come with what is known as " |
+ | |||
+ | Historically, there has been an open-source project called Bumblebee that has aimed to fix this problem. Bumblebee | ||
< | < | ||
Line 13: | Line 14: | ||
</ | </ | ||
- | ==== X11 and Other Programs without Bumblebee | + | ==== Note: The Intel Driver is Often Sufficient |
- | You do NOT need to use Bumblebee in order to use X11, KDE, Compiz-Fusion, | + | |
- | If you still wish to use Bumblebee to switch between the nVidia GPU and the Intel GPU, read on. We just wanted to clarify that Intel' | + | You do //not// need to use Optimus via Bumblebee or the nvidia proprietary driver in order to use modern applications and desktop environments under X11. The Intel graphics often provide sufficient 2D and 3D acceleration for those programs to work smoothly without having to use the nVidia GPU. If you still wish to use Bumblebee to switch between the nVidia GPU and the Intel GPU, read on. We just wanted to clarify that Intel' |
==== Installing Bumblebee ==== | ==== Installing Bumblebee ==== | ||
---- | ---- | ||
+ | === The Automated Way === | ||
+ | There is a new, automated way of installing Bumblebee thanks to Slacker: Ryan McQuen. | ||
+ | <note warning> | ||
+ | If you have modified the SlackBuilds in any way, this script may not be for you.</ | ||
+ | |||
+ | You can run this as root: | ||
+ | < | ||
+ | curl https:// | ||
+ | </ | ||
+ | |||
+ | Alternatively you can download the script and run it as root on your system directly. | ||
+ | |||
+ | This script detects multilib, creates the necessary group, adds users and applies the necessary / | ||
+ | |||
+ | < | ||
+ | curl https:// | ||
+ | </ | ||
+ | |||
+ | It also uses upgradepkg' | ||
+ | === The Manual Way === | ||
=== Getting the SlackBuilds === | === Getting the SlackBuilds === | ||
A fellow Slacker, jgeboski, originally provided SlackBuilds that mostly follow the [[http:// | A fellow Slacker, jgeboski, originally provided SlackBuilds that mostly follow the [[http:// | ||
Line 77: | Line 97: | ||
< | < | ||
</ | </ | ||
+ | |||
+ | === Primus === | ||
+ | Primus, like optirun (instructions below) can be used to run your desired program via bumblebee. Primus also comes with a COMPAT32 option as well. | ||
+ | |||
+ | <note warning> | ||
+ | If you are using Slackware 14.0 or older you need to rebuild mesa. The new github repository does not offer a SlackBuild for mesa to support Slackware 14.0 or older. Therefore you must use Slackware 14.1 or newer, or rebuild mesa manually with a different script. One can choose to use the old repository and simply update the SlackBuild script appropriately, | ||
+ | < | ||
+ | # # For the old repository, one would have done: | ||
+ | # cd ../mesa | ||
+ | # ./ | ||
+ | </ | ||
+ | mesa does not have a COMPAT32 option because it is an official Slackware package, but you can easily create the compat32 package after creating the original package by using: | ||
+ | < | ||
+ | # ./ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | 1. Build and install: primus | ||
+ | < | ||
+ | # cd ../primus | ||
+ | # ./ | ||
+ | # upgradepkg --install-new primus-*.t? | ||
+ | </ | ||
+ | < | ||
+ | # COMPAT32=yes ./ | ||
+ | </ | ||
=== VirtualGL === | === VirtualGL === | ||
+ | VirtualGL provides support for optirun that also allows one to run programs via bumblebee. However, it is recommended that one uses primusrun for a few reasons. | ||
<note warning> | <note warning> | ||
Although VirtualGL (and its dependency libjpeg-turbo) are still supported by the Bumblebee project and maintained by their developers, the new github repo does not include SlackBuild scripts for these packages. This section is for the old github repository that was once maintained by jgeboski. If you would like to use VirtualGL (e.g. you're in one of the rare cases where VirtualGL provides better performance than primus) then you can use your own personal SlackBuilds or the old ones (although the old SlackBuilds will be out-of-date). | Although VirtualGL (and its dependency libjpeg-turbo) are still supported by the Bumblebee project and maintained by their developers, the new github repo does not include SlackBuild scripts for these packages. This section is for the old github repository that was once maintained by jgeboski. If you would like to use VirtualGL (e.g. you're in one of the rare cases where VirtualGL provides better performance than primus) then you can use your own personal SlackBuilds or the old ones (although the old SlackBuilds will be out-of-date). | ||
Line 106: | Line 153: | ||
< | < | ||
# COMPAT32=yes ./ | # COMPAT32=yes ./ | ||
- | </ | ||
- | |||
- | === Primus === | ||
- | Primus is another program designed to be used much like optirun. However, primus does not require VirtualGL (and therefore will not require libjpeg-turbo as well) but only requires mesa with %%--%%enable-shared-glapi (Slackware 14.0 and below must have mesa rebuilt). Primus also comes with a COMPAT32 option as well. | ||
- | |||
- | <note warning> | ||
- | The new github repository does not offer a SlackBuild for mesa to support Slackware 14.0 or older. Therefore you must use Slackware 14.1 or newer, or rebuild mesa manually with a different script. One can choose to use the old repository and simply update the SlackBuild script appropriately, | ||
- | < | ||
- | # # For the old repository, one would have done: | ||
- | # cd ../mesa | ||
- | # ./ | ||
- | </ | ||
- | mesa does not have a COMPAT32 option because it is an official Slackware package, but you can easily create the compat32 package after creating the original package by using: | ||
- | < | ||
- | # ./ | ||
- | </ | ||
- | </ | ||
- | |||
- | 1. Build and install: primus | ||
- | < | ||
- | # cd ../primus | ||
- | # ./ | ||
- | # upgradepkg --install-new primus-*.t? | ||
- | </ | ||
- | < | ||
- | # COMPAT32=yes ./ | ||
</ | </ | ||
Line 137: | Line 158: | ||
If you want to use the nVidia proprietary drivers, you must not use nouveau, as the drivers interfere with each other. This can be prevented by removing nouveau, installing xf86-video-nouveau-blacklist from /extra, or blacklisting nouveau manually. | If you want to use the nVidia proprietary drivers, you must not use nouveau, as the drivers interfere with each other. This can be prevented by removing nouveau, installing xf86-video-nouveau-blacklist from /extra, or blacklisting nouveau manually. | ||
- | < | ||
This part is entirely optional. Slackware 13.37 and above comes with xf86-video-nouveau, | This part is entirely optional. Slackware 13.37 and above comes with xf86-video-nouveau, | ||
Line 144: | Line 164: | ||
</ | </ | ||
- | 1. Build and install: libvdpau | + | < |
< | < | ||
# cd ../libvdpau | # cd ../libvdpau | ||
Line 150: | Line 170: | ||
# upgradepkg --install-new libvdpau-*.t? | # upgradepkg --install-new libvdpau-*.t? | ||
</ | </ | ||
+ | </ | ||
- | 2. Build and install: nvidia-bumblebee | + | 1. Build and install: nvidia-bumblebee |
<code sh> | <code sh> | ||
# cd ../ | # cd ../ | ||
Line 161: | Line 182: | ||
</ | </ | ||
- | 3. Build and install: nvidia-kernel | + | 2. Build and install: nvidia-kernel |
<code sh> | <code sh> | ||
# cd ../ | # cd ../ | ||
Line 167: | Line 188: | ||
# upgradepkg --install-new nvidia-kernel-*.t? | # upgradepkg --install-new nvidia-kernel-*.t? | ||
</ | </ | ||
- | < | ||
- | # COMPAT32=yes ./ | ||
- | </ | ||
- | </ | ||
==== Post-Installation ==== | ==== Post-Installation ==== | ||
Excellent. Now we're ready to do some post-installation setup. The bumblebee package provided us with an rc.bumblebee script in /etc/rc.d where the other startup scripts are also located. Remember to make this script executable and, if you so desire, start it! | Excellent. Now we're ready to do some post-installation setup. The bumblebee package provided us with an rc.bumblebee script in /etc/rc.d where the other startup scripts are also located. Remember to make this script executable and, if you so desire, start it! | ||
Line 220: | Line 237: | ||
Module=nouveau | Module=nouveau | ||
</ | </ | ||
+ | |||
+ | ==== Official Optimus Support with the nVidia Proprietary Driver ==== | ||
+ | ---- | ||
+ | === Note === | ||
+ | |||
+ | This will //not// work with Slackware 14.2 or any stable version of Slackware, as at the time of writing. Slackware Current is required. | ||
+ | |||
+ | === Dependencies/ | ||
+ | |||
+ | **//From main -current tree://** | ||
+ | |||
+ | * '' | ||
+ | |||
+ | Do not try this with older versions - it will //not// work. Certain specific git commits are required to have been added to xorg-server; | ||
+ | |||
+ | * '' | ||
+ | |||
+ | Patrick Volkerding recently changed ' | ||
+ | |||
+ | The one with the package-name ' | ||
+ | |||
+ | **//From SlackBuilds.org:// | ||
+ | |||
+ | * '' | ||
+ | |||
+ | Build normally. I got a gcc mismatch error as I am using a kernel that is quite old. I was able to override it successfully by adding the environment variable spouted out by the nvidia installer during the build process when it failed the first time. YMMV. For best results, build nvidia-kernel using the same version of gcc that was used to build the kernel itself. | ||
+ | |||
+ | * '' | ||
+ | |||
+ | Be sure to build with '' | ||
+ | |||
+ | === Next Steps === | ||
+ | |||
+ | Once you have the packages listed above installed, I would recommend rebooting. | ||
+ | |||
+ | I would also recommend changing your runlevel to 3 if it is currently 4. | ||
+ | |||
+ | Once you have rebooted into runlevel 3, ensure that the '' | ||
+ | |||
+ | < | ||
+ | $ lsmod |grep nvidia_drm | ||
+ | </ | ||
+ | |||
+ | As root, add the following to ''/ | ||
+ | |||
+ | < | ||
+ | # cat << EOF > / | ||
+ | Section " | ||
+ | Identifier " | ||
+ | Option " | ||
+ | Screen 0 " | ||
+ | EndSection | ||
+ | |||
+ | Section " | ||
+ | Identifier " | ||
+ | Driver " | ||
+ | EndSection | ||
+ | |||
+ | Section " | ||
+ | Identifier " | ||
+ | Device " | ||
+ | EndSection | ||
+ | |||
+ | Section " | ||
+ | Identifier " | ||
+ | Driver " | ||
+ | EndSection | ||
+ | EOF | ||
+ | </ | ||
+ | |||
+ | Note that the official nVidia documentation seems to indicate you only need the following: | ||
+ | |||
+ | < | ||
+ | Section " | ||
+ | Identifier " | ||
+ | Option " | ||
+ | EndSection | ||
+ | </ | ||
+ | |||
+ | However, for me this has //not// worked. YMMV. It is possible that, in the future, a more minimal configuration will in fact work. It is suggested that this be monitored at this time. As is often the case with Xorg configuration, | ||
+ | |||
+ | Next, launch your xserver. | ||
+ | |||
+ | If GPU screen creation was successful, the log file ''/ | ||
+ | |||
+ | If that is the case, the following command: | ||
+ | |||
+ | < | ||
+ | $ __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia glxinfo |grep ' | ||
+ | </ | ||
+ | |||
+ | should display: | ||
+ | |||
+ | < | ||
+ | OpenGL vendor string: NVIDIA Corporation | ||
+ | </ | ||
+ | |||
+ | and the following command: | ||
+ | |||
+ | < | ||
+ | $ glxinfo |grep ' | ||
+ | </ | ||
+ | |||
+ | should display your integrated GPU's vendor as opposed to NVIDIA (e.g., Intel). | ||
+ | |||
+ | You can then test using something like: | ||
+ | |||
+ | < | ||
+ | $ __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia glxgears | ||
+ | </ | ||
+ | |||
+ | You can now launch any program using your Nvidia dGPU by utilizing those two environment variables and prepending them to the program command you are running. I would refrain from using the GUI tools that come with nvidia-driver. | ||
+ | |||
+ | As per usual, YMMV. | ||
+ | |||
+ | === Known Issues === | ||
+ | |||
+ | BrokenCog on IRC has reported that this setup may not work with external monitors. | ||
+ | |||
+ | Again, as indicated above, we are working as a community to find out what the abolute minimum manual xorg.conf settings are in order to just get Optimus working. As per usual with xorg settings nowadays, the less you can get away with manually specifying, the better. The xorg server works best when it can just do its own autoconfig to the largest extent possible, in my experience. | ||
+ | |||
+ | Do //not// try to run applications by setting '' | ||
==== FAQ That Google Might not Answer ==== | ==== FAQ That Google Might not Answer ==== | ||
Line 257: | Line 396: | ||
* New SlackBuilds: | * New SlackBuilds: | ||
* Originally written by [[wiki: | * Originally written by [[wiki: | ||
+ | * Section on official Optimus support by the nvidia proprietary driver contributed by [[wiki: | ||
<!-- Please do not modify anything below, except adding new tags.--> | <!-- Please do not modify anything below, except adding new tags.--> | ||
{{tag> | {{tag> | ||
+ |