A rough overview of using Nvidia Optimus on FreeBSD.

New approach (as of 2018.03.11)

Run x11/virtualgl from ports and the rest should work.

Old approach

:!: as of 20180715, gcc47 has been removed. The following will no longer work.

Initial port/PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=192617

Section "ServerLayout"
    Identifier "Layout0"
    Option "AutoAddDevices" "false"
    InputDevice "fake" "CorePointer"
EndSection
Section "Device"
    Identifier "Device1"
    Driver "nvidia"
    VendorName "NVIDIA Corporation"
    BusID "PCI:01:00:0"
    Option "NoLogo" "true"
    Option "UseEDID" "false"
    Option "ConnectedMonitor" "DFP"
EndSection

Section "InputDevice"
	Identifier "fake"
	Driver ""
EndSection