FreeBSD: configuring NVIDIA and Xorg on Thinkpad X1 Extreme G2
First, the bad news: I could not make FreeBSD work with Hybrid Graphics, so I use only the discrete one. To ensure this, open BIOS and
- Graphics Device
Then, log in as root and install the drivers:
# pkg install nvidia-driver nvidia-xconfig
The next step is to enable the drivers.
# sysrc kld_list+=nvidia # sysrc kld_list+=nvidia-modeset
Some people advise adding Linux (
# sysrc kld_list+=linux) to kld_list, but I got my GPU working without that.
After that, either load the drivers manually or give the computer an old, good reboot.
Login as root again and use the NVIDIA configurator to get Xorg configured.
Then try starting your desktop environment, windows manager, or startx. You may be done, but I got an error about
Screen not found. Tell Xorg where the NVIDIA GPU is if you have the same problem. Try probing the system for GPUs
# pciconf -l | grep vga
You will see one on more elements on the list. The critical part is in the first column, for example:
Our GPU is available under BUS 1:0:0 (we skip the first 0). You may need to try different elements from the list.
For PCI/AGP cards, the bus−id string has the form PCI:bus:device:function (e.g., “PCI:1:0:0” might be appropriate for an AGP card).
/etc/X11/xorg.conf, look for
Section "Device" and add:
In my case, everything worked fine after that.
I learned the BUS trick from Nude Systems