Another FreeBSD compatibility report

“It works…”

Keeping some notes here for future reference, in case a new setup is needed or people ask questions.

Running:

FreeBSD 12.0-CURRENT #0 r322167: Mon Aug  7 15:19:45 UTC 2017
    root@releng3.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64

Why not 11-STABLE? no particular reason. New hardware, I figured 12-current would have better driver support.

Processor

SKU YD180XBCAEWOF:

CPU: AMD Ryzen 7 1800X Eight-Core Processor          (3593.35-MHz K8-class CPU)
  Origin="AuthenticAMD"  Id=0x800f11  Family=0x17  Model=0x1  Stepping=1
  Features=0x178bfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,MMX,FXSR,SSE,SSE2,HTT>
  Features2=0x7ed8320b<SSE3,PCLMULQDQ,MON,SSSE3,FMA,CX16,SSE4.1,SSE4.2,MOVBE,POPCNT,AESNI,XSAVE,OSXSAVE,AVX,F16C,RDRAND>
  AMD Features=0x2e500800<SYSCALL,NX,MMX+,FFXSR,Page1GB,RDTSCP,LM>
  AMD Features2=0x35c233ff<LAHF,CMP,SVM,ExtAPIC,CR8,ABM,SSE4A,MAS,Prefetch,OSVW,SKINIT,WDT,TCE,Topology,PCXC,PNXC,DBE,PL2I,MWAITX>
  Structured Extended Features=0x209c01a9<FSGSBASE,BMI1,AVX2,SMEP,BMI2,RDSEED,ADX,SMAP,CLFLUSHOPT,SHA>
  XSAVE Features=0xf<XSAVEOPT,XSAVEC,XINUSE,XSAVES>
  SVM: NP,NRIP,VClean,AFlush,DAssist,NAsids=32768
  TSC: P-state invariant, performance statistics
[...]
FreeBSD/SMP: Multiprocessor System Detected: 16 CPUs
FreeBSD/SMP: 1 package(s) x 8 core(s) x 2 hardware threads

Its topology is properly recognized: sysctl kern.sched.topology_spec shows all 3 layers of caching.

Motherboard

