Getting an AMD APU to work with Ubuntu 20.04

Gary Roberts
Gary Roberts
Moderator
Joined: 9 Feb 05
Posts: 5842
Credit: 109404064642
RAC: 35486094

Bill wrote:... Isn’t it

Bill wrote:
... Isn’t it better for security reasons to have the kernel up to date?

Yes, it is, but you don't need to overly stress about this.  My opinion is that an LTS (long term support) kernel is the best option.  Perhaps every 6 months or so, if a newer LTS kernel is available that will work with your distro, then do the upgrade.

Most changes with current kernels deal with newly supported hardware.  There are also bug fixes, cosmetic changes, performance enhancements and solutions for potential security issues.  An LTS kernel gets updates for the most important bugs and security issues only - so just a sub-set of the much larger number of changes going into a current kernel.  If you don't have the latest bleeding edge hardware to support, you don't need to be using the very latest current kernel.

Bill wrote:
... if Gary is running homemade scripts ...

Only because I have had to :-).  AMD provide an installation script for just a couple of major distros.  They expect the maintainers of other distros to work it out for themselves.  That's as it should be, when you consider the zillions of distro variants that are out there.  My distro of choice doesn't (yet) provide a package so I made something that worked for me.  Coincidentally, that is all changing as we speak :-).

I've been trying to support a couple of other PCLOS users with getting OpenCL working - for things other than BOINC.  If you want to see an example, have a read of this thread.  It dates back to last year and I gave details about the procedure I use to get OpenCL working for my hosts running PCLOS.  My 'home made script' just automated those steps.  There was no 'success announcement' by the OP so I don't know what eventually happened in that case.

However, Texstar - the guy who started PCLOS many years ago - has just installed a new package building machine with an AMD 4700G CPU which includes Vega 8 graphics.  3 days ago and quite out of the blue, he posted some clinfo output for his new machine, asking if it looked OK.  He was obviously following the instructions I set out from last year.  You can read what he posted in the linked thread and my response for the details.  The final outcome, posted today, is that he is delighted with the result and has created a package for PCLOS so I shouldn't need that "home made script" of mine any more :-).

So there's another example that Vega 8 graphics will work with the PAL OpenCL from AMDGPU-PRO.

Since the AMD announcement for the new 21.10 AMDGPU-PRO lists "full support for Ubuntu 20.04.2", it would seem that your best option is to install 20.04.2 and then use the install script that comes with the 21.10 new release, together with whatever options for getting at least the PAL OpenCL (or whatever that may now be called).  However, do some research since I know nothing about Ubuntu (or 21.10 for that matter).

Cheers,
Gary.

Bill
Bill
Joined: 2 Jun 17
Posts: 38
Credit: 243834762
RAC: 247667

Thanks, Keith and

Thanks, Keith and Gary.

 

So the box does have Ubuntu 20.04.2 and the 21.10 drivers, so I should be good to go there.  I ran with with both PAL and Legacy, but not headless when installing the drivers.  I can try uninstalling then reinstalling with Pal and headless to see what happens.

 

i’ll also dig into those articles as well.

Bill
Bill
Joined: 2 Jun 17
Posts: 38
Credit: 243834762
RAC: 247667

So, I ended up downgrading to

So, I ended up downgrading to 18.04, and my APU is detected!  That is the good news, the bad news is I an getting computation errors, and with Milkyway’s website down right now, I cannot check to see what is causing it,  probably a driver error.  To be continued.

Tom M
Tom M
Joined: 2 Feb 06
Posts: 5589
Credit: 7675226030
RAC: 1831634

Bill wrote: So, I ended up

Bill wrote:

So, I ended up downgrading to 18.04, and my APU is detected!  That is the good news, the bad news is I an getting computation errors, and with Milkyway’s website down right now, I cannot check to see what is causing it,  probably a driver error.  To be continued.

When you downgraded to 18.04 did you install 18.04 GPU drivers or re-use the 20 drivers?  If you used the 20 drivers on the 18.04 OS it could be a reason.

Also, are you OCing the iGPU in any way?

Tom M

A Proud member of the O.F.A.  (Old Farts Association).  Be well, do good work, and keep in touch.® (Garrison Keillor)

Gary Roberts
Gary Roberts
Moderator
Joined: 9 Feb 05
Posts: 5842
Credit: 109404064642
RAC: 35486094

Bill wrote:So, I ended up

Bill wrote:
So, I ended up downgrading to 18.04, and my APU is detected!

I had a look at your hosts list and the only AMD CPU shows as a Ryzen 7 2700 with a 1660Ti GPU.  If you have an APU host at Einstein, is it perhaps registered under a different account?

Cheers,
Gary.

Bill
Bill
Joined: 2 Jun 17
Posts: 38
Credit: 243834762
RAC: 247667

Sorry I haven't written in

Sorry I haven't written in awhile.  I have not had the time to work on this with enough time to focus (I still don't, but I took a swing at it tonight).  To answer your questions...

Tom:  I reformatted the HDD and downloaded the 21.10 drivers for 18.04, not the drivers for 20.04, so we are good there.  No, the iGPU is not overclocked.  I want to OC the memory, but I'm not even going to make things more complicated until this gets fixed.

Gary:  I am not running E@H on this computer because I only have 8 GB of memory and the E@H tasks chew up too much.  Currently I'm running MW@H.  That computer is here.  It currently doesn't list the GPU, but I suspect that is because I just uninstalled the 21.10 drivers.

