AMD Drivers and Firmware

After wasting a large amount of time on a recent problem detailed on this extensive blog post, I am unhappy about the way AMD drops driver packages.

This post will try to highlight some of the peculiar issues that I have noticed during this endless battle to stop BSOD’s happening to my shiney new Ryzen system.

AMD Drivers -UI

If you have an Intel CPU and an AMD GPU, or an AMD Zen CPU and an Nvidia GPU, you can read on with a smug grin.
If you have both an AMD Zen CPU and AMD GPU, join the hair pulling club.


Trying to install AMD GPU and Chipset drivers to the same system can start to make you feel insane, as anyone in an infinite loop condition would do.

Effectively, they (the driver installers) fight for superiority; an AMD driver package you are trying to install checks the driver version against one that is already present on the system, regardless of the type of drivers that you are trying to install.

So for example:

You install AMD GPU driver 19.1.2. After the reboot, you say…

“Hey!, it’s now time to install the chipset drivers while I’m at it!”

…which is not a bad idea at all.

You go to the website and jump through all of AMD’s hoops to pick the right driver and download chipset driver version 18.10.1810.

You start the installer and are confronted with a screen that effectively tells you that you are installing an older driver version, comparing it with the 19.1.2 GPU driver.


This comes down to clarity; which is frankly laziness from AMD.
And it doesn’t end there; the GPU drivers have an interface which allows you to find the driver version, which the chipset drivers lack only adding further to the confusion.

Below are some screenshots taken from the AMD site, showing the revision numbers. Yes! they are different, as expected. They are two separate drivers after-all but the installation battle is determined here.

AMD Chipset Drivers version 18.10.1810
The current version of chipset drivers 25/01/2019
AMD GPU Drivers 19.1.2
The current version of GPU drivers 25/01/2019

Currently, the way to overcome this is to install the chipset drivers first. The UI will install version 18.10.1810.
Installing the GPU drivers after means you will be “upgrading” to 19.1.2 but it doesn’t contain any chipset drivers so the currently installed chipset drivers will be untouched..

Very confusing, AMD.


The BSOD Blame Game

Issues to my system started when the Windows 10 1809 update dropped on my PC.
When the problems appeared (many BSODs), I updated to the latest chipset drivers which (as it turned out) seemed to be incompatible with my “older” BIOS. Let’s explore this further.

Microsoft Updates

Windows 10 1809 was officially released November 13, 2018.
It wasn’t until late December that Windows Updates decided that it was time to install this hefty upgrade. The upgrade happened as usual and completed without issue.

But something had changed to make my system unstable (did I mention many BSODs?!). The only thing I can think of is a driver update with 1809 or a change relating to the kernel which meant that something isn’t working correctly. This forced me to look at updating to the latest drivers to be sure.

Alas, the latest drivers did not solve the problem and only made the issue worse. Windows 10 was the cause.

AMD – Drivers

For the time being, I’m ignoring AMD’s GPU driver roulette…

Upgrade from 19.1.1 to 19.1.1?!

… and concentrating on chipset drivers.
I think AMD likes to assume that you not only have the latest AGESA BIOS readily available for your motherboard, but also applied.

As it turns out, the latest chipset driver package doesn’t specify any patch notes, AGESA or pre-configuration requirements and it doesn’t specify exactly what is included in the package.

AMD Chipset details version 18.10.1810
AMD Chipset details 25/01/2019

This most recent version could be AMD’s response to the new W10 1809 version! How Ironic.

If only AMD could tell me that this was only compatible with the most recent AGESA BIOS and that if it wasn’t available, I could try an alternative driver.

Not afraid of getting my hands dirty, let’s check for a BIOS update!

GIGABYTE – BIOS

Currently, the timeline is around 2.5 months since Windows 10 1809 was released. Had I decided to update on release day, I would have had to wait through 2 months worth of BSODs until I found a solution. I finally found the solution on Gigabyte’s website.

The new BIOS (F25) is just over a week into its’ release (currently 25/01/2019). As you can clearly see from the description, it requires the latest chipset drivers that AMD released 26/10/2018. That could mean that the chipset drivers relies heavily on the F25 BIOS. Maybe.

Gigabyte BIOS Downloads – 25/01/2019

After looking for information about AGESA 1.0.0.6, Google is littered by speculation as far back as May 2017. So I ask myself, how bad is Gigabytes’ hardware support? and the answer is obvious, it seems*.
So essentially, Gigabyte could have sat on AGESA 1.0.0.6 as early as 2017.

It’s not as clear cut as this, though. There are different AGESA versions depending on the type of chip, ZEN, ZEN+ and ThreadRipper to name those that I dug up.

