# Radeon HD 8400 / R3 + amdgpu on FreeBSD



## mikhailnov (Nov 16, 2017)

00:01.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Kabini [Radeon HD 8400 / R3 Series]
is my videocard, it's an APU (video is integrated)


```
# sysctl -a | egrep -i 'hw.machine|hw.model|hw.ncpu'
hw.machine: amd64
hw.model: AMD Athlon(tm) 5350 APU with Radeon(tm) R3     
hw.ncpu: 4
hw.machine_arch: amd64
```

It works well under Linux using the amdgpu driver.

But I can't make it work on FreeBSD. I am using TrueOS. Tries TrueOS stable, it's installer suggested me to use the VESA driver. Now I am at TrueOS CURRENT daily, the installer did suggest to use amdgpu, but it does not work.


```
% uname -a
FreeBSD trueos-5316 12.0-CURRENT FreeBSD 12.0-CURRENT #1 67a4643eb(trueos-master): Wed Nov  8 18:09:27 UTC 2017     root@chimera:/usr/obj/usr/src/amd64.amd64/sys/GENERIC  amd64
```

Now I have native 1920*1080 resolution, but its running on llvmpipe, not amdgpu or radeon: 

```
% glxinfo | grep OpenGL
OpenGL vendor string: VMware, Inc.
OpenGL renderer string: llvmpipe (LLVM 4.0, 128 bits)
OpenGL core profile version string: 3.3 (Core Profile) Mesa 17.2.4
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 17.2.4
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.0 Mesa 17.2.4
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00
OpenGL ES profile extensions:
```

The *working xorg.conf (llvmpipe) *is:

```
% cat /etc/X11/xorg.conf
# XFree86 configuration file for RoFreeSBIE

Section "ServerLayout"
    Identifier     "XFree86 Configured"
    Screen      0  "Screen0" 0 0
EndSection

Section "Files"
    ModulePath   "/usr/local/lib/modules"
    ModulePath   "/usr/local/lib/xorg/modules"
    FontPath     "/usr/local/share/fonts/cyrillic/"
    FontPath     "/usr/local/share/fonts/TrueType/"
    FontPath     "/usr/local/share/fonts/illinoy/"
    FontPath     "/usr/local/share/fonts/webfonts/"
    FontPath     "/usr/local/share/fonts/misc/"
    FontPath     "/usr/local/share/fonts/TTF/"
    FontPath     "/usr/local/share/fonts/Speedo/"
    FontPath     "/usr/local/share/fonts/Type1/"
    FontPath     "/usr/local/share/fonts/CID/"
    FontPath     "/usr/local/share/fonts/75dpi/"
    FontPath     "/usr/local/share/fonts/100dpi/"
    FontPath     "/usr/local/share/fonts/dejavu/"
    FontPath     "/usr/local/share/fonts/cyrillic/"
    FontPath     "/usr/local/share/fonts/hebrew/"
    FontPath     "/usr/local/share/fonts/vietnamese/"
    FontPath     "/usr/local/share/fonts/indic/"
    FontPath     "/usr/local/share/fonts/fonts-indic/"
    FontPath     "/usr/local/share/fonts/ae_fonts1/AAHS"
    FontPath     "/usr/local/share/fonts/ae_fonts1/AGA"
    FontPath     "/usr/local/share/fonts/ae_fonts1/FS"
    FontPath     "/usr/local/share/fonts/ae_fonts1/Kasr"
    FontPath     "/usr/local/share/fonts/ae_fonts1/MCS"
    FontPath     "/usr/local/share/fonts/ae_fonts1/Shmookh"
    FontPath     "/usr/local/share/fonts/local/"
EndSection

Section "Module"
        Load  "extmod"
        Load  "record"
        Load  "dbe"
        Load  "glx"
        Load  "dri"
        Load  "dri2"
EndSection

Section "Screen"
    Identifier "Screen0"
    Device     "Card0"
    Monitor    "Monitor0"
EndSection

Section "Device"
        Identifier      "Card0"
        Driver          "scfb"
        # BusID           "scfb"
EndSection
```

I tried to remove it completely, tried to modify in many different ways, but it does not work.
If I change _Driver "scfb" _to _Driver "amdgpu" _or_ Driver "radeon", _Xorg cannot start, and the log is the following:

