# sienna_cichlid driver



## astyle (Oct 5, 2022)

*Discussion*: Last year, I got a water-cooled RX 6900 XT GPU (Yeah, worst possible time to get it, at height of GPU shortage, but deed is done  ). Spent some time mating it to an aftermarket cooling system, and it's finally working under Windows, and the hardware is fine, I can use the latest AMD Adrenalin to tell the GPU to use less power, change the backlight to orange (Via Gigabyte's RGB Fusion 2.0), etc.

Now, the issue is trying to get it to work under FreeBSD...  After doing some homework, I discovered that my GPU requires the `sienna_cichlid` driver... which in itself requires the FreeBSD kernel to be at 13.1.  So, I upgraded from 13.0 to 13.1 via the freebsd-update(8) as described in the Handbook... That upgrade went off without a hitch, smooth as butter. Then I compiled the port: graphics/drm-510-kmod (under /usr/ports, of course) on Sept. 14, 2022 (Just a day after the update to drm_v5.10.113_`7`). Edited the /etc/rc.conf file to load /boot/modules/amdgpu.ko... booted my rig... and oh, man...

Driver loads, screen flickers, command line starts showing higher resolution - but upon starting SDDM, the display just freezes, and shows an immovable mouse pointer in the middle. When I SSH into the rig, and run `/usr/local/bin/systemsettings5`, I can see that the graphics driver is `llvmpipe`...

Updating to drm_v5.10.113_`8` (from Oct. 1, 2022) may not make much sense... because graphics/gpu-firmware-amd-kmod has not been updated since Sept. 7.

FWIW, on the rig, I have Plasma 5.20 and Frameworks 5.77...  the reason for that is that I've got a different project going (upgrading KDE independently of everything else), it stalled partly thanks to the GPU driver issues...  

So, after reading all that, any ideas on what I can do?


----------



## astyle (Oct 10, 2022)

*Update:* Got it working (Screenshot coming later).  Plasma 5.24 / Frameworks 5.98, `drm_info` shows the correct GPU.  This was accomplished by doing the following:

installing 13.1 from scratch.
Get a ports snapshot from Oct. 7, 2022, 5 pm.
Install Xorg via the metaport x11/xorg - this will help install ALL the components needed, and saves the time for hunting down errors because something is missing.
Install graphics/drm-510-kmod - this will pull in the necessary firmware files, including the `sienna_cichlid` driver that I need.
Install the graphics/gpu-firmware-amd-kmod
Find all 12 parts of the sienna_cichlid driver under the port's graphics/gpu-firmware-amd-kmod/work/ directory, and run `make && make install` on each of them.
The reason for this step - neither graphics/drm-510-kmod nor graphics/gpu-firmware-amd-kmod put the .ko driver files into /boot/modules/... Go figga.

Install graphics/drm-kmod.  The `amdgpu.ko` from that port will be the one to find all 12 parts of the `sienna_cichlid` driver and load them properly.
Specify /boot/modules/amdgpu.ko in /etc/rc.conf as per https://wiki.freebsd.org/Graphics ...
Now that I think about it, steps 4-7 probably could have worked on my frankenstein setup described in the previous post... if done as described in this post... 

This is not quite the standard way to do it, but as things stand now, the ports in question don't finish the installation process correctly...

Still need to use some Windows utils to tell  my GPU to consume less power.


----------



## astyle (Oct 17, 2022)

Promised screenies:


----------



## Andriy (Oct 17, 2022)

astyle said:


> *Update:* Got it working (Screenshot coming later).  Plasma 5.24 / Frameworks 5.98, `drm_info` shows the correct GPU.  This was accomplished by doing the following:
> 
> installing 13.1 from scratch.
> Get a ports snapshot from Oct. 7, 2022, 5 pm.
> ...


Please report 6 to the port's maintainer. Perhaps the (new) firmware was overlooked by the maintainer(s) after it was added upstream.


----------



## T-Daemon (Oct 18, 2022)

Andriy said:


> Please report 6 to the port's maintainer. Perhaps the (new) firmware was overlooked by the maintainer(s) after it was added upstream.





astyle said:


> 4. Install graphics/drm-510-kmod - this will pull in the necessary firmware files, including the sienna_cichlid driver that I need.
> 
> 6. Find all 12 parts of the sienna_cichlid driver under the port's graphics/gpu-firmware-amd-kmod/work/ directory, and run `make && make install` on each of them.
> 
> The reason for this step - neither graphics/drm-510-kmod nor graphics/gpu-firmware-amd-kmod put the .ko driver files into /boot/modules/... Go figga.


graphics/drm-510-kmod has no dependency on graphics/gpu-firmware-amd-kmod. If you run `make run-depends-list` there is nothing returned. One must install the firmware separately.

graphics/gpu-firmware-gpu-amd: Add new port

```
This is a port with the firmware for all and only amd GPUs.
Each generation is a flavor so one can just install the needed
firmware.
```

Same when installing  graphics/drm-510-kmod from package, no dependency is pulled in. The firmware must be installed separately after flavor (gpu-firmware-amd-kmod-<flavor>).

graphics/gpu-firmware-amd-kmod has 33 flavors (`make -V FLAVORS`). Without specifying the flavor the first flavor on the list (banks) will be build.

No need to descent in the work directory, run  `make install clean FLAVOR=sienna_cichlid` . This will install all kernel modules under /boot/modules.



astyle said:


> 7. Install graphics/drm-kmod. The `amdgpu.ko` from that port will be the one to find all 12 parts of the `sienna_cichlid` driver and load them properly.


This step isn't necessary. graphics/drm-kmod is a META port with no driver. The amdgpu.ko driver is provided by graphics/drm-510-kmod.

```
# pkg which /boot/modules/amdgpu.ko
/boot/modules/amdgpu.ko was installed by package drm-510-kmod-5.10.113_7

# cd /usr/ports/graphics/drm-kmod

# make run-depends-list
/usr/ports/graphics/gpu-firmware-kmod
/usr/ports/graphics/drm-510-kmod
```
Both dependencies are already installed. In case of graphics/gpu-firmware-kmod this would pull in besides amd (all 33 flavors) also intel and radeon firmware.

```
# cd /usr/ports/graphics/gpu-firmware-kmod

# make run-depends-list
/usr/ports/graphics/gpu-firmware-radeon-kmod
/usr/ports/graphics/gpu-firmware-intel-kmod
/usr/ports/graphics/gpu-firmware-amd-kmod
```


----------



## Carbonbasedlifeform#7 (Tuesday at 11:34 AM)

I'm trying to fresh install 13.1 and I've done everything above and my system looses signal when it tries to load the driver.
I have a Powercolor RX 6800 Fighter
drm-510-kmod-5.10.113_8 is what gets installed as of this writing. 
graphics/gpu-firmware-amd-kmod-sienna_cichlid
I've tried installing both of the above from ports and pkg with no luck.
sysrc kld_list+=amdgpu
X11/xorg is installed as well.
Reboot and it looses signal 
Am I missing something?


----------

