# FreeBSD 13 Intel IGP driver setup



## Andras83 (Oct 29, 2021)

Hi,

 I have bought an ASUS laptop with Intel Silver N6000 (Jesper Lake) CPU and made a fresh installation of FreeBSD 13 on it, but I cannot get the X Window System working.
The user which starts X is part of the "*video*" group, though I don't think it matters at this stage. 
Xorg startup fails with: "*open /dev/dri/card0: No such file or directory*" (see attached logs)
Can someone help me?


```
# uname -a
FreeBSD  13.0-RELEASE-p4 [B]FreeBSD 13.0[/B]-RELEASE-p4 #0: Tue Aug 24 07:33:27 UTC 2021     [email]root@amd64-builder.daemonology.net[/email]:/usr/obj/usr/src/amd64.amd64/sys/GENERIC  amd64
```


```
# kldstat
Id Refs Address                Size Name
 1   54 0xffffffff80200000  1f11f28 kernel
 2    1 0xffffffff82112000    1abe8 geom_eli.ko
 3    1 0xffffffff8212d000     ae38 cryptodev.ko
 4    1 0xffffffff82138000   67feb0 zfs.ko
 5    1 0xffffffff82ae5000   158458 i915kms.ko
 6    1 0xffffffff82c3e000    7f548 drm.ko[/B]
 7    2 0xffffffff82cbe000     cbc8 linuxkpi_gplv2.ko
 8    2 0xffffffff82ccb000     2328 lindebugfs.ko
 9    1 0xffffffff82cce000     3378 acpi_wmi.ko
10    1 0xffffffff82cd2000     4b60 ng_ubt.ko
11    3 0xffffffff82cd7000     aac8 netgraph.ko
12    2 0xffffffff82ce2000     a238 ng_hci.ko
13    1 0xffffffff82ced000     25a8 ng_bluetooth.ko
14    1 0xffffffff82cf0000     2a08 mac_ntpd.ko
```
`kldstat -h -v -n i915kms`

```
Id Refs Address             Size Name
 5    1 0xffffffff82ae5000  1.3M i915kms.ko (/boot/modules/i915kms.ko)
    Contains modules:
         Id Name
        504 i915kms
```
`pkg which /boot/modules/i915kms.ko`

```
/boot/modules/i915kms.ko was installed by package drm-fbsd13-kmod-5.4.144.g20211013
```
`pciconf -lv`

