summaryrefslogtreecommitdiff
path: root/content/bsd/thinkpad/freebsd-configuring-nvidia-and-xorg-on-thinkpad-x1-extreme-g2.md
diff options
context:
space:
mode:
authormms <michal@sapka.me>2023-11-08 22:15:17 +0100
committermms <michal@sapka.me>2023-11-08 22:15:17 +0100
commit0088ff1fd2c63e252ff5efe495f22157cc191109 (patch)
treed3f4b01a93dbaeec152f68b58abbc771d2a883c2 /content/bsd/thinkpad/freebsd-configuring-nvidia-and-xorg-on-thinkpad-x1-extreme-g2.md
parent9d83a868da2b5db82efc3edda06448a3aa6c48b9 (diff)
feat: move bsd files
Diffstat (limited to 'content/bsd/thinkpad/freebsd-configuring-nvidia-and-xorg-on-thinkpad-x1-extreme-g2.md')
-rw-r--r--content/bsd/thinkpad/freebsd-configuring-nvidia-and-xorg-on-thinkpad-x1-extreme-g2.md73
1 files changed, 73 insertions, 0 deletions
diff --git a/content/bsd/thinkpad/freebsd-configuring-nvidia-and-xorg-on-thinkpad-x1-extreme-g2.md b/content/bsd/thinkpad/freebsd-configuring-nvidia-and-xorg-on-thinkpad-x1-extreme-g2.md
new file mode 100644
index 0000000..68254d0
--- /dev/null
+++ b/content/bsd/thinkpad/freebsd-configuring-nvidia-and-xorg-on-thinkpad-x1-extreme-g2.md
@@ -0,0 +1,73 @@
+---
+title: "FreeBSD: configuring NVIDIA and Xorg on Thinkpad X1 Extreme G2"
+category: bsd
+abstract: A tutorial for making Nvidia work on FreeBSD
+date: 2023-03-04T04:40:17+01:00
+year: 2023
+draft: false
+tags:
+- FreeBSD
+- NVIDIA
+- XOrg
+- tutorial
+---
+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
+
+1. Configuration
+2. Display
+3. Graphics Device
+4. select `Discrete Graphics`
+
+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.
+
+```
+# nvidia-xconfig
+```
+
+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:
+
+```
+vgapci0@pci0:1:0:0
+```
+
+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).
+>
+> [xorg documentation](https://www.x.org/releases/X11R7.7/doc/man/man5/xorg.conf.5.xhtml#heading10)
+
+Open `/etc/X11/xorg.conf`, look for `Section "Device"` and add:
+
+```
+BusID "PCI:1:0:0"
+```
+
+In my case, everything worked fine after that.
+
+Notes:
+
+I learned the BUS trick from [Nude Systems](https://nudesystems.com/how-to-fix-no-screen-found-xorg-error-on-freebsd/)
+