RX 5700 and Ubuntu 20.04

Moderators: Site Moderators, FAHC Science Team

Post Reply
zookeeny
Posts: 23
Joined: Fri Apr 03, 2020 1:32 pm

RX 5700 and Ubuntu 20.04

Post by zookeeny »

Hi,

I saw that AMD finally released OpenCL support for Ubuntu 20.04, so I installed the new driver, but still cannot get FAHclient to recognize it. Here's what I see in the log:

Code: Select all

19:32:16:******************************* System ********************************
19:32:16:        CPU: AMD Ryzen 9 3900X 12-Core Processor
19:32:16:     CPU ID: AuthenticAMD Family 23 Model 113 Stepping 0
19:32:16:       CPUs: 24
19:32:16:     Memory: 31.37GiB
19:32:16:Free Memory: 24.99GiB
19:32:16:    Threads: POSIX_THREADS
19:32:16: OS Version: 5.4
19:32:16:Has Battery: false
19:32:16: On Battery: false
19:32:16: UTC Offset: -4
19:32:16:        PID: 18006
19:32:16:        CWD: /var/lib/fahclient
19:32:16:         OS: Linux 5.4.0-7634-generic x86_64
19:32:16:    OS Arch: AMD64
19:32:16:       GPUs: 1
19:32:16:      GPU 0: Bus:12 Slot:0 Func:0 AMD:6 Navi 10 [Radeon RX 5600 OEM/5600 XT /
19:32:16:             5700/5700 XT]
19:32:16:       CUDA: Not detected: Failed to open dynamic library 'libcuda.so':
19:32:16:             libcuda.so: cannot open shared object file: No such file or
19:32:16:             directory
19:32:16:     OpenCL: Not detected: clGetDeviceIDs() returned -1
19:32:16:******************************* libFAH ********************************
It sees the RX 5700, but is getting nothing when calling clGetDeviceIDs(). Any ideas what I'm doing wrong? Thanks!
PantherX
Site Moderator
Posts: 6986
Joined: Wed Dec 23, 2009 9:33 am
Hardware configuration: V7.6.21 -> Multi-purpose 24/7
Windows 10 64-bit
CPU:2/3/4/6 -> Intel i7-6700K
GPU:1 -> Nvidia GTX 1080 Ti
§
Retired:
2x Nvidia GTX 1070
Nvidia GTX 675M
Nvidia GTX 660 Ti
Nvidia GTX 650 SC
Nvidia GTX 260 896 MB SOC
Nvidia 9600GT 1 GB OC
Nvidia 9500M GS
Nvidia 8800GTS 320 MB

Intel Core i7-860
Intel Core i7-3840QM
Intel i3-3240
Intel Core 2 Duo E8200
Intel Core 2 Duo E6550
Intel Core 2 Duo T8300
Intel Pentium E5500
Intel Pentium E5400
Location: Land Of The Long White Cloud
Contact:

Re: RX 5700 and Ubuntu 20.04

Post by PantherX »

Did you install OpenCL package (sudo apt-get install ocl-icd-opencl-dev)?
ETA:
Now ↞ Very Soon ↔ Soon ↔ Soon-ish ↔ Not Soon ↠ End Of Time

Welcome To The F@H Support Forum Ӂ Troubleshooting Bad WUs Ӂ Troubleshooting Server Connectivity Issues
zookeeny
Posts: 23
Joined: Fri Apr 03, 2020 1:32 pm

Re: RX 5700 and Ubuntu 20.04

Post by zookeeny »

Thanks for the suggestion - I installed ocl-icd-opencl-dev and rebooted, but unfortunately got the same message when FAHclient started.

The strange thing is that Blender now recognizes the RX5700 as a valid OpenCL device, and darktable-cltest seems to see it as well:

Code: Select all

