# RX 580 Supported?



## pestslent1 (May 18, 2018)

I have FreeBSD 11.1 p10 running kde4 desktop on a ryzen 7 1700. I was using a hd 7970 for my video card, and everything worked fine, i upgraded to a rx580 and now x fails to start. I could not find anything that said it is a supported card. I did not want to "-configure" because of "Video cards, monitors, and input devices are automatically detected and do not require any manual configuration. Do not create xorg.conf or run a -configure step unless automatic configuration fails. ". Is the RX580 supported or do I need to adjust something else. 
Any and all assistance would be appreciated.


----------



## abishai (May 18, 2018)

Definitely not supported, but upcoming 11.2 has graphics/drm-stable-kmod


----------



## pestslent1 (May 18, 2018)

abishai said:


> Definitely not supported, but upcoming 11.2 has graphics/drm-stable-kmod


So, I have about a month to 11.2. Can I try this "graphics/drm-stable-kmod "with my build ( FreeBSD 11.1 p10 )?


----------



## abishai (May 18, 2018)

No, but you can upgrade your system to 11.2-BETA1 as I did. It works without any observable issues on my laptop with intel. BTW, kde5 is awesome.


----------



## SirDice (May 18, 2018)

Yep, you can give the BETA release a try. It will not work on 11.1-RELEASE. The beta release will be upgradable using freebsd-update(8) to the full release when the time comes.


----------



## PacketMan (May 18, 2018)

pestslent1 said:


> I have FreeBSD 11.1 p10 running kde4 desktop on a ryzen 7 1700.



Sorry, derailing the point a bit; ignoring the video card, how is the OS on the Ryzen otherwise? Any issues with stability?


----------



## pestslent1 (May 19, 2018)

PacketMan said:


> Sorry, derailing the point a bit; ignoring the video card, how is the OS on the Ryzen otherwise? Any issues with stability?


If you are referring to 11.1 p10, It works fine, my only complainet is I can't get bhyve to show more than 1 cpu in my windows vm's.


----------



## pestslent1 (May 28, 2018)

I was pointed to "Upcoming 11.2 has graphics/drm-stable-kmod" to use my rx580. I am now on beta3 of11.2, I installed   "gpu-firmware-kmod" and "drm-stable-kmod" changed my rc.conf to "kld_list="amdgpu"" on reboot  x fails. 
Below is my dmesg.boot from the video failing:

```
[drm:amdgpu_atombios_init] Unable to find PCI I/O BAR; using MMIO for ATOM IIO
ATOM BIOS: 67DFHB.15.50.2.1.AS22
[drm] GPU post is not needed
amdgpu/polaris10_mc.bin: could not load firmware image, error 2
amdgpu/polaris10_mc.bin: could not load firmware image, error 2
Zone  kernel: Available graphics memory: 16728762 kiB
Zone   dma32: Available graphics memory: 2097152 kiB
[TTM] Initializing pool allocator
drmn0: VRAM: 8192M 0x0000000000000000 - 0x00000001FFFFFFFF (8192M used)
drmn0: GTT: 16336M 0x0000000200000000 - 0x00000005FD0AE7FF
[drm] Detected VRAM RAM=8192M, BAR=256M
[drm] RAM width 256bits GDDR5
[drm] amdgpu: 8192M of VRAM memory ready
[drm] amdgpu: 16336M of GTT memory ready.
[drm] GART: num cpu pages 4182190, num gpu pages 4182190
[drm] PCIE GART of 16336M enabled (table at 0x0000000000040000).
[drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[drm] Driver supports precise vblank timestamp query.
[drm] amdgpu: irq initialized.
Can't find requested voltage id in vdd_dep_on_sclk table!
amdgpu: powerplay initialized
[drm] Connector DP-1: get mode from tunables:
[drm]   - kern.vt.fb.modes.DP-1
[drm]   - kern.vt.fb.default_mode
[drm] Connector DP-2: get mode from tunables:
[drm]   - kern.vt.fb.modes.DP-2
[drm]   - kern.vt.fb.default_mode
[drm] Connector HDMI-A-1: get mode from tunables:
[drm]   - kern.vt.fb.modes.HDMI-A-1
[drm]   - kern.vt.fb.default_mode
[drm] Connector HDMI-A-2: get mode from tunables:
[drm]   - kern.vt.fb.modes.HDMI-A-2
[drm]   - kern.vt.fb.default_mode
[drm] Connector DVI-D-1: get mode from tunables:
[drm]   - kern.vt.fb.modes.DVI-D-1
[drm]   - kern.vt.fb.default_mode
[drm] AMDGPU Display Connectors
[drm] Connector 0:
[drm]   DP-1
[drm]   HPD1
[drm]   DDC: 0x486c 0x486c 0x486d 0x486d 0x486e 0x486e 0x486f 0x486f
[drm]   Encoders:
[drm]     DFP1: INTERNAL_UNIPHY1
[drm] Connector 1:
[drm]   DP-2
[drm]   HPD5
[drm]   DDC: 0x4874 0x4874 0x4875 0x4875 0x4876 0x4876 0x4877 0x4877
[drm]   Encoders:
[drm]     DFP2: INTERNAL_UNIPHY1
[drm] Connector 2:
[drm]   HDMI-A-1
[drm]   HPD6
[drm]   DDC: 0x4868 0x4868 0x4869 0x4869 0x486a 0x486a 0x486b 0x486b
[drm]   Encoders:
[drm]     DFP3: INTERNAL_UNIPHY2
[drm] Connector 3:
[drm]   HDMI-A-2
[drm]   HPD4
[drm]   DDC: 0x4870 0x4870 0x4871 0x4871 0x4872 0x4872 0x4873 0x4873
[drm]   Encoders:
[drm]     DFP4: INTERNAL_UNIPHY2
[drm] Connector 4:
[drm]   DVI-D-1
[drm]   HPD3
[drm]   DDC: 0x487c 0x487c 0x487d 0x487d 0x487e 0x487e 0x487f 0x487f
[drm]   Encoders:
[drm]     DFP5: INTERNAL_UNIPHY
amdgpu/polaris10_pfp.bin: could not load firmware image, error 2
amdgpu/polaris10_pfp.bin: could not load firmware image, error 2
amdgpu/polaris10_me.bin: could not load firmware image, error 2
amdgpu/polaris10_me.bin: could not load firmware image, error 2
amdgpu/polaris10_ce.bin: could not load firmware image, error 2
amdgpu/polaris10_ce.bin: could not load firmware image, error 2
amdgpu/polaris10_rlc.bin: could not load firmware image, error 2
amdgpu/polaris10_rlc.bin: could not load firmware image, error 2
amdgpu/polaris10_mec.bin: could not load firmware image, error 2
amdgpu/polaris10_mec.bin: could not load firmware image, error 2
amdgpu/polaris10_mec2.bin: could not load firmware image, error 2
amdgpu/polaris10_mec2.bin: could not load firmware image, error 2
drmn0: fence driver on ring 0 use gpu addr 0x0000000200000008, cpu addr 0x0xfffff80074106008
drmn0: fence driver on ring 1 use gpu addr 0x0000000200000018, cpu addr 0x0xfffff80074106018
drmn0: fence driver on ring 2 use gpu addr 0x0000000200000028, cpu addr 0x0xfffff80074106028
drmn0: fence driver on ring 3 use gpu addr 0x0000000200000038, cpu addr 0x0xfffff80074106038
drmn0: fence driver on ring 4 use gpu addr 0x0000000200000048, cpu addr 0x0xfffff80074106048
drmn0: fence driver on ring 5 use gpu addr 0x0000000200000058, cpu addr 0x0xfffff80074106058
drmn0: fence driver on ring 6 use gpu addr 0x0000000200000068, cpu addr 0x0xfffff80074106068
drmn0: fence driver on ring 7 use gpu addr 0x0000000200000078, cpu addr 0x0xfffff80074106078
drmn0: fence driver on ring 8 use gpu addr 0x0000000200000088, cpu addr 0x0xfffff80074106088
amdgpu/polaris10_sdma.bin: could not load firmware image, error 2
amdgpu/polaris10_sdma.bin: could not load firmware image, error 2
amdgpu/polaris10_sdma1.bin: could not load firmware image, error 2
amdgpu/polaris10_sdma1.bin: could not load firmware image, error 2
drmn0: fence driver on ring 9 use gpu addr 0x0000000200000098, cpu addr 0x0xfffff80074106098
drmn0: fence driver on ring 10 use gpu addr 0x00000002000000a8, cpu addr 0x0xfffff800741060a8
amdgpu/polaris10_uvd.bin: could not load firmware image, error 2
amdgpu/polaris10_uvd.bin: could not load firmware image, error 2
[drm] Found UVD firmware Version: 1.130 Family ID: 16
drmn0: fence driver on ring 11 use gpu addr 0x0000000002086a80, cpu addr 0x0xfffff800e2086a80
amdgpu/polaris10_vce.bin: could not load firmware image, error 2
amdgpu/polaris10_vce.bin: could not load firmware image, error 2
[drm] Found VCE firmware Version: 52.4 Binary ID: 3
drmn0: fence driver on ring 12 use gpu addr 0x00000002000000c8, cpu addr 0x0xfffff800741060c8
drmn0: fence driver on ring 13 use gpu addr 0x00000002000000d8, cpu addr 0x0xfffff800741060d8
amdgpu/polaris10_smc.bin: could not load firmware image, error 2
amdgpu/polaris10_smc.bin: could not load firmware image, error 2
[AVFS] Something is broken. See log!
failed to send message 254 ret is 0 
VDDCI is larger than max VDDCI in VDDCI Voltage Table!

failed to send pre message 14a ret is 0 

failed to send message 14a ret is 0 

failed to send pre message 5d ret is 0 

failed to send message 5d ret is 0 

failed to send pre message 109 ret is 0 

failed to send message 109 ret is 0 

failed to send pre message 62 ret is 0 

failed to send message 62 ret is 0 

failed to send pre message 18f ret is 0 

failed to send message 18f ret is 0 

failed to send pre message 301 ret is 0 

failed to send message 301 ret is 0 

failed to send pre message 109 ret is 0 

failed to send message 109 ret is 0 

failed to send pre message 14e ret is 0 

failed to send message 14e ret is 0 

failed to send pre message 150 ret is 0 

failed to send message 150 ret is 0 

failed to send pre message 136 ret is 0 

failed to send message 136 ret is 0 

failed to send pre message 53 ret is 0 

failed to send message 53 ret is 0 

failed to send pre message 169 ret is 0 

failed to send message 169 ret is 0 

failed to send pre message 185 ret is 0 

failed to send message 185 ret is 0 

failed to send pre message 187 ret is 0 

failed to send message 187 ret is 0 

failed to send pre message 188 ret is 0 

failed to send message 188 ret is 0 

failed to send pre message 10a ret is 0 

failed to send message 10a ret is 0 

failed to send pre message 305 ret is 0 

failed to send message 305 ret is 0 

failed to send pre message 26a ret is 0 

failed to send message 26a ret is 0 

failed to send pre message 209 ret is 0 

failed to send message 209 ret is 0 

failed to send pre message 206 ret is 0 

failed to send message 206 ret is 0 

failed to send pre message 5b ret is 0 

failed to send message 5b ret is 0 

failed to send pre message 205 ret is 0 

failed to send message 205 ret is 0 

failed to send pre message 20a ret is 0 

failed to send message 20a ret is 0 
[drm:gfx_v8_0_ring_test_ring] amdgpu: ring 0 test failed (scratch(0xC040)=0xCAFEDEAD)
[drm:amdgpu_init] hw_init of IP block <gfx_v8_0> failed -22
drmn0: amdgpu_init failed

failed to send pre message 133 ret is 0 

failed to send message 133 ret is 0 
DPM is not running right now, no need to disable DPM!

failed to send pre message 261 ret is 0 

failed to send message 261 ret is 0 

failed to send pre message 261 ret is 0 

failed to send message 261 ret is 0 

failed to send pre message 261 ret is 0 

failed to send message 261 ret is 0 

failed to send pre message 261 ret is 0 

failed to send message 261 ret is 0 

failed to send pre message 261 ret is 0 

failed to send message 261 ret is 0 

failed to send pre message 261 ret is 0 

failed to send message 261 ret is 0 

failed to send pre message 261 ret is 0 

failed to send message 261 ret is 0 

failed to send pre message 261 ret is 0 

failed to send message 261 ret is 0 

failed to send pre message 261 ret is 0 

failed to send message 261 ret is 0 

failed to send pre message 261 ret is 0 

failed to send message 261 ret is 0 
[TTM] Finalizing pool allocator
Zone  kernel: Used memory at exit: 816 kiB
Zone   dma32: Used memory at exit: 816 kiB
[drm] amdgpu: ttm finalized
drmn0: Fatal error during GPU init
[drm] amdgpu: finishing device.
[TTM] Memory type 2 has not been initialized
device_attach: drmn0 attach returned 22
```


