DragonFly BSD

KabylakeNUC

Kabylake NUC Config

DragonFly was recently worked up on the Kabylake NUC (the NUC715BNK) with very good results. This NUC setup is with 16G of ram and a NVMe SSD installed (we don't recommend ever using Intel's Optane 'memory' junk). In testing, this NUC has no problem booting from the ethernet via PXE, a USB stick, or its internal storage.

You can install DragonFly by booting via USB image and then installing to NVMe. We recommend connecting up the ethernet for initial connectivity, but Wifi will work once it has been set up. Once you've installed to NVMe try to reboot via NVMe and continue making adjustments as described below.

In "/boot/loader.conf" add:

sound_load="YES"
snd_hda_load="YES"
if_emx_load="YES"
if_iwm_load="YES"
iwm8265fw_load="YES"

In "/etc/rc.conf" if you are using your primary ethernet and not Wifi, this usually does the trick:

ifconfig_emx0="DHCP"

Note that the if_em driver is built-in and works if you don't load emx, but emx is a better driver. To use if_em, just have an ifconfig_em0="DHCP" line in /etc/rc.conf. In fact, you can put both lines in your rc.conf and it will use emx if emx is loaded, and em otherwise.

WIFI setup

If you have the NUC, for WIFI support you will want this in your "/etc/rc.conf". Also note that DHCP will not play well running on both the ethernet interface and the wlan (at least if both are plugged in), so only specify the DHCP option for one of the two. If the wifi is your primary connectivity, put the DHCP option there.

wlans_iwm0="wlan0"
ifconfig_wlan0="DHCP WPA"

And your "/etc/wpa_supplicant.conf" file should contain entries for all the wifi basestations you can connect to. Most typically an entry looks like this:

network={
    ssid="blahblah"
    psk="passwordhere"
}

Its easiest to just reboot after setting up the files rather than trying to start wpa_supplicant manually. You can have multiple network={} elements in the config file. Reboot and make sure its working before you worry about the rest of the config.

Sound Setup

The sound and snd_hda drivers can be loaded from /boot/loader.conf, which we have already described above. There are typically two channels. Channel 0 is typically the stereo jack and Channel 1 is typically routed through the HDMI display connector. You can set the hw.snd.default_unit sysctl to whichever you prefer. If you have problems with hum on the stereo output, trying routing through the HDMI (and connecting your speakers to your monitor's stereo output instead of the computer's stereo output).

X11 Setup

DragonFly supports accelerated X on Haswell and later cpus via the "intel" driver. You no longer have to recompile the X server. We recommend the following package sets:

pkg install xorg-apps
pkg install xorg-docs
pkg install xorg-fonts
pkg install xorg-libraries
pkg install xorg-macros
pkg install xorg-drivers
pkg install xorg-server
pkg install xdm
pkg install dbus
pkg install xbindkeys
pkg install firefox         (for 'firefox')
pkg install chromium        (for 'chrome')
(also install your favorite apps, GUIs, window managers, whatever)

The X11 configuration should work without needing an xorg.conf file. If you want to play with driver options you will need to set up a file. Note that our Kabylake support does work pretty well with driver defaults, but may give you a blank screen if you try to change the Accel mode.

We suggest starting X via xdm which needs a package in addition to xorg:

pkg install xdm

Further Mouse Setup

We recommend using moused and /dev/sysmouse to handle external USB mouse attachments. By using moused, mice can be plugged and unplugged without imploding X11. Try putting this in your /etc/rc.conf:

moused_enable="YES"

If that doesn't work then set moused_enable="NO" in /etc/rc.conf and start moused manually in /etc/rc.local:

moused -p /dev/ums0
moused -p /dev/ums1

Volume and backlight adjustment keys

In order to use these keys make two scripts:

#!/bin/csh
#
# mute script  "mute"

set curvol = "`mixer -f /dev/mixer -s vol`"

if ( -f ~/.savemute ) then
        set lastvol = "`cat ~/.savemute`"
else
        set lastvol = ""
endif

if ( "$curvol" == "vol 0:0" ) then
        if ( "$lastvol" != "" ) then
                eval mixer -f /dev/mixer $lastvol
        endif
else
        if ( "$lastvol" != "$curvol" ) then
                echo "$curvol" > ~/.savemute
        endif
        mixer -f /dev/mixer vol 0
endif

#!/bin/csh
#
# backlight script "backlight"

set level = `sysctl -n hw.backlight_level`
@ level = $level + $argv
sysctl hw.backlight_level=${level}

add next lines to ~/.xbindkeysrc:

# Volume
#
"/path/to/scripts/mute"
  F8

"mixer -f /dev/mixer vol -5 pcm -5"
  F9

"mixer -f /dev/mixer vol +5 pcm +5"
  F10

# Screen (if a laptop, this should work.  If not, probably won't)
#
"/path/to/scripts/backlight -20"
  F6

"/path/to/scripts/backlight 20"
  F7

You must call xbindkeys somewhere in your .xinitrc.

Hint: You can set default blacklight level (on a laptop) by placing next line in .xinitrc:

sysctl hw.backlight_level=370

Dual Displays

When X comes up it may not auto-probe all of your connected displays or properly orient them relative to each other. I find that the easiest solution is to make any required adjustments in your .xinitrc rather than trying to set them up in the /etc/X11/xorg.conf file. For example, on my Kabylake NUC I use two 4K displays and add this to my .xinitrc:

xrandr --output DP2 --left-of DP1
xrandr --fbmm 622x342

Power savings

At the moment I am not recommending using machdep.mwait.CX.idle=AUTODEEP. You can try setting it to a specific mode, such as C3/1, but AUTODEEP appears to have a bad interaction with the GPU every once in a while. And, in the past, we've also seen bad interactions with AHCI (the SATA storage controller).