This is Gentoo's testing wiki. It is a non-operational environment and its textual content is outdated.

Please visit our production wiki at https://wiki.gentoo.org

User:Kreyren/NVIDIA OPTIMUS INSTALL LOG

From Gentoo Wiki (test)
Jump to:navigation Jump to:search

This shajt ain't working and i'm losing my mind over it on vacation..

Hardware:
https://www.asus.com/us/ROG-Republic-Of-Gamers/ROG-G750JS/specifications/

Me crying

1. Look at the Nvidia page on wiki https://wiki.gentoo.org/wiki/NVidia

2. Find out that Open-source drivers are for plebs so you use Nvidia closed-source.

3. https://wiki.gentoo.org/wiki/NVidia/nvidia-drivers#Hardware_compatibility my driver is not legacy so i don't need to `Masking drivers with version higher than 174`

4. On gentoo x11-drivers/nvidia-drivers package is used to get closed source Nvidia drivers.

Kernel Configuration

5. Kernel Enable loadable module support is included
MTRR (Memory Type Range Register) support is included
VGA Arbitration is included
IPMI top-level message handleris included
/dev/agpgart (AGP Support) is not configured my system doesnt have it i believe.

KERNEL Disable support for the in-kernel driver.. IS SET
Device Drivers --->
    Graphics support --->
        Frame buffer Devices --->
            <*> Support for frame buffer devices --->
            < >   nVidia Framebuffer Support
            < >   nVidia Riva support
KERNEL IS SET
Device Drivers  --->
    Graphics support  --->
        < > Nouveau (nVidia) cards

For (U)EFI systems, uvesafb will not work.

.config has:

# causes intermittent problems with the initialization of the NVIDIA drivers. There is no known alternative framebuffer for (U)EFI systems. https://wiki.gentoo.org/wiki/NVidia/nvidia-drivers
CONFIG_FB_EFI=n

6. kernel 4.19.0 is used

stub title

7. VIDEO_CARDS="nvidia" is in make.conf

8. zgrep "CONFIG_MODULES=" /proc/config.gz outputs CONFIG_MODULES=y

9. /etc/modules-load.d/nvidia.conf contains nvidia

10. rc-update add modules boot outputs * rc-update: modules already installed in runlevel `boot'; skipping.

11. /usr/share/doc/nvidia-drivers-343.36/README.bz2 is not present less /usr/share/doc/nvidia-drivers-343.36/README.bz2 outputs sh: /bin/zsh: No such file or directory /usr/share/doc/nvidia-drivers-343.36/README.bz2: No such file or directory

Added https://wiki.gentoo.org/index.php?title=NVIDIA/Optimus&diff=744026&oldid=744000

12. http://us.download.nvidia.com/XFree86/Linux-x86_64/343.36/README/optimus.html is useless.

13. http://us.download.nvidia.com/XFree86/Linux-x86_64/343.36/README/randr14.html


Required kernel modules?
CONFIG_DRM=y == Found in /usr/src/linux/.config.
drm_gem_prime_export == Not found in /usr/src/linux/.config.
drm_gem_prime_import == Not found in /usr/src/linux/.config.
gem_prime_pin == Not found in /usr/src/linux/.config.
gem_prime_get_sg_table == Not found in /usr/src/linux/.config.
gem_prime_import_sg_table == Not found in /usr/src/linux/.config.
gem_prime_vmap == Not found in /usr/src/linux/.config.
gem_prime_vunmap == Not found in /usr/src/linux/.config.

/etc/X11/xorg.conf has:

Section "ServerLayout"
    Identifier "layout"
    Screen 0 "nvidia"
    Inactive "intel"
EndSection

Section "Device"
    Identifier "nvidia"
    Driver "nvidia"
    BusID "01:00.0"
EndSection

Section "Screen"
    Identifier "nvidia"
    Device "nvidia"
    Option "AllowEmptyInitialConfiguration"
EndSection

Section "Device"
    Identifier "intel"
    Driver "modesetting"
EndSection

Section "Screen"
    Identifier "intel"
    Device "intel"
EndSection

EDID

I have no idea what EDID is.. Google+Wiki is not helpful.

Ensure the currently running kernel has CONFIG_I2C_CHARDEV enabled and the resulting i2c-dev module loaded or compiled monolithically for read-edid to work. -- https://wiki.gentoo.org/wiki/NVIDIA/Optimus#Using_a_specific_monitor_via_EDID

  1. CONFIG_I2C_CHARDEV is not set >> CONFIG_I2C_CHARDEV=y

and the resulting i2c-dev module loaded or compiled monolithically for read-edid to work. -- https://wiki.gentoo.org/wiki/NVIDIA/Optimus#Using_a_specific_monitor_via_EDID

No idea what that means.. Added stub to wiki entry.

Some laptops/notebooks may benefit from saving the EDID screen information to a file so it can be passed to the Intel modesetting driver. The EDID information can be saved using the read-edid utility. -- https://wiki.gentoo.org/wiki/NVIDIA/Optimus#Using_a_specific_monitor_via_EDID

Invoked emerge --ask x11-misc/read-edid i guess?

[ebuild R ] x11-misc/read-edid-3.0.2

Emerged..

/lib/firmware/edid/ is not present can't invoke get-edid > /lib/firmware/edid/1920x1080_Clevo_W670SR.bin as mensioned on https://wiki.gentoo.org/wiki/NVIDIA/Optimus#Saving_the_monitor.27s_EDID.

/etc/default/grub has

# Append parameters to the linux kernel command line for non-recovery entries
GRUB_CMDLINE_LINUX_DEFAULT="drm_kms_helper.edid_firmware=edid/1920x1080_clevo_W670SR.bin"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal.
# Note that you can use only modes which your graphic card supports via VBE.
# You can see them in real GRUB with the command `vbeinfo'.
GRUB_GFXMODE=1920x1080