```
hostb0@pci0:0:0:0:    class=0x060000 rev=0x00 hdr=0x00 vendor=0x8086 device=0x4e26 subvendor=0x1043 subdevice=0x1792
    vendor     = 'Intel Corporation'
    class      = bridge
    subclass   = HOST-PCI
vgapci0@pci0:0:2:0:    class=0x030000 rev=0x01 hdr=0x00 vendor=0x8086 device=0x4e71 subvendor=0x1043 subdevice=0x1792
    vendor     = 'Intel Corporation'
    device     = 'JasperLake [UHD Graphics]'
    class      = display
    subclass   = VGA
none0@pci0:0:4:0:    class=0x118000 rev=0x00 hdr=0x00 vendor=0x8086 device=0x4e03 subvendor=0x1043 subdevice=0x1792
    vendor     = 'Intel Corporation'
    device     = 'Dynamic Tuning service'
    class      = dasp
none1@pci0:0:8:0:    class=0x088000 rev=0x00 hdr=0x00 vendor=0x8086 device=0x4e11 subvendor=0x1043 subdevice=0x1792
    vendor     = 'Intel Corporation'
    class      = base peripheral
xhci0@pci0:0:20:0:    class=0x0c0330 rev=0x01 hdr=0x00 vendor=0x8086 device=0x4ded subvendor=0x1043 subdevice=0x201f
    vendor     = 'Intel Corporation'
    class      = serial bus
    subclass   = USB
none2@pci0:0:20:2:    class=0x050000 rev=0x01 hdr=0x00 vendor=0x8086 device=0x4def subvendor=0x0000 subdevice=0x0000
    vendor     = 'Intel Corporation'
    class      = memory
    subclass   = RAM
none3@pci0:0:20:3:    class=0x028000 rev=0x01 hdr=0x00 vendor=0x8086 device=0x4df0 subvendor=0x8086 subdevice=0x0074
    vendor     = 'Intel Corporation'
    device     = 'Wi-Fi 6 AX201 160MHz'
    class      = network
none4@pci0:0:21:0:    class=0x0c8000 rev=0x01 hdr=0x00 vendor=0x8086 device=0x4de8 subvendor=0x1043 subdevice=0x1792
    vendor     = 'Intel Corporation'
    device     = 'Serial IO I2C Host Controller'
    class      = serial bus
none5@pci0:0:21:3:    class=0x0c8000 rev=0x01 hdr=0x00 vendor=0x8086 device=0x4deb subvendor=0x1043 subdevice=0x1792
    vendor     = 'Intel Corporation'
    class      = serial bus
none6@pci0:0:22:0:    class=0x078000 rev=0x01 hdr=0x00 vendor=0x8086 device=0x4de0 subvendor=0x1043 subdevice=0x1792
    vendor     = 'Intel Corporation'
    device     = 'Management Engine Interface'
    class      = simple comms
sdhci_pci0@pci0:0:26:0:    class=0x080501 rev=0x01 hdr=0x00 vendor=0x8086 device=0x4dc4 subvendor=0x1043 subdevice=0x1792
    vendor     = 'Intel Corporation'
    class      = base peripheral
    subclass   = SD host controller
pcib1@pci0:0:28:0:    class=0x060400 rev=0x01 hdr=0x01 vendor=0x8086 device=0x4db9 subvendor=0x1043 subdevice=0x1792
    vendor     = 'Intel Corporation'
    class      = bridge
    subclass   = PCI-PCI
pcib2@pci0:0:28:4:    class=0x060400 rev=0x01 hdr=0x01 vendor=0x8086 device=0x4dbc subvendor=0x1043 subdevice=0x1792
    vendor     = 'Intel Corporation'
    class      = bridge
    subclass   = PCI-PCI
isab0@pci0:0:31:0:    class=0x060100 rev=0x01 hdr=0x00 vendor=0x8086 device=0x4d87 subvendor=0x1043 subdevice=0x1792
    vendor     = 'Intel Corporation'
    class      = bridge
    subclass   = PCI-ISA
hdac0@pci0:0:31:3:    class=0x040100 rev=0x01 hdr=0x00 vendor=0x8086 device=0x4dc8 subvendor=0x1043 subdevice=0x1792
    vendor     = 'Intel Corporation'
    class      = multimedia
    subclass   = audio
none7@pci0:0:31:4:    class=0x0c0500 rev=0x01 hdr=0x00 vendor=0x8086 device=0x4da3 subvendor=0x1043 subdevice=0x1792
    vendor     = 'Intel Corporation'
    device     = 'JaserLake SMBus'
    class      = serial bus
    subclass   = SMBus
none8@pci0:0:31:5:    class=0x0c8000 rev=0x01 hdr=0x00 vendor=0x8086 device=0x4da4 subvendor=0x1043 subdevice=0x1792
    vendor     = 'Intel Corporation'
    device     = 'JaserLake SPI (flash) Controller'
    class      = serial bus
re0@pci0:1:0:0:    class=0x020000 rev=0x15 hdr=0x00 vendor=0x10ec device=0x8168 subvendor=0x1043 subdevice=0x205f
    vendor     = 'Realtek Semiconductor Co., Ltd.'
    device     = 'RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller'
    class      = network
    subclass   = ethernet
nvme0@pci0:2:0:0:    class=0x010802 rev=0x01 hdr=0x00 vendor=0xc0a9 device=0x540a subvendor=0xc0a9 subdevice=0x540a
    vendor     = 'Micron/Crucial Technology'
    device     = 'P2 NVMe PCIe SSD'
    class      = mass storage
    subclass   = NVM
```
`cat /etc/rc.conf`