SKU 90MB0TE0-M0EAY0, Prime B350M-A (Asus)

  • Has own smart integrated power scaling so “powerd“ must be disabled:

    • the on-board power management chip doesn’t seem to be fully recognized (some errors show up);
    • integrated board just does work just fine so no need to run an additional program that takes CPU cycles.
  • PS/2 keyboard and mouse - fully functional:

    kbd1 at kbdmux0
    

    (no mouse plugged in so no device activated)

  • On-board Realtec gigabit Ethernet - fully functional:

    re0: <RealTek 8168/8111 B/C/CP/D/DP/E/F/G PCIe Gigabit Ethernet> port 0xf000-0xf0ff mem 0xfe204000-0xfe204fff,0xfe200000-0xfe203fff irq 34 at device 0.0 on pci6
    re0: Using 1 MSI-X message
    re0: Chip rev. 0x54000000
    re0: MAC rev. 0x00100000
    miibus0: <MII bus> on re0
    rgephy0: <RTL8251/8153 1000BASE-T media interface> PHY 1 on miibus0
    rgephy0:  none, 10baseT, 10baseT-FDX, 10baseT-FDX-flow, 100baseTX, 100baseTX-FDX, 100baseTX-FDX-flow, 1000baseT-FDX, 1000baseT-FDX-master, 1000baseT-FDX-flow, 1000baseT-FDX-flow-master, auto, auto-flow
    re0: Using defaults for TSO: 65518/35/2048
    re0: Ethernet address: xx:xx:xx:xx:xx:xx
    re0: netmap queues/slots: TX 1/256, RX 1/256
    
  • Three USB host controllers; two are USB 3.1 but not yet recognized as such, otherwise fully functional:

    xhci0: <XHCI (generic) USB 3.0 controller> mem 0xfe4a0000-0xfe4a7fff irq 32 at device 0.0 on pci1
    xhci0: 32 bytes context size, 64-bit DMA
    usbus0 on xhci0
    usbus0: 5.0Gbps Super Speed USB v3.0
    xhci1: <XHCI (generic) USB 3.0 controller> mem 0xfe300000-0xfe307fff irq 32 at device 0.0 on pci3
    xhci1: 32 bytes context size, 64-bit DMA
    usbus1 on xhci1
    usbus1: 5.0Gbps Super Speed USB v3.0
    xhci2: <XHCI (generic) USB 3.0 controller> mem 0xfe500000-0xfe5fffff irq 37 at device 0.3 on pci9
    xhci2: 64 bytes context size, 64-bit DMA
    usbus2 on xhci2
    usbus2: 5.0Gbps Super Speed USB v3.0
    ugen2.1: <0x1022 XHCI root HUB> at usbus2
    ugen1.1: <0x1b21 XHCI root HUB> at usbus1
    ugen0.1: <0x1022 XHCI root HUB> at usbus0
    uhub0: <0x1022 XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus2
    uhub1: <0x1022 XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus0
    uhub2: <0x1b21 XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus1
    
  • On-board HD audio - not tested yet:

    hdac1: <AMD (0x1457) HDA Controller> mem 0xfe800000-0xfe807fff irq 43 at device 0.3 on pci10
    hdacc1: <Realtek ALC887 HDA CODEC> at cad 0 on hdac1
    hdaa1: <Realtek ALC887 Audio Function Group> at nid 1 on hdacc1
    pcm1: <Realtek ALC887 (Rear Analog)> at nid 20 and 24,26 on hdaa1
    pcm2: <Realtek ALC887 (Front Analog)> at nid 27 and 25 on hdaa1
    pcm3: <Realtek ALC887 (Internal Digital)> at nid 17 on hdaa1
    
  • 2x On-board SATA controller - fully functional:

    ahci0: <AHCI SATA controller> mem 0xfe480000-0xfe49ffff irq 33 at device 0.1 on pci1
    ahci0: AHCI v1.31 with 8 6Gbps ports, Port Multiplier supported
    ahcich0: <AHCI channel> at channel 0 on ahci0
    ahcich1: <AHCI channel> at channel 1 on ahci0
    ahcich4: <AHCI channel> at channel 4 on ahci0
    ahcich5: <AHCI channel> at channel 5 on ahci0
    ahci1: <AHCI SATA controller> mem 0xfe808000-0xfe808fff irq 42 at device 0.2 on pci10
    ahci1: AHCI v1.31 with 1 6Gbps ports, Port Multiplier supported with FBS
    ahcich8: <AHCI channel> at channel 0 on ahci1
    

Storage

2x SKU MZ-7KE512B/EU

ada0 at ahcich0 bus 0 scbus0 target 0 lun 0
ada0: <Samsung SSD 850 PRO 512GB EXM04B6Q> ACS-2 ATA SATA 3.x device
ada0: Serial Number xxxxxxxxxxxxxxxxx
ada0: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 512bytes)
ada0: Command Queueing enabled
ada0: 488386MB (1000215216 512 byte sectors)
ada0: quirks=0x3<4K,NCQ_TRIM_BROKEN>
ada1 at ahcich1 bus 0 scbus1 target 0 lun 0
ada1: <Samsung SSD 850 PRO 512GB EXM04B6Q> ACS-2 ATA SATA 3.x device
ada1: Serial Number xxxxxxxxxxxxxxxxxx
ada1: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 512bytes)
ada1: Command Queueing enabled
ada1: 488386MB (1000215216 512 byte sectors)
ada1: quirks=0x3<4K,NCQ_TRIM_BROKEN>

The drives advertise 512-byte logical sectors, 4096-byte physical sectors however my own benchmarking shows that the unit of transfer that exposes best performance is 64KB, with 32KB delivering 90% of best.

Wireless

SKU GC-WB867D-I

Advertised as “Gigabyte,” is really an Intel dual channel chipset in disguise.

Needs this in /boot/loader.conf:

if_iwm_load="YES"
iwm7260fw_load="YES"

Fully functional:

iwm0: <Intel(R) Dual Band Wireless AC 8260> mem 0xfe100000-0xfe101fff irq 35 at device 0.0 on pci7
iwm0: hw rev 0x200, fw ver 22.361476.0, address xx:xx:xx:xx:xx:xx