```
% cat /var/log/Xorg.1.log
cat: /var/log/Xorg.1.log: No such file or directory
[user2@trueos-5316 ~]% cat /var/log/Xorg.0.log.1
cat: /var/log/Xorg.0.log.1: No such file or directory
[user2@trueos-5316 ~]% ls /var/log | grep Xorg
Xorg.0.log
Xorg.0.log.old
[user2@trueos-5316 ~]% cat /var/log/Xorg.0.log.old
[    90.755] 
X.Org X Server 1.18.4
Release Date: 2016-07-19
[    90.755] X Protocol Version 11, Revision 0
[    90.755] Build Operating System: FreeBSD 12.0-CURRENT amd64 
[    90.755] Current Operating System: FreeBSD trueos-5316 12.0-CURRENT FreeBSD 12.0-CURRENT #1 67a4643eb(trueos-master): Wed Nov  8 18:09:27 UTC 2017     root@chimera:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64
[    90.755] Build Date: 12 November 2017  04:58:41AM
[    90.755] 
[    90.755] Current version of pixman: 0.34.0
[    90.756]     Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
[    90.756] Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[    90.756] (==) Log file: "/var/log/Xorg.0.log", Time: Thu Nov 16 23:00:17 2017
[    90.756] (==) Using config file: "/etc/X11/xorg.conf"
[    90.756] (==) Using system config directory "/usr/local/share/X11/xorg.conf.d"
[    90.757] (==) ServerLayout "XFree86 Configured"
[    90.757] (**) |-->Screen "Screen0" (0)
[    90.758] (**) |   |-->Monitor "<default monitor>"
[    90.758] (**) |   |-->Device "Card0"
[    90.758] (==) No monitor specified for screen "Screen0".
    Using a default monitor configuration.
[    90.758] (==) Automatically adding devices
[    90.758] (==) Automatically enabling devices
[    90.758] (==) Not automatically adding GPU devices
[    90.758] (==) Max clients allowed: 256, resource mask: 0x1fffff
[    90.758] (WW) The directory "/usr/local/share/fonts/cyrillic/" does not exist.
[    90.758]     Entry deleted from font path.
[    90.758] (WW) The directory "/usr/local/share/fonts/TrueType/" does not exist.
[    90.758]     Entry deleted from font path.
[    90.758] (WW) The directory "/usr/local/share/fonts/illinoy/" does not exist.
[    90.758]     Entry deleted from font path.
[    90.758] (WW) The directory "/usr/local/share/fonts/webfonts/" does not exist.
[    90.758]     Entry deleted from font path.
[    90.759] (WW) The directory "/usr/local/share/fonts/misc/" does not exist.
[    90.759]     Entry deleted from font path.
[    90.759] (WW) The directory "/usr/local/share/fonts/Speedo/" does not exist.
[    90.759]     Entry deleted from font path.
[    90.759] (WW) The directory "/usr/local/share/fonts/Type1/" does not exist.
[    90.759]     Entry deleted from font path.
[    90.759] (WW) The directory "/usr/local/share/fonts/CID/" does not exist.
[    90.759]     Entry deleted from font path.
[    90.759] (WW) The directory "/usr/local/share/fonts/75dpi/" does not exist.
[    90.759]     Entry deleted from font path.
[    90.759] (WW) The directory "/usr/local/share/fonts/100dpi/" does not exist.
[    90.759]     Entry deleted from font path.
[    90.759] (WW) The directory "/usr/local/share/fonts/cyrillic/" does not exist.
[    90.759]     Entry deleted from font path.
[    90.759] (WW) The directory "/usr/local/share/fonts/hebrew/" does not exist.
[    90.759]     Entry deleted from font path.
[    90.759] (WW) The directory "/usr/local/share/fonts/vietnamese/" does not exist.
[    90.759]     Entry deleted from font path.
[    90.759] (WW) The directory "/usr/local/share/fonts/indic/" does not exist.
[    90.759]     Entry deleted from font path.
[    90.760] (WW) The directory "/usr/local/share/fonts/fonts-indic/" does not exist.
[    90.760]     Entry deleted from font path.
[    90.760] (WW) The directory "/usr/local/share/fonts/ae_fonts1/AAHS" does not exist.
[    90.760]     Entry deleted from font path.
[    90.760] (WW) The directory "/usr/local/share/fonts/ae_fonts1/AGA" does not exist.
[    90.760]     Entry deleted from font path.
[    90.760] (WW) The directory "/usr/local/share/fonts/ae_fonts1/FS" does not exist.
[    90.760]     Entry deleted from font path.
[    90.760] (WW) The directory "/usr/local/share/fonts/ae_fonts1/Kasr" does not exist.
[    90.760]     Entry deleted from font path.
[    90.760] (WW) The directory "/usr/local/share/fonts/ae_fonts1/MCS" does not exist.
[    90.760]     Entry deleted from font path.
[    90.760] (WW) The directory "/usr/local/share/fonts/ae_fonts1/Shmookh" does not exist.
[    90.760]     Entry deleted from font path.
[    90.760] (WW) The directory "/usr/local/share/fonts/local/" does not exist.
[    90.760]     Entry deleted from font path.
[    90.760] (WW) The directory "/usr/local/share/fonts/misc/" does not exist.
[    90.760]     Entry deleted from font path.
[    90.760] (WW) The directory "/usr/local/share/fonts/Type1/" does not exist.
[    90.760]     Entry deleted from font path.
[    90.760] (WW) The directory "/usr/local/share/fonts/100dpi/" does not exist.
[    90.760]     Entry deleted from font path.
[    90.760] (WW) The directory "/usr/local/share/fonts/75dpi/" does not exist.
[    90.761]     Entry deleted from font path.
[    90.761] (**) FontPath set to:
    /usr/local/share/fonts/TTF/,
    /usr/local/share/fonts/dejavu/,
    /usr/local/share/fonts/TTF/,
    /usr/local/share/fonts/OTF/
[    90.761] (**) ModulePath set to "/usr/local/lib/modules,/usr/local/lib/xorg/modules"
[    90.761] (II) The server relies on devd to provide the list of input devices.
    If no devices become available, reconfigure devd or disable AutoAddDevices.
[    90.761] (II) Loader magic: 0x811d40
[    90.761] (II) Module ABI versions:
[    90.761]     X.Org ANSI C Emulation: 0.4
[    90.761]     X.Org Video Driver: 20.0
[    90.761]     X.Org XInput driver : 22.1
[    90.761]     X.Org Server Extension : 9.0
[    90.761] (--) PCI:*(0:0:1:0) 1002:9830:1043:8623 rev 0, Mem @ 0xc0000000/268435456, 0xd0000000/8388608, 0xfeb00000/262144, I/O @ 0x0000f000/256, BIOS @ 0x????????/65536
[    90.761] (II) "glx" will be loaded. This was enabled by default and also specified in the config file.
[    90.761] (II) LoadModule: "extmod"
[    90.762] (II) Module "extmod" already built-in
[    90.762] (II) LoadModule: "record"
[    90.762] (II) Module "record" already built-in
[    90.762] (II) LoadModule: "dbe"
[    90.762] (II) Module "dbe" already built-in
[    90.762] (II) LoadModule: "glx"
[    90.762] (II) Loading /usr/local/lib/xorg/modules/extensions/libglx.so
[    90.765] (II) Module glx: vendor="X.Org Foundation"
[    90.765]     compiled for 1.18.4, module version = 1.0.0
[    90.765]     ABI class: X.Org Server Extension, version 9.0
[    90.765] (==) AIGLX enabled
[    90.765] (II) LoadModule: "dri"
[    90.765] (II) Module "dri" already built-in
[    90.765] (II) LoadModule: "dri2"
[    90.765] (II) Module "dri2" already built-in
[    90.765] (II) LoadModule: "amdgpu"
[    90.766] (II) Loading /usr/local/lib/xorg/modules/drivers/amdgpu_drv.so
[    90.766] (II) Module amdgpu: vendor="X.Org Foundation"
[    90.766]     compiled for 1.18.4, module version = 1.3.0
[    90.766]     Module class: X.Org Video Driver
[    90.766]     ABI class: X.Org Video Driver, version 20.0
[    90.766] (II) AMDGPU: Driver for AMD Radeon:
    All GPUs supported by the amdgpu kernel driver
[    90.767] (--) Using syscons driver with X support (version 2.0)
[    90.767] (--) using VT number 9

[    90.767] (EE) No devices detected.
[    90.767] (EE) 
Fatal server error:
[    90.767] (EE) no screens found(EE) 
[    90.767] (EE) 
Please consult the The X.Org Foundation support 
    at http://wiki.x.org
 for help. 
[    90.767] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[    90.767] (EE) 
[    90.768] (EE) Server terminated with error (1). Closing log file.
```