I had an error trying to install the command this way: "./amdgpu-pro-install --opencl=rocr,legacy" (I'll have to copy it next time).  I've also tried installing with with the same command line, but without the '-pro'.

Let me try installing it again without the -pro...I'll be back in a second after I reboot to report what happens.

 

edit:  No good on the non-pro install.  I won't paste everything, but this was the output of the last few lines:

<snip>

Extracting templates from packages: 100%
(Reading database ... 234676 files and directories currently installed.)
Preparing to unpack .../amdgpu-dkms-firmware_5.9.20.102-1244864_all.deb ...
Unpacking amdgpu-dkms-firmware (1:5.9.20.102-1244864) ...
dpkg: error processing archive /var/opt/amdgpu-pro-local/./amdgpu-dkms-firmware_5.9.20.102-1244864_all.deb (--unpack):
 trying to overwrite '/usr/share/doc/amdgpu-dkms-firmware/LICENSE', which is also in package rock-dkms-firmware 1:4.2-21
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/opt/amdgpu-pro-local/./amdgpu-dkms-firmware_5.9.20.102-1244864_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

 

I'll be honest, I've been uninstalling, reinstalling in different ways, trying other things that I don't recall, so I could have just broke Ubuntu and need a fresh reinstall.

Tom M
Tom M
Joined: 2 Feb 06
Posts: 5589
Credit: 7675226030
RAC: 1831634

Bill wrote:I'll be honest,

Bill wrote:

I'll be honest, I've been uninstalling, reinstalling in different ways, trying other things that I don't recall, so I could have just broke Ubuntu and need a fresh reinstall.

Bill,

I know that feeling :( (breaking Ubuntu).  Been there, done that.

I was able to get my APU (4c/4t + iGPU) to install using the specific instructions I previously posted and it clearly recognized the iGPU.

E@H Gamma Ray gpu tasks do not take up nearly as much ram as Gravity Wave tasks.

I think you can check the gpu hardware even if BOINC is not recognizing it with a commandline:

sudo lshw -C display

When in doubt, get another HD/SSD and start over without trashing the old HD/SSD.  Don't forget to "reset" the projects with No New Tasks enabled.  It keeps tasks from "getting lost".

:)

Tom M

A Proud member of the O.F.A.  (Old Farts Association).  Be well, do good work, and keep in touch.® (Garrison Keillor)

Bill
Bill
Joined: 2 Jun 17
Posts: 38
Credit: 243834762
RAC: 247667

I just remembered I never

I just remembered I never tried Tom's method to install the drivers.  That is, with Ubuntu 18.04, Kernel 5.4, and the 21.10 drivers for this OS, I ran the command line "./amdgpu-pro-install -y --opencl=pal,legacy --headless"

I didn't see any errors per se, but this was the end of the output:

DKMS: install completed.

update-initramfs: Generating /boot/initrd.img-5.4.0-74-generic

W: Possible missing firmware /lib/firmware/rtl_nic/rtl8125a-3.fw for module r8169

W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168fp-3.fw for module r8169

W: Possible missing firmware /lib/firmware/amdgpu/vangogh_gpu_info.bin for module amdgpu

W: Possible missing firmware /lib/firmware/amdgpu/vega10_cap.bin for module amdgpu

W: Possible missing firmware /lib/firmware/amdgpu/navi10_mes.bin for module amdgpu

Setting up amdgpu-core (21.10-1244864) ...

Setting up libdrm-amdgpu-common (1.0.0-1244864) ...

Setting up libdrm2-amdgpu:amd64 (1:2.4.100-1244864) ...

Setting up amdgpu-pro-core (21.10-1244864) ...

Setting up libdrm-amdgpu-amdgpu1:amd64 (1:2.4.100-1244864) ...

Setting up ocl-icd-libopencl1-amdgpu-pro:amd64 (21.10-1244864) ...

Setting up opencl-orca-amdgpu-pro-icd:amd64 (21.10-1244864) ...

Setting up clinfo-amdgpu-pro (21.10-1244864) ...

Processing triggers for libc-bin (2.27-3ubuntu1.4) ...

 

I'm not sure if I'm actually missing firmware or not, but I suspect my GPU is still not detected because of those errors.  Any ideas?

Tom M
Tom M
Joined: 2 Feb 06
Posts: 5589
Credit: 7675226030
RAC: 1831634

It works without firmware

It works without firmware images for me. I get same warning messages during driver install.

Tom M

A Proud member of the O.F.A.  (Old Farts Association).  Be well, do good work, and keep in touch.® (Garrison Keillor)

Jeearr
Jeearr
Joined: 23 Feb 06
Posts: 14
Credit: 107155091
RAC: 0

What worked for me is

What worked for me is this: (Ubuntu 20.04.2)

1. Get the amd driver version: amdgpu-pro-20.40-1147286-ubuntu-20.04 (you may have to search for it in AMDs previous drivers)

This driver does not force dkms on you .

2. run ./amdgpu-install --opencl=legacy,pal --headless --no-dkms

The amdgpu-pro-install forces dkms on you (I found that when compiling the module it would fail), hence the --no-dkms flag. Also I believe pal is for GPU models >=vega, legacy is for models <vega (if memory serves).

3. add the user intended for opencl compute stuff to the video and render group.

believe it is:

sudo usermod -aG video username

sudo usermod -aG render username

4. install the opencl dev libraries, etc...

sudo apt install ocl-icd-opencl-dev

5. install clinfo and test if your GPU shows up as: AMD Accelerated Parallel Processing

 

note: It has been a while since I installed opencl support for my 2400G and my 7890k apu's, so hopefully I am not missing any steps (could be). This method worked on both the old Kaveri APU and the RavenRidge APU.

 

Cheers!

 

 

 

 

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.