Sunday, December 2, 2018

Upgrading Ubuntu 16.04 to 18.04 - tip for those with AMDGPU-Pro drivers

I’ve been resisting upgrading my Ubuntu 16.04 LTS installation. One of the major reasons is my non-standard choice of graphics cards which has always proved problematic to support under Linux.

Rather than follow the crowd, I was persuaded (largely by the price) to get an AMD Radeon RX 460 card some 2 years ago. Installation under Ubuntu was less than obvious. The OS itself didn’t have drivers included for the card. Moreover, the AMD drivers were a bit of a “non-standard install” when compared with others, as (at the time) they were not delivered through the standard Ubuntu package manager. So after done days of searching the web for solutions and fiddling with my rig, I was finally able to get a stable graphics setup operational. Something I was not inclined to upset anytime soon.

So here I was using Ubuntu 16.04 - some 7 months after the release of the next long-term release - when I started to receive “suggestions” that it was time to upgrade to the next version. I’ve been using Ubuntu since 10.04 and have learned that there is no need to upgrade to the latest version right away. Not only is the upgrade process longer (hoards of computers upgrading at or around the time of the release), but also because there are “issues” associated with being an early adopter that are ironed out over time. But with my installation proposing to upgrade I decided to take the leap. Steps included:
  1. Backed up the “home” folder.
  2. Take snapshot of the packages that were installed.
  3. Hit “Upgrade”. 
The upgrade proceeded without errors and after about 45 minutes the machine was ready to restart. Now the challenge started - though the Ubuntu splash screen was displayed, the GUI logon was not. CTRL-ALT 1, 2, 3 gave me command line access; however, the GUI screens were blank. Started scouring the web for “command line only after upgrade” and found several suggestions to “reinstall lightdm” or “ensure that lightdm is the selected interface for X” or “reinstall ubuntu-desktop”. All these failed. Though at one point in time I started receiving the GUI login only to have it “plant” and lock up the machine when credentials were entered.

Having gotten pretty “weak” on my command line skills, I needed some command line tools that would support the work I needed to perform. Enter “vim” editor. This enabled me to look into the log files where I noted broken links associated with the AMDGPU packages. So I downloaded the most recent AMD propriety drivers. Now this is no small feat with no GUI. I tried “wget” but it didn’t work. Next I resorted to Lynx. Happily this command line and text-oriented web browser did the trick and I was able to download the latest drivers from AMD. After unpacking and launching the installation script I thought I had my problems solved. That is, until I got an error message about problems with packages. A little more web perusing led me to a very useful script that removes all AMDGPU and AMDGPU-PRO packages (please see this site and bid thanks to “Fermulator” for posting this solution!). I repeat the command line code below:
for amdgpupkg in $(dpkg --list | grep amdgpu-pro | awk '{print $2}'); do echo $amdgpupkg; sudo dpkg --purge --force-all $amdgpupkg; done
for amdgpupkg in $(dpkg --list | grep amdgpu | awk '{print $2}'); do echo $amdgpupkg; sudo dpkg --purge --force-all $amdgpupkg; done
After executing this code and rebooting the machine, the installation was a little “unstable”; however, I was able to “apt update”, “apt upgrade” - essentially reinstalling the AMDGPU drivers that come with 18.04. Once this was complete, system rebooted and, much to my satisfaction, the GUI logon screen was displayed. 


No comments:

Post a Comment