----------



## abishai (May 28, 2018)

I believe, the correct driver location is /boot/modules/amdgpu.ko


----------



## pestslent1 (May 29, 2018)

I changed rc.conf to  "kld_list="/boot/modules/amdgpu.ko"", it did not seem to change anything. 
I stumbled upon "https://github.com/FreeBSDDesktop/DEPRECATED-freebsd-base-graphics/issues/158".
I added "hw.syscons.disable=1" to my loader.conf to disable efifb, and bobs your uncle. 
Ran glmark2 and got a score of 5036 at 1920x1080 (not really sure if that is good or bad)
Anyhow I have a desktop, thank you to all who helped.


----------



## slackz (May 31, 2018)

pestslent1  Fantastic!  Thanks for opening this thread; and thanks others for your responses.   
Just want to confirm this worked nicely for me.  AMD Radeon RX 580, on FreeBSD 11.2-BETA3 now, installed drm-stable-kmod port, and added the following lines:


```
# /etc/rc.conf
kld_list="amdgpu"

# /boot/loader.conf
hw.syscons.disable="1"
```

rebooted and startx worked like a charm!
Thanks jmd and other FreeBSD maintainers for all your work.  So excited to get FreeBSD rolling as my main desktop system!


----------



## cabriofahrer (Jun 7, 2018)

Although I am an Nvidia user, I am always interested in knowing about support for the latest AMD cards, so thanks for this thread! Still got a few questions, though:

What version of Opengl are you getting with this?
Can you run the unigine benchmark?
Can you run a game like Crysis (works fine with wine/nvidia)?
Does hardware video decoding work now with the new drm?


----------



## pestslent1 (Jun 7, 2018)