ls /dev | grep dri returns nothing.


----------



## mikhailnov (Nov 16, 2017)

Here is the output of http://paste.ubuntu.com/25976532/ (it was too long to post on this forum)
*dmesg
pciconf -lvbce
devinfo -vr*


----------



## mikhailnov (Nov 16, 2017)

*kldstat*

```
Id Refs Address            Size     Name
 1  139 0xffffffff80200000 1fd5ef0  kernel
 2    1 0xffffffff821d6000 36de60   zfs.ko
 3    2 0xffffffff82544000 ca60     opensolaris.ko
 4    1 0xffffffff82551000 225c8    geom_eli.ko
 5    1 0xffffffff82574000 141c8    tmpfs.ko
 6    1 0xffffffff82589000 d828     aesni.ko
 7    2 0xffffffff82dfa000 43e7     libiconv.ko
 8    1 0xffffffff82dff000 246e7    ipfw.ko
 9    1 0xffffffff82e24000 2571     libmchain.ko
10    1 0xffffffff82e27000 4497a    linux.ko
11    4 0xffffffff82e6c000 7b10     linux_common.ko
12    1 0xffffffff82e74000 7be      msdosfs_iconv.ko
13    1 0xffffffff82e75000 3b0d4    if_bwn.ko
14    1 0xffffffff82eb1000 844a     siba_bwn.ko
15    1 0xffffffff82eba000 208ef    if_bwi.ko
16    1 0xffffffff82edb000 3e611    linux64.ko
17    1 0xffffffff82f1a000 271b     runfw.ko
18    1 0xffffffff82f1d000 1883b    if_run.ko
19    1 0xffffffff82f36000 16794    if_rum.ko
20    1 0xffffffff82f4d000 1e8b7    if_iwm.ko
21    1 0xffffffff82f6c000 7f67     cuse.ko
22    1 0xffffffff82f74000 93c2     geom_uzip.ko
23    1 0xffffffff82f7e000 5c71     fdescfs.ko
24    1 0xffffffff82f84000 2e56d    iwn4965fw.ko
25    1 0xffffffff82fb3000 52d8d    iwn1000fw.ko
26    1 0xffffffff83006000 539f9    iwn5000fw.ko
27    1 0xffffffff8305a000 52d21    iwn5150fw.ko
28    1 0xffffffff830ad000 6f6fb    iwn6000fw.ko
29    1 0xffffffff8311d000 a5cdd    iwn6000g2afw.ko
30    1 0xffffffff831c3000 a653b    iwn6000g2bfw.ko
31    1 0xffffffff8326a000 73241    iwn6050fw.ko
32    1 0xffffffff832de000 16f93    if_urtw.ko
33    1 0xffffffff832f5000 1dd7d    rtwn.ko
34    1 0xffffffff83313000 36aa     acpi_video.ko
35    1 0xffffffff83317000 eb02     fuse.ko
36    1 0xffffffff83326000 3b87     ums.ko
37    1 0xffffffff8332a000 5a15     atp.ko
38    1 0xffffffff83330000 aca3     linprocfs.ko
39    1 0xffffffff8333b000 6aa6     linsysfs.ko
40    1 0xffffffff83342000 8367     autofs.ko
41    1 0xffffffff8334b000 2962     uhid.ko
42    1 0xffffffff8334e000 10491    snd_uaudio.ko
```