Activate with /etc/rc.conf:

wlans_iwm0="wlan0"
ifconfig_wlan0="WPA SYNCDHCP"

(and appropriate /etc/wpa_supplicant.conf)

Video

Motherboard and processor do not provide integrated graphics, so had to go for cheap (!) external adapter.

SKU 11190-02-20G

Advertised as “Sapphire HD 6450 1GB DDR3.”

hdac0: <ATI RV910 HDA Controller> mem 0xfe940000-0xfe943fff irq 55 at device 0.1 on pci8
hdacc0: <ATI R6xx HDA CODEC> at cad 0 on hdac0
hdaa0: <ATI R6xx Audio Function Group> at nid 1 on hdacc0
pcm0: <ATI R6xx (HDMI)> at nid 3 on hdaa0
vgapci0:  port 0xe000-0xe0ff mem 0xe0000000-0xefffffff,0xfe920000-0xfe93ffff irq 54 at device 0.0 on pci8
vgapci0: Boot video device

I do not use X11 on this computer so there was no need to look further, but I was curious.

This in xorg.conf does the trick:

Section "Device"
        Identifier  "Card0"
        Driver      "radeon"
EndSection

DRI initializes fine:

info: [drm] Initialized drm 1.1.0 20060810
drmn0: <Caicos [Radeon HD 7000 Series]> on vgapci0
info: [drm] RADEON_IS_PCIE
info: [drm] initializing kernel modesetting (CAICOS 0x1002:0x6778 0x174B:0xA01F).
info: [drm] register mmio base: 0xFE920000
info: [drm] register mmio size: 131072
info: [drm] radeon_atrm_get_bios: ===> Try ATRM...
info: [drm] radeon_atrm_get_bios: pci_find_class() found: 0:39:0:0, vendor=1002, device=6778
info: [drm] radeon_atrm_get_bios: Get ACPI device handle
info: [drm] radeon_atrm_get_bios: Get ACPI handle for "ATRM"
info: [drm] radeon_atrm_get_bios: Failed to get "ATRM" handle: AE_NOT_FOUND
info: [drm] radeon_acpi_vfct_bios: ===> Try VFCT...
info: [drm] radeon_acpi_vfct_bios: Get "VFCT" ACPI table
info: [drm] radeon_acpi_vfct_bios: Failed to get "VFCT" table: AE_NOT_FOUND
info: [drm] igp_read_bios_from_vram: ===> Try IGP's VRAM...
info: [drm] igp_read_bios_from_vram: VRAM base address: 0xe0000000
info: [drm] igp_read_bios_from_vram: Map address: 0xfffff800e0000000 (262144 bytes)
info: [drm] igp_read_bios_from_vram: Incorrect BIOS signature: 0xBFBF
info: [drm] radeon_read_bios: ===> Try PCI Expansion ROM...
info: [drm] radeon_read_bios: Map address: 0xfffff800000c0000 (131072 bytes)
info: [drm] ATOM BIOS: HD6450
drmn0: info: VRAM: 1024M 0x0000000000000000 - 0x000000003FFFFFFF (1024M used)
drmn0: info: GTT: 512M 0x0000000040000000 - 0x000000005FFFFFFF
info: [drm] Detected VRAM RAM=1024M, BAR=256M
info: [drm] RAM width 64bits DDR
[TTM] Zone  kernel: Available graphics memory: 16726090 kiB
[TTM] Zone   dma32: Available graphics memory: 2097152 kiB
[TTM] Initializing pool allocator
info: [drm] radeon: 1024M of VRAM memory ready
info: [drm] radeon: 512M of GTT memory ready.
info: [drm] Supports vblank timestamp caching Rev 1 (10.10.2010).
info: [drm] Driver supports precise vblank timestamp query.
info: [drm] MSI enabled 1 message(s)
drmn0: info: radeon: using MSI.
info: [drm] radeon: irq initialized.
info: [drm] GART: num cpu pages 131072, num gpu pages 131072
info: [drm] probing gen 2 caps for device 1022:1453 = 3/e
info: [drm] enabling PCIE gen 2 link speeds, disable with radeon.pcie_gen2=0
info: [drm] Loading CAICOS Microcode
info: [drm] PCIE GART of 512M enabled (table at 0x0000000000040000).
drmn0: info: WB enabled
drmn0: info: fence driver on ring 0 use gpu addr 0x0000000040000c00 and cpu addr 0x0xfffff80117903c00
drmn0: info: fence driver on ring 3 use gpu addr 0x0000000040000c0c and cpu addr 0x0xfffff80117903c0c
info: [drm] ring test on 0 succeeded in 3 usecs
info: [drm] ring test on 3 succeeded in 1 usecs
info: [drm] ib test on ring 0 succeeded in 0 usecs
info: [drm] ib test on ring 3 succeeded in 0 usecs
info: [drm] radeon_device_init: Taking over the fictitious range 0xe0000000-0xf0000000
radeon_iicbb0 on drmn0
iicbus0: <Philips I2C bus> on iicbb0 addr 0xff
iic0: <I2C generic I/O> on iicbus0
radeon_iicbb1 on drmn0
iicbus1: <Philips I2C bus> on iicbb1 addr 0xff
iic1: <I2C generic I/O> on iicbus1
radeon_iicbb2 on drmn0
iicbus2: <Philips I2C bus> on iicbb2 addr 0xff
iic2: <I2C generic I/O> on iicbus2
radeon_iicbb3 on drmn0
iicbus3: <Philips I2C bus> on iicbb3 addr 0xff
iic3: <I2C generic I/O> on iicbus3
radeon_iicbb4 on drmn0
iicbus4: <Philips I2C bus> on iicbb4 addr 0xff
iic4: <I2C generic I/O> on iicbus4
radeon_iicbb5 on drmn0
iicbus5: <Philips I2C bus> on iicbb5 addr 0xff
iic5: <I2C generic I/O> on iicbus5
radeon_iicbb6 on drmn0
iicbus6: <Philips I2C bus> on iicbb6 addr 0xff
iic6: <I2C generic I/O> on iicbus6
radeon_iicbb7 on drmn0
iicbus7: <Philips I2C bus> on iicbb7 addr 0xff
iic7: <I2C generic I/O> on iicbus7
info: [drm] Radeon Display Connectors
info: [drm] Connector 0:
info: [drm]   HDMI-A-1
info: [drm]   HPD2
info: [drm]   DDC: 0x6440 0x6440 0x6444 0x6444 0x6448 0x6448 0x644c 0x644c
info: [drm]   Encoders:
info: [drm]     DFP1: INTERNAL_UNIPHY1
info: [drm] Connector 1:
info: [drm]   DVI-D-1
info: [drm]   HPD4
info: [drm]   DDC: 0x6460 0x6460 0x6464 0x6464 0x6468 0x6468 0x646c 0x646c
info: [drm]   Encoders:
info: [drm]     DFP2: INTERNAL_UNIPHY
info: [drm] Connector 2:
info: [drm]   VGA-1
info: [drm]   DDC: 0x6430 0x6430 0x6434 0x6434 0x6438 0x6438 0x643c 0x643c
info: [drm]   Encoders:
info: [drm]     CRT1: INTERNAL_KLDSCP_DAC1
info: [drm] Internal thermal controller without fan control
info: [drm] radeon: power management initialized
info: [drm] Connector HDMI-A-1: get mode from tunables:
info: [drm]   - kern.vt.fb.modes.HDMI-A-1
info: [drm]   - kern.vt.fb.default_mode
info: [drm] Connector DVI-D-1: get mode from tunables:
info: [drm]   - kern.vt.fb.modes.DVI-D-1
info: [drm]   - kern.vt.fb.default_mode
info: [drm] Connector VGA-1: get mode from tunables:
info: [drm]   - kern.vt.fb.modes.VGA-1
info: [drm]   - kern.vt.fb.default_mode
info: [drm] fb mappable at 0xE0142000
info: [drm] vram apper at 0xE0000000
info: [drm] size 19906560
info: [drm] fb depth is 24
info: [drm]    pitch is 13824
fbd0 on drmn0
VT: Replacing driver "efifb" with new "fb".
info: [drm] Initialized radeon 2.29.0 20080528 for drmn0 on minor 0