```
clear_tmp_enable="YES"
syslogd_flags="-ss"
sendmail_enable="NONE"
hostname=""
ifconfig_re0="DHCP"
ifconfig_re0_ipv6="inet6 accept_rtadv"
kld_list="i915kms"
ntpd_enable="YES"
powerd_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="NO"
zfs_enable="YES"
```
Thanks in advance,
/András


----------



## SirDice (Oct 29, 2021)

You might need graphics/drm-devel-kmod for that chipset. But that requires a recent 13-STABLE or 14-CURRENT.


----------



## Andras83 (Oct 30, 2021)

Based on the freshports page it looks like FreeBSD 13 only has the drm-devel-kmod for aarch64, so I will try FreeBSD:14:amd64.
It's probably easier to reinstall than to upgrade to 14-CURRENT (it's a fresh installation, with nothing personal yet), so I will do that and report back.
BTW: I forgot to mention in my initial post that I had to create /usr/local/etc/X11/xorg.conf.d/20-video.conf



> Section "Device"
> Identifier "Card0"
> Driver "modesetting"
> BusID "PCI:0:2:0"
> EndSection


 Without the above the Xorg wanted to use some generic "intel" driver and not the "modesetting" drm-kmod.


----------



## SirDice (Oct 30, 2021)

Keep in mind that 14-CURRENT is an unsupported development version.


----------



## Andras83 (Oct 31, 2021)

Unfortunately it's the exact same behaviour with 14.0-CURRENT (amd64-*20211028*) and with drm-devel-kmod (*20211013*).
Any other idea how to fix this? Or does it look like the driver is not ready for this new CPU yet?

uname -a



> FreeBSD vault 14.0-CURRENT FreeBSD 14.0-CURRENT #0 main-n250301-4827bf76bce: Thu Oct 28 07:16:45 UTC 2021     root@releng1.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC  amd64



kldstat -h -v -n i915kms



> Id Refs Address             Size Name
> 5    1 0xffffffff830e5000  1.4M i915kms.ko (/boot/modules/i915kms.ko)
> Contains modules:
> Id Name
> 499 i915kms



pkg which /boot/modules/i915kms.ko



> /boot/modules/i915kms.ko was installed by package drm-devel-kmod-5.5.19.g20211013



/etc/rc.conf has:


> kld_list="i915kms"


----------



## Jose (Oct 31, 2021)

I think you're out of luck at least for a little while. It looks like you need a very recent Linux kernel to make these cards work:


			shared intel Graphics Acer Aspire 3 A-317-33 - Linux Mint Forums
		


Hopefully it'll get backported into drm-devel-kmod soon.


----------



## Andras83 (Oct 31, 2021)

Aha, great. I knew when I bought this laptop that it's quite new chipset and therefore it's risky for FreeBSD.
At least I know how this goes...

1. The open source driver gets developed based on the existing intel driver with some patches and goes into Linux kernel
2. FreeBSD ports the driver https://github.com/freebsd/drm-kmod which gets packaged into drm-devel-kmod
3. You need to compile the driver from source if it's very new
4. The driver drm-devel-kmod goes into FreeBSD CURRENT version which is a weekly snapshot
5. The driver drm-devel-kmod goes into FreeBSD STABLE version which is still a testing version, but more "stable"
6. The driver finally makes it into the RELEASE version as drm-kmod

Thanks, I will wait for a newer driver which is based on Linux Kernel 5.10 or 5.11.

BRs
/Andras


----------



## Jose (Oct 31, 2021)

That's a really good overview, but I think you missed the graphics/drm-current-kmod step. I'm not sure where it fits in, to be honest.


----------

