# xorg.conf for use with NVidia binary driver and
# Optimus PRIME with proper synchronization.
# This config actually works, but needs a X-Server 1.19
# or later, compiled with --enable-glamor
#
# You must set the BusID to the PCI Id of your Intel
# graphics chip in the "Device" intel section, and to
# the PCI Id of your NVidia gpu in the "Device" nvidia
# section. A way to get these id's is to execute:
#
# grep PCI /usr/local/var/log/Xorg.0.log
#
# The output will look something like:
# [ 15545.440] (--) PCI:*(0:0:2:0) 8086:0a16:17aa:380d rev 11, Mem @ 0xc3000000/4194304, 0xd0000000/268435456, I/O @ 0x00006000/64, BIOS @ 0x????????/131072
# [ 15545.440] (--) PCI: (0:3:0:0) 10de:1341:17aa:380d rev 162, Mem @ 0xc2000000/16777216, 0xb0000000/268435456, 0xc0000000/33554432, I/O @ 0x00003000/128
#
# Note the PCI Id with the *, and the 8096 ie. PCI:*(0:0:2:0) 8086
# The last three numbers in (0:0:2:0) translate into PCI:0:2:0 below
# for the intel card.
#
# The other PCI Id without *, but with the 10de, ie. PCI: (0:3:0:0) 10de
# the last three numbers in (0:3:0:0) translate into PCI:3:0:0 for the
# nvidia card.
#
# 1. Edit this files BusID entries accordingly (see above).
# 2. Copy this to /etc/X11/xorg.conf
# 3. Logout/Login again, or reboot.
#

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

Section "Device"
    Identifier     "intel"
    Driver         "modesetting"
    Option         "AccelMethod" "none"
    BusID          "PCI:0:2:0"
EndSection

Section "Device"
    Identifier     "nvidia"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BusID          "PCI:3:0:0"
    Option         "AllowEmptyInitialConfiguration"
EndSection

Section "Screen"
    Identifier     "nvidia"
    Device         "nvidia"
EndSection
