How to install AMD graphic drivers on Ubuntu 18.04

I had always been a Windows user, But yesterday I downloaded and install Ubuntu 18.04 LTS from this page, But I can't find a way to install AMD graphic drivers,

Right now Linux only works in recovery mode, in normal mode it shows a blank purple screen and nothing works, after searching on internet I found there could be something wrong with my graphic drivers, I have tried many things to install AMD graphic drivers on my laptop, But nothing seems to work, I ran this command on my laptop

lspci -nn | grep -E 'VGA|Display'

and the results are

00:02.0 VGA compatible controller [0300]: Intel Corporation 3rd Gen Core processor Graphics Controller [8086:0166] (rev 09)
01:00.0 Display controller [0380]: Advanced Micro Devices, Inc. [AMD/ATI] Sun XT [Radeon HD 8670A/8670M/8690M / R5 M330 / M430 / R7 M520] [1002:6660]

So I have a hybrid graphic cards or something, I tried this installation guide, but didn't work (even for the users in comment section),

It was very easy on windows, I would switch back to windows, But just wanted to ask here for last time. is there any solution available for installing AMD graphic drivers on Ubuntu 18.04 ?

Thanks!


Solution 1:

You should be able to use the open source drivers that come with your system. You may just need to use the common nomodeset fix:

How do I set 'nomodeset' after I've already installed Ubuntu?

Using the built in driver is usually sufficient for radeon cards.

If you have done other mucking around, or added the PPA for the NVIDIA drivers (sorry about that) you can clean up with the following:

sudo apt-add-repository -r ppa:graphics-drivers/ppa && \
sudo apt update && \
sudo apt upgrade && \
sudo apt autoremove && \
sudo apt autoclean

Now, add the AMD updates PPA and update:

sudo add-apt-repository ppa:oibaf/graphics-drivers
sudo apt-get update
sudo apt upgrade

Then reconfigure your packages to be safe:

sudo apt install --reinstall xserver-xorg-video-amdgpu
sudo dpkg --configure -a
sudo dpkg-reconfigure gdm3 ubuntu-session xserver-xorg-video-amdgpu

Finally, you can enable accelerated video:

sudo apt-get install mesa-vdpau-drivers

Then to test the VDPAU driver with mpv use:

mpv --hwdec=vdpau yourvideofile

Now reboot the computer and make sure it still works. It does? Good! Now reboot once again and see if you can remove the nomodeset boot option. If it will work without it, this might improve performance.

Finally, once you are logged into the GUI, go to Settings > Devices > Displays and make sure the resolution is properly set.

If performance is still not up to standards after all of the above, you can manually install the closed source driver as a last resort.

If you decide you would still like to use the proprietary driver, you will need to download and install it. According to the output you posted, you need to download this driver:

AMD Radeon™ HD 8670M Series GPU Drivers & Support

Click on the "Linux x86_64" box and download the zip file.

You can follow this guide or post any additional updates to your question and I will improve the answer accordingly.

Solution 2:

Since I struggled with the problem for a whole day and Joshua's answer didn't work for me I thought it might help to provide my solution.

My mistake was that although I have Ubuntu 18.04 installed on VMware® Workstation 15, I was trying to resolve the problem based on my host machine's AMD graphic adapter. I copy the solution that worked for me below:

The issue is with Wayland. While Ubuntu defaults to an X11 session, for some reason they left it enabled for GDM.

You can certainly replace GDM with LightDM, but an easier option would be to:

sudo nano /etc/gdm3/custom.conf

Then change the line:

#WaylandEnable=false

to

WaylandEnable=false

Press Ctrl+O and then Ctrl+X and reboot. If you don't wish to reboot you can do

sudo systemctl restart gdm

Which will restart your windows session (this assumes ssh into the box to fix as above).