Somehow the maximum resolution of my screen (3440x1440) triggers a bug in the chipset, so I had to force a lower resolution:

Section "Screen"
        Identifier "Screen0"
        Device     "Card0"
        Monitor    "Monitor0"
        SubSection "Display"
                Viewport   0 0
                Depth     24
                Modes "2048x1080" "1920x1080" "1440x900" "1280x720"
        EndSubSection
EndSection

Again no use for X11 so this is not a problem in practice.

Filesystem

Partition table needs some manual care, to ensure that the partitions are aligned on 32K boundaries (the unit for best performance I determined by benchmarking):

% gpart show
=>        40  1000215136  ada0  GPT  (477G)
          40          24        - free -  (12K)
          64      409536     1  efi  (200M)
      409600     4194304     2  freebsd-ufs  (2.0G)
     4603904   995611264     3  freebsd-zfs  (475G)
  1000215168           8        - free -  (4.0K)

=>        40  1000215136  ada1  GPT  (477G)
          40          24        - free -  (12K)
          64      409536     1  efi  (200M)
      409600     4194304     2  freebsd-ufs  (2.0G)
     4603904   995611264     3  freebsd-zfs  (475G)
  1000215168           8        - free -  (4.0K)

(Offset/sizes are expressed in 512-byte logical blocks and must thus be multiple of 64.)