EDID Xorg.conf

EDID Xorg.conf Example https://wiki.gentoo.org/wiki/NVIDIA/Optimus/EDID_Xorg.conf_Example

I have no !@#$% idea what to do with it..

Before starting X

xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto

is required.. added to /home/kreyren/.xinitrc

NOTE: If you get a black screen with no back-lighting from the previous steps, creating .xsessionrc and placing the xinitrc commands in there COULD fix it.

Use the xrandr command to find the appropriate graphics device: root #xrandr --listproviders

Noted..

Display manager configuration

Added CONFIG_PROTECT="/usr/share/sddm/scripts/Xsetup" to make.conf

Qingy

WTF is Quingy..

Emerging Quingy

[ebuild  N     ] x11-libs/libXScrnSaver-1.2.3  USE="-static-libs" ABI_X86="(64) -32 (-x32)" 
[ebuild  N     ] sys-apps/qingy-1.0.0-r4  USE="X crypt pam -consolekit -emacs -gpm -opensslcrypt -static" 

https://wiki.gentoo.org/wiki/NVIDIA/Optimus#Qingy_DirectFB

lspci | grep Intel outputs:

00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor DRAM Controller (rev 06)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor PCI Express x16 Controller (rev 06)
00:02.0 VGA compatible controller: Intel Corporation 4th Gen Core Processor Integrated Graphics Controller (rev 06)
00:03.0 Audio device: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller (rev 06)
00:14.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB xHCI (rev 05)
00:16.0 Communication controller: Intel Corporation 8 Series/C220 Series Chipset Family MEI Controller #1 (rev 04)
00:1a.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #2 (rev 05)
00:1b.0 Audio device: Intel Corporation 8 Series/C220 Series Chipset High Definition Audio Controller (rev 05)
00:1c.0 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #1 (rev d5)
00:1c.2 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #3 (rev d5)
00:1c.3 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #4 (rev d5)
00:1c.4 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #5 (rev d5)
00:1d.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #1 (rev 05)
00:1f.0 ISA bridge: Intel Corporation HM87 Express LPC Controller (rev 05)
00:1f.2 SATA controller: Intel Corporation 8 Series/C220 Series Chipset Family 6-port SATA Controller 1 [AHCI mode] (rev 05)
00:1f.3 SMBus: Intel Corporation 8 Series/C220 Series Chipset Family SMBus Controller (rev 05)
03:00.0 Network controller: Intel Corporation Wireless 7260 (rev 73)

WHAT IS `Intel graphics card` ffs.

00:02.0 VGA compatible controller: Intel Corporation 4th Gen Core Processor Integrated Graphics Controller (rev 06) ?!

Added as https://wiki.gentoo.org/index.php?title=NVIDIA/Optimus&diff=744062&oldid=744060 NEEDS VERIFICATION!!

/etc/directfbrc has busid=0:02:0

The Console Display Manager (CDM)

I have no idea what is it and how it is related..

Emerging x11-misc/cdm

[ebuild  N     ] dev-util/dialog-1.3.20180621  USE="nls unicode -examples -minimal -static-libs" 
[ebuild  N     ] x11-libs/libXtst-1.2.3-r1  USE="-doc -static-libs" ABI_X86="(64) -32 (-x32)" 
[ebuild  N     ] x11-apps/xdpyinfo-1.3.2  USE="-dga -dmx -xinerama" 
[ebuild  N     ] x11-misc/cdm-0.7  USE="pam -consolekit" 


"Add the xrandr commands to ~/.xinitrc file:" -- https://wiki.gentoo.org/wiki/NVIDIA/Optimus#The_Console_Display_Manager_.28CDM.29

Why?.. added..

X Display Manager (XDM)

Seems important?

"Add the xrandr commands to the /usr/lib/X11/xdm/Xsetup_0 file" -- https://wiki.gentoo.org/wiki/NVIDIA/Optimus#X_Display_Manager_.28XDM.29

WHAT XRANDR COMMANDS?!

Give up.. making gentoo forum entry. https://forums.gentoo.org/viewtopic-p-8275276.html#8275276

Issues

using dwm after startx is invoked the tty returns following error:
Xorg Log https://paste.pound-python.org/show/LTZ5vZoUVKPzc5iOXwaQ/

Noticed that nvidia-drivers didn't pull the USEFlags.. emerging (special thanks to Mysic on IRC)

New result https://imgur.com/a/anRIyBh

none wants to help me trying to downgrade to stable.

https://paste.pound-python.org/show/a1P398NgvFtOQ6SWiSWy/ - Permission is correct?

Suspect bug..

Created bug #669826

Give up for today.. spend 3 days with it so far.