0.612471 [opencl_init] discarding device 1 `AMD Radeon RX 5700 XT (NAVI10, DRM 3.35.0, 5.4.0-7634-generic, LLVM 9.0.1)' - The OpenCL driver doesn't provide image support. See also 'clinfo' output.
0.612478 [opencl_init] OpenCL successfully initialized.
0.612481 [opencl_init] here are the internal numbers and names of OpenCL devices available to darktable:
0.612484 [opencl_init]		0	'gfx1010'
0.612492 [opencl_init] FINALLY: opencl is AVAILABLE on this system.
0.612493 [opencl_init] initial status of opencl enabled flag is ON.
PantherX
Site Moderator
Posts: 6986
Joined: Wed Dec 23, 2009 9:33 am
Hardware configuration: V7.6.21 -> Multi-purpose 24/7
Windows 10 64-bit
CPU:2/3/4/6 -> Intel i7-6700K
GPU:1 -> Nvidia GTX 1080 Ti
§
Retired:
2x Nvidia GTX 1070
Nvidia GTX 675M
Nvidia GTX 660 Ti
Nvidia GTX 650 SC
Nvidia GTX 260 896 MB SOC
Nvidia 9600GT 1 GB OC
Nvidia 9500M GS
Nvidia 8800GTS 320 MB

Intel Core i7-860
Intel Core i7-3840QM
Intel i3-3240
Intel Core 2 Duo E8200
Intel Core 2 Duo E6550
Intel Core 2 Duo T8300
Intel Pentium E5500
Intel Pentium E5400
Location: Land Of The Long White Cloud
Contact:

Re: RX 5700 and Ubuntu 20.04

Post by PantherX »

May I suggest that you uninstall FAHClient and then reinstall it to see if it detects the GPU or not? From what I have read, the FAHClient does a decent job of GPU detection when it is first installed. Also, can you please post the new log file too to see what the client does?
ETA:
Now ↞ Very Soon ↔ Soon ↔ Soon-ish ↔ Not Soon ↠ End Of Time

Welcome To The F@H Support Forum Ӂ Troubleshooting Bad WUs Ӂ Troubleshooting Server Connectivity Issues
zookeeny
Posts: 23
Joined: Fri Apr 03, 2020 1:32 pm

Re: RX 5700 and Ubuntu 20.04

Post by zookeeny »

Unfortunately that didn't work either. I removed FAHclient and then reinstalled it, but the GPU still isn't found. Here's the first-time startup information from the log:

Code: Select all

*********************** Log Started 2020-06-14T13:53:20Z ***********************
13:53:20:Trying to access database...
13:53:20:Successfully acquired database lock
13:53:20:Read GPUs.txt
13:53:20:Enabled folding slot 00: READY cpu:23
13:53:20:****************************** FAHClient ******************************
13:53:20:    Version: 7.6.13
13:53:20:     Author: Joseph Coffland <joseph@cauldrondevelopment.com>
13:53:20:  Copyright: 2020 foldingathome.org
13:53:20:   Homepage: https://foldingathome.org/
13:53:20:       Date: Apr 28 2020
13:53:20:       Time: 04:20:16
13:53:20:   Revision: 5a652817f46116b6e135503af97f18e094414e3b
13:53:20:     Branch: master
13:53:20:   Compiler: GNU 8.3.0
13:53:20:    Options: -std=c++11 -ffunction-sections -fdata-sections -O3 -funroll-loops
13:53:20:             -fno-pie
13:53:20:   Platform: linux2 4.19.0-5-amd64
13:53:20:       Bits: 64
13:53:20:       Mode: Release
13:53:20:       Args: --child /etc/fahclient/config.xml --run-as fahclient
13:53:20:             --pid-file=/var/run/fahclient.pid --daemon
13:53:20:     Config: /etc/fahclient/config.xml
13:53:20:******************************** CBang ********************************
13:53:20:       Date: Apr 25 2020
13:53:20:       Time: 00:07:53
13:53:20:   Revision: ea081a3b3b0f4a37c4d0440b4f1bc184197c7797
13:53:20:     Branch: master
13:53:20:   Compiler: GNU 8.3.0
13:53:20:    Options: -std=c++11 -ffunction-sections -fdata-sections -O3 -funroll-loops
13:53:20:             -fno-pie -fPIC
13:53:20:   Platform: linux2 4.19.0-5-amd64
13:53:20:       Bits: 64
13:53:20:       Mode: Release
13:53:20:******************************* System ********************************
13:53:20:        CPU: AMD Ryzen 9 3900X 12-Core Processor
13:53:20:     CPU ID: AuthenticAMD Family 23 Model 113 Stepping 0
13:53:20:       CPUs: 24
13:53:20:     Memory: 31.37GiB
13:53:20:Free Memory: 23.66GiB
13:53:20:    Threads: POSIX_THREADS
13:53:20: OS Version: 5.4
13:53:20:Has Battery: false
13:53:20: On Battery: false
13:53:20: UTC Offset: -4
13:53:20:        PID: 35753
13:53:20:        CWD: /var/lib/fahclient
13:53:20:         OS: Linux 5.4.0-7634-generic x86_64
13:53:20:    OS Arch: AMD64
13:53:20:       GPUs: 1
13:53:20:      GPU 0: Bus:12 Slot:0 Func:0 AMD:6 Navi 10 [Radeon RX 5600 OEM/5600 XT /
13:53:20:             5700/5700 XT]
13:53:20:       CUDA: Not detected: Failed to open dynamic library 'libcuda.so':
13:53:20:             libcuda.so: cannot open shared object file: No such file or
13:53:20:             directory
13:53:20:     OpenCL: Not detected: clGetDeviceIDs() returned -1
13:53:20:******************************* libFAH ********************************
13:53:20:       Date: Apr 15 2020
13:53:20:       Time: 21:43:24
13:53:20:   Revision: 216968bc7025029c841ed6e36e81a03a316890d3
13:53:20:     Branch: master
13:53:20:   Compiler: GNU 8.3.0
13:53:20:    Options: -std=c++11 -ffunction-sections -fdata-sections -O3 -funroll-loops
13:53:20:             -fno-pie
13:53:20:   Platform: linux2 4.19.0-5-amd64
13:53:20:       Bits: 64
13:53:20:       Mode: Release
13:53:20:***********************************************************************
ajm
Posts: 750
Joined: Sat Mar 21, 2020 5:22 am
Location: Lucerne, Switzerland

Re: RX 5700 and Ubuntu 20.04

Post by ajm »

I was able to get passed that only when running FAH as root. You may want to give it a try.
zookeeny
Posts: 23
Joined: Fri Apr 03, 2020 1:32 pm

Re: RX 5700 and Ubuntu 20.04

Post by zookeeny »

I think you're on to something there! I just tried to dump a bad work unit by running "FAHClient --dump 0" on the command line (which didn't work, but that's another story), and the below was the response - note the two OpenCL devices now appearing at the bottom. I'm thinking that I might be able to just add user fahclient to the group that allows OpenCL access, but I'm not sure what group that would be. Running it as root would probably do it too, but I'll have to try that out later. Thanks!

Code: Select all

16:08:11:******************************* System ********************************
16:08:11:            CPU: AMD Ryzen 9 3900X 12-Core Processor
16:08:11:         CPU ID: AuthenticAMD Family 23 Model 113 Stepping 0
16:08:11:           CPUs: 24
16:08:11:         Memory: 31.37GiB
16:08:11:    Free Memory: 26.74GiB
16:08:11:        Threads: POSIX_THREADS
16:08:11:     OS Version: 5.4
16:08:11:    Has Battery: false
16:08:11:     On Battery: false
16:08:11:     UTC Offset: -4
16:08:11:            PID: 4822
16:08:11:             OS: Linux 5.4.0-7634-generic x86_64
16:08:11:        OS Arch: AMD64
16:08:11:           GPUs: 1
16:08:11:          GPU 0: Bus:12 Slot:0 Func:0 AMD:6 Navi 10 [Radeon RX 5600 OEM/5600 XT
16:08:11:                 / 5700/5700 XT]
16:08:11:           CUDA: Not detected: Failed to open dynamic library 'libcuda.so':
16:08:11:                 libcuda.so: cannot open shared object file: No such file or
16:08:11:                 directory
16:08:11:OpenCL Device 0: Platform:0 Device:0 Bus:12 Slot:0 Compute:2.0 Driver:3110.6
16:08:11:OpenCL Device 1: Platform:1 Device:0 Bus:NA Slot:NA Compute:1.1 Driver:20.0
ajm
Posts: 750
Joined: Sat Mar 21, 2020 5:22 am
Location: Lucerne, Switzerland

Re: RX 5700 and Ubuntu 20.04

Post by ajm »

You can also try to only add FAH to the video group. It worked for some people.
See viewtopic.php?p=335323#p335323
Joe_H
Site Admin
Posts: 7937
Joined: Tue Apr 21, 2009 4:41 pm
Hardware configuration: Mac Pro 2.8 quad 12 GB smp4
MacBook Pro 2.9 i7 8 GB smp2
Location: W. MA

Re: RX 5700 and Ubuntu 20.04

Post by Joe_H »

Some Linux versions require the fahclient user account to be added to the 'render' group. You may also need to designate the 'render' or 'video' group as the primary group the account belongs to based on information that has been posted to the forum.
Image

iMac 2.8 i7 12 GB smp8, Mac Pro 2.8 quad 12 GB smp6
MacBook Pro 2.9 i7 8 GB smp3
mad_martn
Posts: 21
Joined: Sat Mar 28, 2020 6:34 pm

Re: RX 5700 and Ubuntu 20.04

Post by mad_martn »

you probably have to add a systemd service unit, see viewtopic.php?f=81&t=33353 scroll down to 'Fixing the permissions issue (clGetDeviceIDs() returned -1)'
MeeLee
Posts: 1339
Joined: Tue Feb 19, 2019 10:16 pm

Re: RX 5700 and Ubuntu 20.04

Post by MeeLee »

Don't just uninstall fah. Purge it too.
sudo apt purge fahclient fahcontrol

before installing it.

Also do a furmark, or heaven benchmark, to see if the GPU works the way it should.
zookeeny
Posts: 23
Joined: Fri Apr 03, 2020 1:32 pm

Re: RX 5700 and Ubuntu 20.04

Post by zookeeny »

Thanks for all of the suggestions! I tried just adding user fahclient to the video and render groups, but that didn't seem to make any difference. Then I saw mad_martn's post, and realized that was probably why the group additions weren't working. So I:
  • Purged my fahclient installation and reinstalled from scratch
  • Added user fahclient to groups video and render
  • Created a systemd startup file for FAHClient.service
  • Rebooted
This resulted in a black screen :e( , but apparently everything started up normally since I was able to ssh in... just the video wasn't working. This may be one of the side-effects of doing OpenCL calculations on my only video card, but not sure about that. But looking at the log FAHClient definitely found the card and recognized it as supporting OpenCL, I just need to figure out now if it's possible to actually use the monitor and do OpenCL calculations at the same time. But I appreciate all of the help!
mad_martn
Posts: 21
Joined: Sat Mar 28, 2020 6:34 pm

Re: RX 5700 and Ubuntu 20.04

Post by mad_martn »

zookeeny wrote: This resulted in a black screen :e( , but apparently everything started up normally since I was able to ssh in... just the video wasn't working. This may be one of the side-effects of doing OpenCL calculations on my only video card, but not sure about that. ...
did you have a Linux kernel update in between? ... just guesswork, i'm using debian bullseye/testing and only use the opencl bits from the amdgpu-pro ubuntu package, i had black screens after reboot (xserver fail caused by amdgpu drm crash) with some combinations of kernel and opencl packages coming from the AMD ubuntu package
MeeLee
Posts: 1339
Joined: Tue Feb 19, 2019 10:16 pm

Re: RX 5700 and Ubuntu 20.04

Post by MeeLee »

Your Linux OS might have defaulted to the IGP of other GPU for the GUI?
Your main GPU should not give a blank screen.
Did you see any pre OS loading going on?
Can you get into the bios?
If you have one of the latest X570 or X400 series motherboards, they tend to be very flaky.
A lot of bugs that make no sense.
I believe the AMD overclocking tools, use up too much space of the BIOS opcode, causing people to sometimes have to reinstall the latest BIOS upgrade, to reset it.
zookeeny
Posts: 23
Joined: Fri Apr 03, 2020 1:32 pm

Re: RX 5700 and Ubuntu 20.04

Post by zookeeny »

Thanks again to everyone for all the help! After messing with things a bit further I finally got both the CPU and GPU slots folding. I haven't tried rebooting yet, so I don't know if the black screen on startup will be an issue again, but I'll cross that bridge when I get to it. Here are the steps that worked for me:
  • Installed only the OpenCL component of amdgpu ("sudo amdgpu-install --open-cl=pal --headless --no-dkms")
  • Stopped FAHClient ("sudo /etc/init.d/FAHClient stop" - for some reason "sudo systemctl stop FAHClient" didn't work for me, although I think it should have)
  • Made video the primary group for user fahclient ("sudo usermod -a -g video fahclient")
  • Added supplemental group render for user fahclient ("sudo usermod -a -G render fahclient")
  • Changed the FAHClient startup from init.d to systemd (viewtopic.php?f=81&t=33353)
  • Manually updated /etc/fahclient/config.xml to add the new GPU slot (I had to do this because FAHControl requires a python package my system can't install)
  • Restarted FAHClient through systemd ("sudo systemctl daemon-reload" and "sudo systemctl start FAHClient.service")
One caveat: I'm running Pop_OS, which is derived from Ubuntu, but there may be some minor differences because of that.

It took a little while for FAHClient to find an available GPU work unit, but it finally did, and is about 20% through it. Success!
Post Reply