*not so much obvious, actually. AGESA is incredibly badly documented for the most part, and it seems only high level slithers of the contents dribble down to consumers such as “better memory support” etc.


Afterword

I am happy to conclude that the issues (since the BIOS update) have been resolved and it was most definitely a software issue.

Although only a couple of weeks of constant BSOD’s interrupted my ability to use the computer, I feel it’s still wholly unfair that we have to deal with these issues at a time when updates to security are as important as it has ever been.

If indeed Gigabyte has been sitting on this update for a while, it is totally unacceptable that these things should be left beyond the last minute.

On the same note, AMD need to provide greater clarity about the contents and pre-requirements to their drivers and stop blanketing their customers with just another iteration of the version number. Incredibly unhelpful.

My theory now is: due to the sheer amount of different BSODs errors that all pointed to memory faults, it could only have been a collaborated effort from AMD and Microsoft to help mitigate against Spectre on the AMD platform. But since the BIOS didn’t know about the changes, the drivers threw up errors.

Compile and install Python’s MOD_WSGI for Apache2 in Ubuntu 18.04

Having installed mod_wsgi a couple of times on different machines, I decided to note down the steps I took and put together a guide. There are also some solutions to some issues that you may encounter, which left me clueless for a while. If you are looking for a guide to deploying a Flask/Django project, you will have to look elsewhere (for the time being).

This is for use with python3 using Ubuntu 18.04’s shipped version. You may need to tweak this guide to point to non-standard versions of python3 that you specifically want to use.

I believe some Ubuntu versions have pre-packaged mod_wsgi installations available. However, noted in a previous blog post, apache2 may flood error logs pointing to a mismatch with either differing python3 or apache2 versions and in my view, a clean compilation ensures a tailored fit to your current system without the worry of logging and runtime errors.

Things to note:

  • I prefer to compile inside the “/opt” directory. Please amend the guide to suite your preference
  • I will refer to the current latest version of mod_wsgi (4.6.4 at time of writing). This is for illustrative purposes only, and some directory paths will be different with different versions
  • The guide is built around CLi, and assumes you are comfortable with the basics

Pre-Requisites

You will need to have installed some additional packages:

  • python3-dev  –  mainly for python3 header files for compilation
  • apache2
  • apache2-dev
  • gcc  –  *or an equivalent C compiler*

You may use apt install for all the above packages

Next, you will need to locate the latest mod_wsgi source files (found here)

Downloading

Navigate to /opt and download the latest version of mod_wsgi:

$ cd /opt
$ wget https://github.com/GrahamDumpleton/mod_wsgi/archive/4.6.4.tar.gz

Unpack the tar:

$ tar -xzf 4.6.4.tar.gz mod_wsgi-4.6.4/

Configure Make file

Change into the unpacked directory:

$ cd mod_wsgi-4.6.4/

Complete a “test” run of the configure script to so you can debug any errors:

$ ./configure

 

  • Error: “configure: error: no acceptable C compiler found in $PATH
    Solution: install a C compiler:

    $ sudo apt install gcc

 

  • Error: “Checking Apache Version.. ./configure: line 2765: apsx: command not found
    Solution: install apache2-dev

    $ sudo apt install apache2-dev

 

  • Error: “checking for python… no
    Solution: add argument to ./configure to point to python3 (global) or full path

    $ ./configure --with-python=python3

If you run configure without any errors, you’re ready to compile!

Compiling mod_wsgi

The make file is ready. Run Make:

$ make

This will now compile mod_wsgi. It should complete without error.

We finish the process by installing mod_wsgi to our apache2 installation:

$ make install

Configure Apache2

Finally, we need to configure apache2 correctly to load the mod_wsgi module. There are 2 ways we can do this:

  1. The “lazy way”:
    Add the following to the end of the apache2.conf file:
    (located: “/etc/apache2/apache2.conf“)

    LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so

    Restart Apache2:

    $ sudo systemctl restart apache2

    If apache2 restarts without errors, you have successfully installed and loaded mod_wsgi!

  2. The “proper” way:
    Navigate to “/etc/apache2/mods-available“Create “mod_wsgi.conf”:

    $ sudo touch mod_wsgi.conf

     

    Add the following to” mod_wsgi.conf”:

    <IfModule mod_wsgi.c>
    </IfModule>

    For further information about the configuration options that can be included in “mod_wsgi.conf”, refer to docs : https://modwsgi.readthedocs.io/en/develop/configuration.html

    Create “mod_wsgi.load”:

    $ sudo touch mod_wsgi.load

    Add the following to “mod_wsgi.load”:

    LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so

    Activate module in Apache and follow onscreen instructions:

    $ sudo a2enmod mod_wsgi

    If apache2 restarts without errors, you have successfully installed and loaded mod_wsgi!