% zpool list
NAME   SIZE  ALLOC   FREE  EXPANDSZ   FRAG    CAP  DEDUP  HEALTH  ALTROOT
data   472G  23.8G   448G         -     1%     5%  1.00x  ONLINE  -

% zpool status
  pool: data
 state: ONLINE
  scan: none requested
config:

        NAME                                            STATE     READ WRITE CKSUM
        data                                            ONLINE       0     0     0
          mirror-0                                      ONLINE       0     0     0
            gptid/9dabadd3-8106-11e7-b698-88d7f67c12a8  ONLINE       0     0     0
            gptid/a18b6e21-8106-11e7-b698-88d7f67c12a8  ONLINE       0     0     0

Unfortunately ZFS does not allow sector sizes above 8K. So I had to make-do with its default. Performance is adequate, if not optimal:

% bonnie
File './Bonnie.9023', size: 104857600
[...]
              -------Sequential Output-------- ---Sequential Input-- --Random--
              -Per Char- --Block--- -Rewrite-- -Per Char- --Block--- --Seeks---
Machine    MB K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU  /sec %CPU
          100 281097 100.0 268506 99.8 329275 100.0 449623 100.0 2515290 105.2 139557.6 187.5

% bonnie++
[...]
Version  1.97       ------Sequential Output------ --Sequential Input- --Random-
Concurrency   1     -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP
xxxxx           64G    54  99 258883  99 240610  99   348  99 678770  99  5686 309
Latency               154ms     124ms    5358us   25507us    2164us    9822us

Version  1.97       ------Sequential Create------ --------Random Create--------
xxxxx               -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
                 16 24135  98 +++++ +++ 10962  46 25032  98 +++++ +++ 24933  99
Latency              6168us      59us     800ms    6269us      45us      83us

Suspend/resume

Suspend to sleep state C3 (acpiconf -s 3) works fine and resumes without problems. Including graphics and wifi.

Wake-on-Lan

In want of using this computer when I’m travelling but not leave it on all the time, it is important to be able to wake it up remotely.

Thankfully, wake-on-lan works fine with the on-board Realtek adapter.

Can wake both from suspended state (C3) and off (C5).

Needs in /boot/loader.conf

dev.re.0.wake=1

Energy usage

Idle: ~40W

Underload: ~140W

Performance - main use case

% cd cockroach
% /usr/bin/time gmake build # incl all dependencies
[...]
      103.77 real       869.62 user        74.04 sys

% touch pkg/**/*.go && /usr/bin/time gmake build # just the Go code
       22.78 real        42.83 user         7.77 sys

image0

I can live with that.