3.1 Mesa 18.1.0  (mentions DRM 3.8.0)
no unigine (pkg and ports seem to be removed) glmark2 score at 1920 x 1080 =4954 (11.2 rc1 and kde5)
I do not play games, so I can't help there
I use handbrake (I think that uses cpu though) What is available in fresh ports, I am willing to try it out ( I do not know what the "new drm" is ( I know it's digital right management))
The glmark2 info shows DRM 3.8.0


----------



## cabriofahrer (Jun 14, 2018)

pestslent1 said:


> 3.1 Mesa 18.1.0 (mentions DRM 3.8.0)



Thanks for the info. I also found this:

https://mesa3d.org/relnotes/18.1.0.html

So in theory OpenGL 4.5 should be possible, depending on the driver. So it looks like in spite of drm-next there is no point in buying an amd-card capable of doing more than OpenGL 3.1 when using FreeBSD, what a pity. Thank god there is official support by Nvidia for FreeBSD...


----------



## D-FENS (Jun 17, 2018)

I have an AMD RX580 card and I got the same problem like pestslent1, the amdgpu driver cannot load its firmware.
I am able to start X, however, the graphic is rendered through the modesetting driver and it's really slow. Videos are impossible to watch.
I installed FreeBSD 11.2-RC3, amdx64.
xf86-video-amdgpu and drm-stable-kmod are installed, also lang/clover for OpenCL support.

I also added as suggested above:
# /boot/loader.conf
hw.syscons.disable=1
# /etc/rc.conf
kld_list="amdgpu"

While it helps that I can start X and KDE4, X uses the wrong driver and amdgpu still has the firmware problem.

Any suggestions?

Here is the dmesg log:

```
# dmesg
...
[drm] amdgpu kernel modesetting enabled.
drmn0: <drmn> on vgapci0
vgapci0: child drmn0 requested pci_enable_io
vgapci0: child drmn0 requested pci_enable_io
[drm] initializing kernel modesetting (POLARIS10 0x1002:0x67DF 0x1DA2:0xE366 0xE7).
[drm] register mmio base: 0xED600000
[drm] register mmio size: 262144
[drm] doorbell mmio base: 0xE0000000
[drm] doorbell mmio size: 2097152
[drm] PCI I/O BAR is not found.
[drm] probing gen 2 caps for device 1022:1453 = 733903/e
[drm] probing mlw for device 1002:67df = 440903
[drm] UVD is enabled in VM mode
[drm] VCE enabled in VM mode
[drm] BIOS signature incorrect 0 0
[drm] PCI I/O BAR is not found. Using MMIO to access ATOM BIOS
ATOM BIOS: E366
[drm] GPU post is not needed
amdgpu/polaris10_mc.bin: could not load firmware image, error 2
ugen3.4: <vendor 0x046d Gaming Keyboard> at usbus3 (disconnected)
ukbd2: at uhub4, port 1, addr 3 (disconnected)
ukbd2: detached
amdgpu/polaris10_mc.bin: could not load firmware image, error 2
drmn0: VRAM: 8192M 0x0000000000000000 - 0x00000001FFFFFFFF (8192M used)
drmn0: GTT: 8192M 0x0000000200000000 - 0x00000003FFFFFFFF
[drm] Detected VRAM RAM=8192M, BAR=256M
[drm] RAM width 256bits GDDR5
[TTM] Zone  kernel: Available graphics memory: 33469468 kiB
[TTM] Zone   dma32: Available graphics memory: 2097152 kiB
[TTM] Initializing pool allocator
[drm] amdgpu: 8192M of VRAM memory ready
[drm] amdgpu: 8192M of GTT memory ready.
i_size_write unimplemented
[drm] GART: num cpu pages 2097152, num gpu pages 2097152
[drm] PCIE GART of 8192M enabled (table at 0x0000000000040000).
[drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[drm] Driver supports precise vblank timestamp query.
[drm] amdgpu: irq initialized.
amdgpu: [powerplay] amdgpu: powerplay sw initialized
[drm] Connector DP-1: get mode from tunables:
[drm]   - kern.vt.fb.modes.DP-1
[drm]   - kern.vt.fb.default_mode
[drm] Connector DP-2: get mode from tunables:
[drm]   - kern.vt.fb.modes.DP-2
[drm]   - kern.vt.fb.default_mode
[drm] Connector HDMI-A-1: get mode from tunables:
[drm]   - kern.vt.fb.modes.HDMI-A-1
[drm]   - kern.vt.fb.default_mode
[drm] Connector HDMI-A-2: get mode from tunables:
[drm]   - kern.vt.fb.modes.HDMI-A-2
[drm]   - kern.vt.fb.default_mode
[drm] Connector DVI-D-1: get mode from tunables:
[drm]   - kern.vt.fb.modes.DVI-D-1
[drm]   - kern.vt.fb.default_mode
[drm] AMDGPU Display Connectors
[drm] Connector 0:
[drm]   DP-1
[drm]   HPD6
[drm]   DDC: 0x4868 0x4868 0x4869 0x4869 0x486a 0x486a 0x486b 0x486b
[drm]   Encoders:
[drm]     DFP1: INTERNAL_UNIPHY2
[drm] Connector 1:
[drm]   DP-2
[drm]   HPD4
[drm]   DDC: 0x4870 0x4870 0x4871 0x4871 0x4872 0x4872 0x4873 0x4873
[drm]   Encoders:
[drm]     DFP2: INTERNAL_UNIPHY2
[drm] Connector 2:
[drm]   HDMI-A-1
[drm]   HPD1
[drm]   DDC: 0x486c 0x486c 0x486d 0x486d 0x486e 0x486e 0x486f 0x486f
[drm]   Encoders:
[drm]     DFP3: INTERNAL_UNIPHY1
[drm] Connector 3:
[drm]   HDMI-A-2
[drm]   HPD5
[drm]   DDC: 0x4874 0x4874 0x4875 0x4875 0x4876 0x4876 0x4877 0x4877
[drm]   Encoders:
[drm]     DFP4: INTERNAL_UNIPHY1
[drm] Connector 4:
[drm]   DVI-D-1
[drm]   HPD3
[drm]   DDC: 0x487c 0x487c 0x487d 0x487d 0x487e 0x487e 0x487f 0x487f
[drm]   Encoders:
[drm]     DFP5: INTERNAL_UNIPHY
amdgpu/polaris10_pfp.bin: could not load firmware image, error 2
ugen3.5: <vendor 0x046d G11 Keyboard> at usbus3 (disconnected)
uhub4: detached
uhub1: <0x1022 XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus3
amdgpu/polaris10_pfp.bin: could not load firmware image, error 2
uhub1: 8 ports with 8 removable, self powered
amdgpu/polaris10_me.bin: could not load firmware image, error 2
amdgpu/polaris10_me.bin: could not load firmware image, error 2
ugen3.2: <Razer Razer DeathAdder 2013> at usbus3
ukbd0 on uhub1
ukbd0: <Razer Razer DeathAdder 2013, class 0/0, rev 2.00/2.00, addr 1> on usbus3
kbd2 at ukbd0
ukbd1 on uhub1
ukbd1: <Razer Razer DeathAdder 2013, class 0/0, rev 2.00/2.00, addr 1> on usbus3
kbd3 at ukbd1
amdgpu/polaris10_ce.bin: could not load firmware image, error 2
amdgpu/polaris10_ce.bin: could not load firmware image, error 2
ugen3.3: <vendor 0x046d G11 Keyboard> at usbus3
uhub4 on uhub1
uhub4: <vendor 0x046d G11 Keyboard, class 9/0, rev 1.10/1.71, addr 2> on usbus3
amdgpu/polaris10_rlc.bin: could not load firmware image, error 2
uhub4: 4 ports with 2 removable, bus powered
amdgpu/polaris10_rlc.bin: could not load firmware image, error 2
amdgpu/polaris10_mec.bin: could not load firmware image, error 2
ugen3.4: <vendor 0x046d Gaming Keyboard> at usbus3
ukbd2 on uhub4
ukbd2: <vendor 0x046d Gaming Keyboard, class 0/0, rev 2.00/1.90, addr 3> on usbus3
kbd4 at ukbd2
amdgpu/polaris10_mec.bin: could not load firmware image, error 2
amdgpu/polaris10_mec2.bin: could not load firmware image, error 2
ugen3.5: <vendor 0x046d G11 Keyboard> at usbus3
amdgpu/polaris10_mec2.bin: could not load firmware image, error 2
drmn0: fence driver on ring 0 use gpu addr 0x0000000200000008, cpu addr 0x0xfffff8005175b008
i_size_write unimplemented
drmn0: fence driver on ring 1 use gpu addr 0x0000000200000018, cpu addr 0x0xfffff8005175b018
i_size_write unimplemented
drmn0: fence driver on ring 2 use gpu addr 0x0000000200000028, cpu addr 0x0xfffff8005175b028
i_size_write unimplemented
drmn0: fence driver on ring 3 use gpu addr 0x0000000200000038, cpu addr 0x0xfffff8005175b038
i_size_write unimplemented
drmn0: fence driver on ring 4 use gpu addr 0x0000000200000048, cpu addr 0x0xfffff8005175b048
i_size_write unimplemented
drmn0: fence driver on ring 5 use gpu addr 0x0000000200000058, cpu addr 0x0xfffff8005175b058
i_size_write unimplemented
drmn0: fence driver on ring 6 use gpu addr 0x0000000200000068, cpu addr 0x0xfffff8005175b068
i_size_write unimplemented
drmn0: fence driver on ring 7 use gpu addr 0x0000000200000078, cpu addr 0x0xfffff8005175b078
i_size_write unimplemented
drmn0: fence driver on ring 8 use gpu addr 0x0000000200000088, cpu addr 0x0xfffff8005175b088
i_size_write unimplemented
drmn0: fence driver on ring 9 use gpu addr 0x0000000200000098, cpu addr 0x0xfffff8005175b098
i_size_write unimplemented
amdgpu/polaris10_sdma.bin: could not load firmware image, error 2
amdgpu/polaris10_sdma.bin: could not load firmware image, error 2
amdgpu/polaris10_sdma1.bin: could not load firmware image, error 2
amdgpu/polaris10_sdma1.bin: could not load firmware image, error 2
drmn0: fence driver on ring 10 use gpu addr 0x00000002000000a8, cpu addr 0x0xfffff8005175b0a8
i_size_write unimplemented
drmn0: fence driver on ring 11 use gpu addr 0x00000002000000b8, cpu addr 0x0xfffff8005175b0b8
i_size_write unimplemented
amdgpu/polaris10_uvd.bin: could not load firmware image, error 2
amdgpu/polaris10_uvd.bin: could not load firmware image, error 2
[drm] Found UVD firmware Version: 1.130 Family ID: 16
drmn0: fence driver on ring 12 use gpu addr 0x0000000001166a80, cpu addr 0x0xfffff800d1166a80
i_size_write unimplemented
amdgpu/polaris10_vce.bin: could not load firmware image, error 2
amdgpu/polaris10_vce.bin: could not load firmware image, error 2
[drm] Found VCE firmware Version: 52.4 Binary ID: 3
drmn0: fence driver on ring 13 use gpu addr 0x00000002000000d8, cpu addr 0x0xfffff8005175b0d8
i_size_write unimplemented
drmn0: fence driver on ring 14 use gpu addr 0x00000002000000e8, cpu addr 0x0xfffff8005175b0e8
i_size_write unimplemented
amdgpu/polaris10_k_smc.bin: could not load firmware image, error 2
amdgpu/polaris10_k_smc.bin: could not load firmware image, error 2
amdgpu: [powerplay] [AVFS] Something is broken. See log!
amdgpu: [powerplay] Can't find requested voltage id in vdd_dep_on_sclk table!
[drm] ring test on 1 succeeded in 22 usecs
[drm] ring test on 2 succeeded in 48 usecs
[drm] ring test on 3 succeeded in 38 usecs
[drm] ring test on 4 succeeded in 15 usecs
[drm] ring test on 5 succeeded in 15 usecs
[drm] ring test on 6 succeeded in 15 usecs
[drm] ring test on 7 succeeded in 14 usecs
[drm] ring test on 8 succeeded in 15 usecs
[drm] ring test on 9 succeeded in 15 usecs
[drm] ring test on 10 succeeded in 7 usecs
[drm] ring test on 11 succeeded in 7 usecs
[drm] ring test on 12 succeeded in 1 usecs
[drm] UVD initialized successfully.
[drm] ring test on 13 succeeded in 10 usecs
[drm] ring test on 14 succeeded in 5 usecs
[drm] VCE initialized successfully.
[drm] fb mappable at 0xD14E7000
[drm] vram apper at 0xD0000000
[drm] size 14745600
[drm] fb depth is 24
[drm]    pitch is 10240
VT: Replacing driver "vga" with new "fb".
start FB_INFO:
type=11 height=1440 width=2560 depth=32
cmsize=16 size=14745600
pbase=0xd14e7000 vbase=0xfffff800d14e7000
name=drmn0 flags=0x0 stride=10240 bpp=32
cmap[0]=0 cmap[1]=7f0000 cmap[2]=7f00 cmap[3]=c4a000
end FB_INFO
drmn0: fb0: amdgpudrmfb frame buffer device
[drm] ib test on ring 1 succeeded
[drm] ib test on ring 2 succeeded
[drm] ib test on ring 3 succeeded
[drm] ib test on ring 4 succeeded
[drm] ib test on ring 5 succeeded
[drm] ib test on ring 6 succeeded
[drm] ib test on ring 7 succeeded
[drm] ib test on ring 8 succeeded
[drm] ib test on ring 9 succeeded
[drm] ib test on ring 10 succeeded
[drm] ib test on ring 11 succeeded
[drm] ib test on ring 12 succeeded
[drm] ib test on ring 13 succeeded
[drm] registered fictitious range 0xd0000000-0xe0000000
i_size_write unimplemented
[drm] Initialized amdgpu 3.10.0 20150101 for drmn0 on minor 0
```

Inside Xorg log:

```
[    24.017] (==) ModulePath set to "/usr/local/lib/xorg/modules"
[    24.017] (II) The server relies on devd to provide the list of input devices.
        If no devices become available, reconfigure devd or disable AutoAddDevices.
[    24.017] (II) Loader magic: 0x80fe80
[    24.017] (II) Module ABI versions:
[    24.017]    X.Org ANSI C Emulation: 0.4
[    24.017]    X.Org Video Driver: 20.0
[    24.017]    X.Org XInput driver : 22.1
[    24.017]    X.Org Server Extension : 9.0
[    24.017] (--) PCI:*(0:66:0:0) 1002:67df:1da2:e366 rev 231, Mem @ 0xd0000000/268435456, 0xe0000000/2097152, 0xed600000/262144, I/O @ 0x0000e000/256, BIOS @ 0x????????/65536
[    24.017] (II) LoadModule: "glx"
[    24.017] (II) Loading /usr/local/lib/xorg/modules/extensions/libglx.so
[    24.025] (II) Module glx: vendor="X.Org Foundation"
[    24.025]    compiled for 1.18.4, module version = 1.0.0
[    24.025]    ABI class: X.Org Server Extension, version 9.0
[    24.025] (==) AIGLX enabled
[    24.025] (==) Matched ati as autoconfigured driver 0
[    24.025] (==) Matched modesetting as autoconfigured driver 1
[    24.025] (==) Matched scfb as autoconfigured driver 2
[    24.025] (==) Matched vesa as autoconfigured driver 3
[    24.025] (==) Assigned the driver to the xf86ConfigLayout
[    24.025] (II) LoadModule: "ati"
[    24.025] (WW) Warning, couldn't open module ati
[    24.025] (II) UnloadModule: "ati"
[    24.025] (II) Unloading ati
[    24.025] (EE) Failed to load module "ati" (module does not exist, 0)
[    24.025] (II) LoadModule: "modesetting"
[    24.025] (II) Loading /usr/local/lib/xorg/modules/drivers/modesetting_drv.so
[    24.026] (II) Module modesetting: vendor="X.Org Foundation"
[    24.026]    compiled for 1.18.4, module version = 1.18.4
[    24.026]    Module class: X.Org Video Driver
[    24.026]    ABI class: X.Org Video Driver, version 20.0
[    24.026] (II) LoadModule: "scfb"
[    24.026] (II) Loading /usr/local/lib/xorg/modules/drivers/scfb_drv.so
[    24.026] (II) Module scfb: vendor="X.Org Foundation"
[    24.026]    compiled for 1.18.4, module version = 0.0.4
[    24.026]    ABI class: X.Org Video Driver, version 20.0
[    24.026] (II) LoadModule: "vesa"
[    24.026] (II) Loading /usr/local/lib/xorg/modules/drivers/vesa_drv.so
[    24.027] (II) Module vesa: vendor="X.Org Foundation"
[    24.027]    compiled for 1.18.4, module version = 2.4.0
[    24.027]    Module class: X.Org Video Driver
[    24.027]    ABI class: X.Org Video Driver, version 20.0
[    24.027] (II) modesetting: Driver for Modesetting Kernel Drivers: kms
[    24.027] (II) scfb: driver for wsdisplay framebuffer: scfb
[    24.027] (II) VESA: driver for VESA chipsets: vesa
[    24.027] (--) Using syscons driver with X support (version 2.0)
[    24.027] (--) using VT number 9

[    24.031] (**) modeset(0): claimed PCI slot 66@0:0:0
[    24.031] (II) modeset(0): using default device
[    24.031] (WW) Falling back to old probe method for scfb
[    24.031] scfb trace: probe start
[    24.031] scfb trace: probe done
[    24.031] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support
[    24.033] (II) modeset(0): Creating default Display subsection in Screen section
        "Default Screen Section" for depth/fbbpp 24/32
[    24.033] (==) modeset(0): Depth 24, (==) framebuffer bpp 32
[    24.033] (==) modeset(0): RGB weight 888
[    24.033] (==) modeset(0): Default visual is TrueColor
[    24.033] (II) Loading sub module "glamoregl"
[    24.033] (II) LoadModule: "glamoregl"
[    24.034] (II) Loading /usr/local/lib/xorg/modules/libglamoregl.so
[    24.042] (II) Module glamoregl: vendor="X.Org Foundation"
[    24.042]    compiled for 1.18.4, module version = 1.0.0
[    24.042]    ABI class: X.Org ANSI C Emulation, version 0.4
[    24.042] (II) glamor: OpenGL accelerated X.org driver based.
[    24.269] (II) glamor: EGL version 1.5 (DRI2):
[    24.276] (II) modeset(0): glamor initialized
```

clinfo:

```
# clinfo
amdgpu_device_initialize: amdgpu_get_auth (1) failed (-1)
amdgpu: amdgpu_device_initialize failed.
do_winsys_init: DRM version is 3.10.0 but this driver is only compatible with 2.12.0 (kernel 3.2) or later.
Number of platforms                               1
  Platform Name                                   Clover
  Platform Vendor                                 Mesa
  Platform Version                                OpenCL 1.1 Mesa 17.3.9
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_icd
  Platform Extensions function suffix             MESA

  Platform Name                                   Clover
Number of devices                                 0

NULL platform behavior
  clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  Clover
  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   Clover
  clCreateContext(NULL, ...) [default]            No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL)  No devices found in platform

ICD loader properties
  ICD loader Name                                 OpenCL ICD Loader
  ICD loader Vendor                               OCL Icd free software
  ICD loader Version                              2.2.11
  ICD loader Profile                              OpenCL 2.1
```


```
# find /boot/modules | grep -i polaris   
/boot/modules/amdgpu_polaris10_smc_sk_bin.ko
/boot/modules/amdgpu_polaris11_ce_2_bin.ko
/boot/modules/amdgpu_polaris11_uvd_bin.ko
/boot/modules/amdgpu_polaris11_mec_2_bin.ko
/boot/modules/amdgpu_polaris10_mec_2_bin.ko
/boot/modules/amdgpu_polaris12_mec_2_bin.ko
/boot/modules/amdgpu_polaris11_ce_bin.ko
/boot/modules/amdgpu_polaris11_sdma_bin.ko
/boot/modules/amdgpu_polaris11_rlc_bin.ko
/boot/modules/amdgpu_polaris10_ce_bin.ko
/boot/modules/amdgpu_polaris11_vce_bin.ko
/boot/modules/amdgpu_polaris12_ce_bin.ko
/boot/modules/amdgpu_polaris10_k_smc_bin.ko
/boot/modules/amdgpu_polaris11_mec2_2_bin.ko
/boot/modules/amdgpu_polaris11_k_smc_bin.ko
/boot/modules/amdgpu_polaris11_mec2_bin.ko
/boot/modules/amdgpu_polaris11_pfp_bin.ko
/boot/modules/amdgpu_polaris11_smc_bin.ko
/boot/modules/amdgpu_polaris11_me_2_bin.ko
/boot/modules/amdgpu_polaris11_mec_bin.ko
/boot/modules/amdgpu_polaris10_me_bin.ko
/boot/modules/amdgpu_polaris12_me_2_bin.ko
/boot/modules/amdgpu_polaris11_me_bin.ko
/boot/modules/amdgpu_polaris12_me_bin.ko
/boot/modules/amdgpu_polaris10_mec2_2_bin.ko
/boot/modules/amdgpu_polaris10_mec_bin.ko
/boot/modules/amdgpu_polaris10_sdma_bin.ko
/boot/modules/amdgpu_polaris10_smc_bin.ko
/boot/modules/amdgpu_polaris10_pfp_bin.ko
/boot/modules/amdgpu_polaris12_mec2_bin.ko
/boot/modules/amdgpu_polaris10_rlc_bin.ko
/boot/modules/amdgpu_polaris10_me_2_bin.ko
/boot/modules/amdgpu_polaris12_pfp_2_bin.ko
/boot/modules/amdgpu_polaris10_mec2_bin.ko
/boot/modules/amdgpu_polaris10_pfp_2_bin.ko
/boot/modules/amdgpu_polaris12_uvd_bin.ko
/boot/modules/amdgpu_polaris12_sdma_bin.ko
/boot/modules/amdgpu_polaris10_vce_bin.ko
/boot/modules/amdgpu_polaris11_pfp_2_bin.ko
/boot/modules/amdgpu_polaris12_sdma1_bin.ko
/boot/modules/amdgpu_polaris12_pfp_bin.ko
/boot/modules/amdgpu_polaris10_sdma1_bin.ko
/boot/modules/amdgpu_polaris12_mec_bin.ko
/boot/modules/amdgpu_polaris10_ce_2_bin.ko
/boot/modules/amdgpu_polaris11_sdma1_bin.ko
/boot/modules/amdgpu_polaris12_smc_bin.ko
/boot/modules/amdgpu_polaris11_mc_bin.ko
/boot/modules/amdgpu_polaris12_mec2_2_bin.ko
/boot/modules/amdgpu_polaris10_mc_bin.ko
/boot/modules/amdgpu_polaris12_rlc_bin.ko
/boot/modules/amdgpu_polaris12_ce_2_bin.ko
/boot/modules/amdgpu_polaris11_smc_sk_bin.ko
/boot/modules/amdgpu_polaris12_vce_bin.ko
/boot/modules/amdgpu_polaris12_mc_bin.ko
/boot/modules/amdgpu_polaris10_uvd_bin.ko
```


----------



## D-FENS (Jun 17, 2018)

Hm, I have an idea. It seems amdgpu.ko is searching for firmware files looking like this:
amdgpu/polaris10_mc.bin: could not load firmware image, error 2

However, the modules I can find look more like this:
/boot/modules/amdgpu_polaris10_ce_bin.ko

So instead of amdgpu/polaris10_mc.bin, the driver should be trying to load amdgpu_polaris10_mc_bin, shouldn't it?


----------



## pestslent1 (Jun 20, 2018)

Will "hw.syscons.disable="1" in loader.conf still be necessary when the release version of 11.2 is released?


----------



## D-FENS (Jul 2, 2018)

Hello pestslent1,

Could you please post your configuration? It seems you were able to resolve the issue and start Xorg with amdgpu. I tried copying your configuration but I am unable to load amdgpu. It shows errors about missing firmware (see above).
I would be very thankful if you could post the configuration that worked for you, including:
- version of amdgpu
- version of drm-stable-kmod (or drm-next-kmod)
- FreeBSD version (I believe you use 11.2-RC3, correct?)
- /boot/loader.conf
- /etc/rc.conf
- any Xorg configuration files.

If there is interest, I could post mine, but as written above - they do not work at the moment. I followed the instructions as described above and I use FreeBSD 11.2-RC3.

Thanks in advance for taking the time to share your experience.


----------



## MYXOMOP (Jul 3, 2018)

I really like the idea of having a relatively powerful card in a completely open system like FreeBSD without having to install any proprietary binary blob to make it work. So I tried my luck with my RX580 and the newly released 11.2.

I'm having a comparable problem as *roccobaroccoSC*. A fresh install of 11.2 and using amgdpu on RX 580. Also tried an older radeon card - RX 460 with the same results. All installed from ports. Loading a plasma desktop using SDDM works fine and relatively out of the box. I modified /boot/loader.conf and /etc/rc.conf according to this thread. KDE starts, however there are no animations and moving windows around is unbearably slow. Is it a driver issue or is it a compositing issue? 
Any ideas and help greatly appreciated!

PS: This machine is for experimenting purposes currently so I can provide/tweak any info/setting if required.


----------



## MYXOMOP (Jul 4, 2018)

While experimenting further, I stumbled upon the following errors in dmesg:

`dmesg | grep amd -s3
        The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 11.2-RELEASE #0 r335510: Fri Jun 22 04:32:14 UTC 2018
    root@releng2.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64
FreeBSD clang version 6.0.0 (tags/RELEASE_600/final 326565) (based on LLVM 6.0.0)
VT(vga): resolution 640x480
CPU: Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz (2593.81-MHz K8-class CPU)
--
[drm] Initialized
[drm] amdgpu kernel modesetting enabled.
drmn0: <drmn> numa-domain 0 on vgapci0
vgapci0: child drmn0 requested pci_enable_io
vgapci0: child drmn0 requested pci_enable_io
--
[drm] register mmio size: 262144
[drm] doorbell mmio base: 0xE0000000
[drm] doorbell mmio size: 2097152
[drm:amdgpu_device_init] Unable to find PCI I/O BAR
[drm] probing gen 2 caps for device 8086:3c08 = 7a7103/e
[drm] probing mlw for device 1002:67ef = 400883
[drm] UVD is enabled in VM mode
[drm] VCE enabled in VM mode
[drm:amdgpu_atombios_init] Unable to find PCI I/O BAR; using MMIO for ATOM IIO
ATOM BIOS: C99401
[drm] GPU post is not needed
amdgpu/polaris11_mc.bin: could not load firmware image, error 2
amdgpu/polaris11_mc.bin: could not load firmware image, error 2
Zone  kernel: Available graphics memory: 16718558 kiB
Zone   dma32: Available graphics memory: 2097152 kiB
[TTM] Initializing pool allocator
--
drmn0: GTT: 16326M 0x0000000100000000 - 0x00000004FC6B77FF
[drm] Detected VRAM RAM=4096M, BAR=256M
[drm] RAM width 128bits GDDR5
[drm] amdgpu: 4096M of VRAM memory ready
[drm] amdgpu: 16326M of GTT memory ready.
[drm] GART: num cpu pages 4179639, num gpu pages 4179639
[drm] PCIE GART of 16326M enabled (table at 0x0000000000040000).
[drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[drm] Driver supports precise vblank timestamp query.
[drm] amdgpu: irq initialized.
Can't find requested voltage id in vdd_dep_on_sclk table!
amdgpu: powerplay initialized
[drm] Connector DP-1: get mode from tunables:
[drm]   - kern.vt.fb.modes.DP-1
[drm]   - kern.vt.fb.default_mode
--
[drm]   DDC: 0x4878 0x4878 0x4879 0x4879 0x487a 0x487a 0x487b 0x487b
[drm]   Encoders:
[drm]     DFP3: INTERNAL_UNIPHY
amdgpu/polaris11_pfp.bin: could not load firmware image, error 2
amdgpu/polaris11_pfp.bin: could not load firmware image, error 2
amdgpu/polaris11_me.bin: could not load firmware image, error 2
amdgpu/polaris11_me.bin: could not load firmware image, error 2
amdgpu/polaris11_ce.bin: could not load firmware image, error 2
amdgpu/polaris11_ce.bin: could not load firmware image, error 2
amdgpu/polaris11_rlc.bin: could not load firmware image, error 2
amdgpu/polaris11_rlc.bin: could not load firmware image, error 2
amdgpu/polaris11_mec.bin: could not load firmware image, error 2
amdgpu/polaris11_mec.bin: could not load firmware image, error 2
amdgpu/polaris11_mec2.bin: could not load firmware image, error 2
amdgpu/polaris11_mec2.bin: could not load firmware image, error 2
drmn0: fence driver on ring 0 use gpu addr 0x0000000100000008, cpu addr 0x0xfffff80064ca7008
drmn0: fence driver on ring 1 use gpu addr 0x0000000100000018, cpu addr 0x0xfffff80064ca7018
drmn0: fence driver on ring 2 use gpu addr 0x0000000100000028, cpu addr 0x0xfffff80064ca7028
--
drmn0: fence driver on ring 6 use gpu addr 0x0000000100000068, cpu addr 0x0xfffff80064ca7068
drmn0: fence driver on ring 7 use gpu addr 0x0000000100000078, cpu addr 0x0xfffff80064ca7078
drmn0: fence driver on ring 8 use gpu addr 0x0000000100000088, cpu addr 0x0xfffff80064ca7088
amdgpu/polaris11_sdma.bin: could not load firmware image, error 2
amdgpu/polaris11_sdma.bin: could not load firmware image, error 2
amdgpu/polaris11_sdma1.bin: could not load firmware image, error 2
amdgpu/polaris11_sdma1.bin: could not load firmware image, error 2
drmn0: fence driver on ring 9 use gpu addr 0x0000000100000098, cpu addr 0x0xfffff80064ca7098
drmn0: fence driver on ring 10 use gpu addr 0x00000001000000a8, cpu addr 0x0xfffff80064ca70a8
amdgpu/polaris11_uvd.bin: could not load firmware image, error 2
amdgpu/polaris11_uvd.bin: could not load firmware image, error 2
[drm] Found UVD firmware Version: 1.130 Family ID: 16
drmn0: fence driver on ring 11 use gpu addr 0x0000000002081a80, cpu addr 0x0xfffff800d2081a80
amdgpu/polaris11_vce.bin: could not load firmware image, error 2
amdgpu/polaris11_vce.bin: could not load firmware image, error 2
[drm] Found VCE firmware Version: 52.4 Binary ID: 3
drmn0: fence driver on ring 12 use gpu addr 0x00000001000000c8, cpu addr 0x0xfffff80064ca70c8
drmn0: fence driver on ring 13 use gpu addr 0x00000001000000d8, cpu addr 0x0xfffff80064ca70d8
amdgpu/polaris11_smc.bin: could not load firmware image, error 2
amdgpu/polaris11_smc.bin: could not load firmware image, error 2
[AVFS] Something is broken. See log!<6>[drm] ring test on 0 succeeded in 21 usecs
[drm] ring test on 1 succeeded in 62 usecs
[drm] ring test on 2 succeeded in 32 usecs
--
name=drmn0 flags=0x0 stride=7680 bpp=32
cmap[0]=0 cmap[1]=7f0000 cmap[2]=7f00 cmap[3]=c4a000
end FB_INFO
drmn0: fb0: amdgpudrmfb frame buffer device
[drm] ib test on ring 0 succeeded
[drm] ib test on ring 1 succeeded
[drm] ib test on ring 2 succeeded
--
[drm] ib test on ring 11 succeeded
[drm] ib test on ring 12 succeeded
[drm] registered fictitious range 0xd0000000-0xe0000000
[drm] Initialized amdgpu 3.8.0 20150101 for drmn on minor 0`

It definitely appears that the direction of roccobaroccoSC is correct and that the firmware cannot be loaded. 

I also installed graphics/mesa-demos for the kicks of it. 

The output of glxinfo:
`LIBGL_DEBUG=verbose glxinfo | grep ren   
libGL: screen 0 does not appear to be DRI2 capable
libGL: OpenDriver: trying /usr/local/lib/dri/swrast_dri.so
libGL: Can't open configuration file /home/nick/.drirc: No such file or directory.
libGL: Can't open configuration file /home/nick/.drirc: No such file or directory.
direct rendering: Yes
    GLX_SGIX_visual_select_group, GLX_SGI_make_current_read
    GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer,  
    GLX_SGIX_visual_select_group, GLX_SGI_make_current_read,  
    GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer,  
    GLX_SGIX_pbuffer, GLX_SGIX_visual_select_group, GLX_SGI_make_current_read
Extended renderer info (GLX_MESA_query_renderer):
OpenGL renderer string: llvmpipe (LLVM 6.0, 256 bits)
    GL_ARB_conditional_render_inverted, GL_ARB_conservative_depth,  
    GL_NV_conditional_render, GL_NV_depth_clamp, GL_NV_packed_depth_stencil,  
    GL_ARB_conditional_render_inverted, GL_ARB_conservative_depth,  
    GL_NV_blend_square, GL_NV_conditional_render, GL_NV_depth_clamp,  
    GL_OES_element_index_uint, GL_OES_fbo_render_mipmap,`

As one can see there is no mention of radeon/amd.

The output of glxgears:
`glxgears
1122 frames in 5.0 seconds = 224.270 FPS
254 frames in 5.0 seconds = 50.766 FPS
246 frames in 5.0 seconds = 49.118 FPS
245 frames in 5.0 seconds = 48.915 FPS
229 frames in 5.0 seconds = 45.588 FPS
248 frames in 5.0 seconds = 49.589 FPS
243 frames in 5.0 seconds = 48.596 FPS
246 frames in 5.0 seconds = 49.100 FPS
247 frames in 5.0 seconds = 49.373 FPS
244 frames in 5.0 seconds = 48.615 FPS`

So all points to a wrong/fallback driver being loaded. My current setup:
- graphics/drm-stable-kmod
- graphics/gpu-firmware-kmod
- x11/xorg
- x11/kde5
- x11/sddm
- sysutils/hal
- graphics/mesa-demos

It seems that there is only a small piece of the puzzle missing... Any help is greatly appreciated! Thanks in advance


----------



## pestslent1 (Jul 4, 2018)

roccobaroccoSC said:


> Hello pestslent1,
> 
> Could you please post your configuration? It seems you were able to resolve the issue and start Xorg with amdgpu. I tried copying your configuration but I am unable to load amdgpu. It shows errors about missing firmware (see above).
> I would be very thankful if you could post the configuration that worked for you, including:
> ...


now on FreeBSD 11.2-RELEASE
Sadly I do not know how to find out :version of amdgpu"
No: drm-next-kmod

```
root@vmbsd:/usr/home/pete # pkg info drm-stable-kmod
drm-stable-kmod-g20180505_5
Name           : drm-stable-kmod
Version        : g20180505_5
Installed on   : Tue May 29 06:08:14 2018 EDT
Origin         : graphics/drm-stable-kmod
Architecture   : FreeBSD:11:amd64
Prefix         : /usr/local
Categories     : graphics kld
Licenses       : BSD2CLAUSE, MIT, GPLv2
Maintainer     : jmd@FreeBSD.org
WWW            : https://github.com/FreeBSDDesktop/kms-drm
Comment        : DRM modules for the linuxkpi-based KMS components
Options        :
        DEBUG          : off
Annotations    :
        FreeBSD_version: 1101515
Flat size      : 7.64MiB
Description    :
amdgpu, i915, and radeon DRM modules for the linuxkpi-based KMS components.
Currently corresponding to Linux 4.9 DRM. More stable state. amdgpu and
radeonkms are known to fail with EFI boot.

WWW: https://github.com/FreeBSDDesktop/kms-drm
```
rc.conf

```
zfs_enable="YES"
clear_tmp_enable="YES"
hostname="vmbsd"
ifconfig_re0="DHCP"
ifconfig_re0="inet 192.168.1.69 netmask 255.255.255.0"
defaultrouter="192.168.1.1"
sendmail_enable="NONE"
kld_list="/boot/modules/amdgpu.ko"
dbus_enable="YES"
hald_enable="YES"
sddm_enable="YES"
xrdp_enable="YES"
xrdp_sesman_enable="YES"
samba_server_enable="YES"
fuse_enable="YES"
vm_enable="YES"
vm_dir="/mnt/bhyve/HyperV"
vm_list="2012r2 vistadl 7bubsd"
vm_delay="10"
```

loader.conf

```
kern.vty=vt
zfs_load="YES"
fuse_load="YES"
kern.geom.label.disk_ident.enable="0"
kern.geom.label.gptid.enable="0"
vmm_load="YES"
nmdm_load="YES"
if_bridge_load="YES"
if_tap_load="YES"
hw.vmm.amdvi.enable=1
hw.vmm.topology.cores_per_package=4
#hw.vmm.topology.threads_per_core=2
pptdevs="40/0/0"
hw.syscons.disable="1"
```

not sure if this is relevant due to location
/etc/X11/xrdp//xorg .conf

```
Section "ServerLayout"
    Identifier "X11 Server"
    Screen "Screen (xrdpdev)"
    InputDevice "xrdpMouse" "CorePointer"
    InputDevice "xrdpKeyboard" "CoreKeyboard"
EndSection

Section "ServerFlags"
    Option "DontVTSwitch" "on"
    Option "AutoAddDevices" "off"
EndSection

Section "Module"
    Load "dbe"
    Load "ddc"
    Load "extmod"
    Load "glx"
    Load "int10"
    Load "record"
    Load "vbe"
    Load "xorgxrdp"
    Load "fb"
EndSection

Section "InputDevice"
    Identifier "xrdpKeyboard"
    Driver "xrdpkeyb"
EndSection

Section "InputDevice"
    Identifier "xrdpMouse"
    Driver "xrdpmouse"
EndSection

Section "Monitor"
    Identifier "Monitor"
    Option "DPMS"
    HorizSync 30-80
    VertRefresh 60-75
    ModeLine "1920x1080" 138.500 1920 1968 2000 2080 1080 1083 1088 1111 +hsync -vsync
    ModeLine "1280x720" 74.25 1280 1720 1760 1980 720 725 730 750 +HSync +VSync
    Modeline "1368x768" 72.25 1368 1416 1448 1528 768 771 781 790 +hsync -vsync
    Modeline "1600x900" 119.00 1600 1696 1864 2128 900 901 904 932 -hsync +vsync
EndSection

Section "Device"
    Identifier "Video Card (xrdpdev)"
    Driver "xrdpdev"
EndSection

Section "Screen"
    Identifier "Screen (xrdpdev)"
    Device "Video Card (xrdpdev)"
    Monitor "Monitor"
    DefaultDepth 24
    SubSection "Display"
        Depth 24
        Modes "640x480" "800x600" "1024x768" "1280x720" "1280x1024" "1600x900" "1920x1080"
    EndSubSection
EndSection
```

Not sure if relevant or necessary

```
root@vmbsd:/usr/home/pete # pkg info gpu-firmware-kmod
gpu-firmware-kmod-g20180319_1
Name           : gpu-firmware-kmod
Version        : g20180319_1
Installed on   : Tue May 29 06:08:13 2018 EDT
Origin         : graphics/gpu-firmware-kmod
Architecture   : FreeBSD:11:amd64
Prefix         : /usr/local
Categories     : graphics kld
Licenses       : AMD, INTEL
Maintainer     : jmd@FreeBSD.org
WWW            : https://github.com/FreeBSDDesktop/kms-firmware
Comment        : Firmware modules for the linuxkpi-based KMS components
Annotations    :
        FreeBSD_version: 1101515
Flat size      : 22.7MiB
Description    :
Firmware modules for the linuxkpi-based KMS components.

Amdgpu and i915 firmware files encoded in uu format to generate
loadable kernel modules. Firmware binaries originate from the
linux-firmware repository.

WWW: https://github.com/FreeBSDDesktop/kms-firmware
```


----------



## aimeec1995 (Jul 12, 2018)

I tried it last year and fought with it all week and got nowhere but good luck.


----------



## drhowarddrfine (Jul 12, 2018)

You should be turning to the manufacturer of the device and device driver for support, not FreeBSD. FreeBSD does not write device drivers.


----------



## MYXOMOP (Jul 16, 2018)

Thanks for the replies.

I managed to get it working. The culprit was that Xorg does not by default load the amdgpu X driver. But re-configuring it solves the problem.

So here the minimal needed setup in order to get 3D acceleration on new AMD Radeon cards in X:

Install the following ports:
* graphics/drm-stable-kmod/
* graphics/gpu-firmware-kmod/
* x11-drivers/xf86-video-amdgpu/

Re-configure X:
* Xorg -configure

Thanks for making this possible.

PS: on the topic about support and all... AMD is currently collaborating with the linux kernel developers, which is admirable. Thanks to the efforts of making that code also available to FreeBSD users, I feel, that we are past turning to the manufacturer, but should help spread the joyful news instead


----------



## D-FENS (Jul 28, 2018)

UPDATE: Use latest 12.0-RELEASE. Instead of drm-next-kmod, use drm-fbsd12.0-kmod.

I succeeded in making RX 580 work with Xorg. There is a minor glitch: From time to time picture (and  sound) freezes for half a second or so. It happens occasionally, but otherwise it behaves very well.
I am posting the tutorial here. Make sure to tweak for your processor and desired environment.
The example is for AMD RYZEN Threadripper CPU, RX 580 videocard with KDE 5.

```
# I installed a standard 11.2-RELEASE FreeBSD on ZFS (2 mirrored nvme drives) with encryption

# After install:
# Important: Boot password is always with en_US keyboard layout!

# Support for AMD RYZEN/Threadripper CPU. Do not use on other CPUs!
echo "CPUTYPE=znver1" >> /etc/make.conf

# Workstation configuration with AMDGPU

    portsnap fetch extract update
 
    cd /usr/ports/ports-mgmt/portmaster
    make install clean BATCH=yes
 
    cd /usr/ports/ports-mgmt/portupgrade
    make install clean BATCH=yes
 
    portmaster --list-origins
 
    portsnap fetch update
    portmaster -Da
    # Or alternatively rebuild all ports like this: https://forums.freebsd.org/threads/rebuilding-all-ports-with-portmaster.51210/
    # Important! This takes a very long time!
   
    # Or use your favorite editor here...
    cd /usr/ports/editors/nano
    make install clean BATCH=yes
 

## Graphics driver amdgpu

    # Direct rendering driver DRM, choose one from "next" or "stable". Next has the latest code.
    cd /usr/ports/graphics/drm-next-kmod/
    #cd /usr/ports/graphics/drm-stable-kmod/
    make install clean BATCH=yes
 
    # This should have been installed by the command above but verify!
    cd /usr/ports/graphics/gpu-firmware-kmod/
    make install clean BATCH=yes
 
    # X driver is a must
    cd /usr/ports/x11-drivers/xf86-video-amdgpu/
    make install clean BATCH=yes
 
    # Xorg configuration
    # 1. create (I get segmentation faults, but the config is created properly nevertheless)
    Xorg -configure
    # 2. Verify that the used driver is amdgpu
    cat /root/xorg.conf.new | grep -s8 amdgpu
    # 3. TearFree option needs to be enabled. Otherwise vertical lines are torn badly in videos.
    nano /root/xorg.conf.new
    # (enable it in Device section)
    Option    "TearFree"    "True"
    # 4. Enable the configuration by copying to the etc location.
    mv /root/xorg.conf.new /usr/local/etc/X11/xorg.conf.d/xorg.conf
 
    # Load amdgpu driver in kernel, /etc/rc.conf
    kld_list="amdgpu"
 
    # This is a workaround for a conflict between UEFI video and AMDGPU.
    # AMDGPU will not work without this workaround, at the time of writing.
    # As a side-effect, first part of the boot process results in jumbled pixels on screen (text is not readable) but  don't panic, it starts working after a few seconds.
    #
    # edit /boot/loader.conf
    hw.syscons.disable=1
    kern.vty=vt
 
 
## Install desktop environment (I use KDE 5, but choose your preferred one). Packages are optional, not needed for AMDGPU to work properly with Xorg.
 
    cd /usr/ports/x11/xorg/
    make install clean BATCH=yes
 
    cd /usr/ports/x11/kde5/
    make install clean BATCH=yes
 
    cd /usr/ports/www/falkon/
    make install clean BATCH=yes
 
    cd /usr/ports/x11/sddm/
    make install clean BATCH=yes

    cd /usr/ports/sysutils/hal/
    make install clean BATCH=yes
 
    cd /usr/ports/accessibility/redshift/
    make install clean BATCH=yes
 
    cd /usr/ports/benchmarks/glmark2
    make install clean BATCH=yes
 
    #cd /usr/ports/graphics/mesa-dri
    #make install clean BATCH=yes
 
    #cd /usr/ports/graphics/mesa-libs
    #make install clean BATCH=yes
 
    cd /usr/ports/graphics/mesa-demos
    make install clean BATCH=yes
 
    cd /usr/ports/lang/clover
    make install clean BATCH=yes
 
    #cd /usr/ports/graphics/vulkan-sdk
    #make install clean BATCH=yes
 
    #cd /usr/ports/games/vkquake
    #make install clean BATCH=yes
 
 
    #cd /usr/ports/graphics/krita/
    #make install clean BATCH=yes

    # Start KDE automatically
    sysrc sddm_enable=YES
    sysrc hald_enable=YES
    sysrc dbus_enable=YES
    service sddm start


# drm-next-kmod requires the user to be in group "video". "wheel" group is necessary for su.
pw usermod john -G video,wheel,operator
```

Special thanks to pestslent1 and MYXOMOP.


----------



## fhajji (Aug 12, 2018)

Thank you. I'm also running Xorg on Threadripper 1950X with an RX-580  using amdgpu and drm-next-kmod. 4K res via Display Port, without problems. And yes, I'm seeing these occasional blankings, but they are so rare and fast, that I wasn't sure if it was the screen or me blinking. 

However, OpenCL is broken for me, and no audio to monitor nor HDMI ports (regular digital and analog audio okay). Did you manage to get one or both of those to run on RX-580?

Thanks.


----------



## D-FENS (Aug 18, 2018)

I posted a reply in your OpenCL thread.
Regarding the HDMI audio, initially when I installed the system (as described in the tutorial above) HDMI audio was available in the Pulseaudio mixer. However, I removed it by reconfiguring the port, because I do not use an HDMI audio device.
I believe, you can recompile audio/pulseaudio and change the configuration to include HDMI support. You may have to do this also for ALSA or whatever you use for sound output.


----------



## fhajji (Aug 28, 2018)

Thank you for the help. Much appreciated.

Adding HDMI support to audio/pulseaudio is a good idea. Unfortunately, I see no HDMI option when running `make config`. There are only options for AVAHI, GCONF, SIMD, ALSA, JACK, SOXR, SPEEX, BASH, ZSH, TDB, GDBM, SIMPLE. None apply to HDMI. There is also no knob in the Makefile that seems related to HDMI.

*Edit: *Sound is not supported yet, according to upstream.


----------



## D-FENS (Jan 9, 2019)

An update to my last post, FreeBSD 12.0-RELEASE is out. I have just upgraded and the minor graphical glitch is fixed. With regard to the AMDGPU graphics 12.0-RELEASE works better than 11.2-RELEASE for me.


----------



## cabriofahrer (Jan 9, 2019)

Thanks for this update, sounds great! So is 12.0 using the new drm-next by default? And how much 3D-acceleration do you have, do you have more than OpenGL3.0 when you do a `glxinfo`?


----------



## D-FENS (Jan 9, 2019)

The drm port has been renamed to drm-fbsd12.0-kmod and "next" is no longer available, so I had to uninstall "next" and install "fbsd12.0". I believe this is the continued code from drm-next-kmod, which has been split into ports for 11 and 12.
I cannot assess the 3D-acceleration stats. I have pasted the output of glxinfo here: https://pastebin.com/gCmhKphM , maybe you can get more out of it.


----------



## Abraham79 (Jan 10, 2019)

I have a HP 15-BS576TX laptop (bought in 2017 November)  with switchable graphics - AMD Radeon 520 dGPU and Intel HD 620 iGPU. It works good in Linux using amdgpu driver although the Radeon 520 is GCN 1.0 only. Wonder, if I can install FreeBSD 12.0 on this laptop.


----------



## D-FENS (Jan 10, 2019)

Abraham79 said:


> I have a HP 15-BS576TX laptop (bought in 2017 November)  with switchable graphics - AMD Radeon 520 dGPU and Intel HD 620 iGPU. It works good in Linux using amdgpu driver although the Radeon 520 is GCN 1.0 only. Wonder, if I can install FreeBSD 12.0 on this laptop.


Just take a look at the table of supported models:
https://wiki.freebsd.org/Graphics/AMD-GPU-Matrix
https://wiki.freebsd.org/Graphics/Intel-GPU-Matrix

Here you can find the technical names matching your card's marketing name:
https://www.x.org/wiki/RadeonFeature/#Decoder_ring_for_engineering_vs_marketing_names

I am not completely sure but your card should be supported via radeonkms driver and not amdgpu. You have to doublecheck on that.


----------



## pi@ (Jun 16, 2019)

Thanks for the writeup, tested on 12.0-REL-p4 and everything works. Soon testing some 4K monitor.


----------



## pi@ (Aug 13, 2019)

pi@ said:


> Thanks for the writeup, tested on 12.0-REL-p4 and everything works. Soon testing some 4K monitor.



Well, it works, but compared to my old setup, it hangs often, see



			https://people.freebsd.org/~pi/logs/xorg-20190813-crash.txt
		


Currently:
drm-fbsd12.0-kmod-4.16.g20190430 DRM modules for the linuxkpi-based KMS components
drm_info-2.1.0                 Small utility to dump info about DRM devices
libdrm-2.4.98_1,1              Userspace interface to kernel Direct Rendering Module services
xf86-video-amdgpu-19.0.1       X.Org amdgpu display driver

10    1 0xffffffff82f21000     815b amdgpu_polaris10_mc_bin.ko
11    1 0xffffffff82f2a000     4421 amdgpu_polaris10_pfp_2_bin.ko
12    1 0xffffffff82f2f000     441f amdgpu_polaris10_me_2_bin.ko
13    1 0xffffffff82f34000     241f amdgpu_polaris10_ce_2_bin.ko
14    1 0xffffffff82f37000     5d3d amdgpu_polaris10_rlc_bin.ko
15    1 0xffffffff82f3d000    40431 amdgpu_polaris10_mec_2_bin.ko
16    1 0xffffffff82f7e000    40433 amdgpu_polaris10_mec2_2_bin.ko
17    1 0xffffffff82fbf000     331f amdgpu_polaris10_sdma_bin.ko
18    1 0xffffffff82fc3000     3321 amdgpu_polaris10_sdma1_bin.ko
19    1 0xffffffff82fc7000    5bbfd amdgpu_polaris10_uvd_bin.ko
20    1 0xffffffff83023000    28d1d amdgpu_polaris10_vce_bin.ko
21    1 0xffffffff8304c000    1fe51 amdgpu_polaris10_k_smc_bin.ko


----------



## 13elltovver (Aug 19, 2019)

roccobaroccoSC said:


> UPDATE: Use latest 12.0-RELEASE. Instead of drm-next-kmod, use drm-fbsd12.0-kmod.
> 
> I succeeded in making RX 580 work with Xorg. There is a minor glitch: From time to time picture (and  sound) freezes for half a second or so. It happens occasionally, but otherwise it behaves very well.
> I am posting the tutorial here. Make sure to tweak for your processor and desired environment.
> ...



Thanks! This helped me a lot! In my case i stumbled upon, that it was easier to just `pkg install drm-fbsd12.0.kmod`.


----------