----------



## rigoletto@ (Nov 16, 2017)

By the WIKI your graphic card is currently unsupported. However there is the graphics/drm-next-kmod port (ported from 12-CURRENT) what is in sync with a recent Linux version and should work; however, that port currently just work with FreeBSD 10.X series.


----------



## aht0 (Nov 17, 2017)

Had Kabini (AthlonII 5350), yeah previous poster is correct, got it working that way using vanilla FreeBSD.
However, TrueOS is already tracking 12-CURRENT but they have done TONs of modifications (literally thousands according to Github), better ask advice from discourse.trueos.org


----------



## nik0tine (Sep 25, 2018)

I have EXACTLY *mikhailnov*'s hardware. Looking for advice to get off scfb and on to radeon accel.
My friend, did you have success? This Kabini crap is a real headache!
I heard from elsewhere to compile the drm-next into the kernel... What is your opinion?


----------



## Maccraft123 (Oct 25, 2018)

Install graphics/drm-next-kmod, or graphics/drm-devel-kmod on -BETA


----------



## nik0tine (Oct 25, 2018)

https://forums.freebsd.org/threads/drm-next-kmod-and-11-2-release.66426/page-3#post-404654
I put that lazy kabini to work finally without benefits or dental. (SOLVED)

Order of operations:
SVN
DRM-NEXT-KMOD
Build World/BUILD KERNEL
hw.syscons.disable=1
kld_load="AMDGPU"


----------

