AMD GPU on Linux

It seems that a lot of GPU problems revolve around specific versions of drivers. Though AMD has their own support structure, you can often learn from information reported by others who fold.

Moderators: Site Moderators, FAHC Science Team

Post Reply
panic
Posts: 1
Joined: Tue Mar 28, 2023 4:51 pm

AMD GPU on Linux

Post by panic »

What do I need to do to get folding at home to work on my 6900 XT? Currently running Linux Mint 21.1 and nothing is happening
Joe_H
Site Admin
Posts: 7939
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: AMD GPU on Linux

Post by Joe_H »

Proprietary drivers from AMD, OpenCL support installed, sacrifice a chicken.

The last is said a bit facetiously, but the AMD support for OpenCL and their video drivers on Linux is a mess. There is a reason less than 100 systems are currently folding on AMD and Linux systems. You can find posts here from people who managed to install everything and get folding to work using the AMD proprietary driver and/or ROCm. Even they have run into issues when a new kernel comes out or other updates happen to their Linux system.
Image

iMac 2.8 i7 12 GB smp8, Mac Pro 2.8 quad 12 GB smp6
MacBook Pro 2.9 i7 8 GB smp3
tchiers
Posts: 23
Joined: Tue Oct 23, 2018 4:23 am

Re: AMD GPU on Linux

Post by tchiers »

There have been some challenges over the years, but it's not too bad to get this up and running.

Try this:

Code: Select all

#install AMD drivers, only for openCL
wget https://repo.radeon.com/amdgpu-install/22.40.3/ubuntu/jammy/amdgpu-install_5.4.50403-1_all.deb
sudo apt install ./amdgpu-install_5.4.50403-1_all.deb 
sudo amdgpu-install --usecase=opencl --opencl=rocr

#install FAH client
wget https://download.foldingathome.org/releases/public/release/fahclient/debian-stable-64bit/v7.6/fahclient_7.6.21_amd64.deb
sudo apt install ./fahclient_7.6.21_amd64.deb 

#add fahclient to render group
sudo  usermod  -a -G render fahclient

#disable systemd auto-translated service, cannot run fahclient as user fahclient
sudo systemctl stop FAHClient.service 
sudo systemctl disable FAHClient.service 

#reboot
sudo shutdown -r now

#replace with native fah.service
sudo nano /etc/systemd/system/fah.service
sudo systemctl daemon-reload
sudo systemctl start fah.service
fah.service:

Code: Select all

[Unit]
Description=Folding@Home for Systemd
After=remote-fs.target
After=network-online.target
Wants=network-online.target


[Service]
Type=simple
WorkingDirectory=/var/lib/fahclient
User=fahclient
ExecStartPre=!/usr/bin/touch /var/run/fahclient.pid
ExecStartPre=!/bin/chown fahclient /var/run/fahclient.pid
ExecStart=/usr/bin/FAHClient /etc/fahclient/config.xml --pid-file=/var/run/fahclient.pid

[Install]
WantedBy=default.target
Then apply the workaround described here: viewtopic.php?p=358184#p358184
Last edited by tchiers on Wed Apr 12, 2023 7:39 pm, edited 1 time in total.
muziqaz
Posts: 946
Joined: Sun Dec 16, 2007 6:22 pm
Hardware configuration: 7950x3D, 5950x, 5800x3D, 3900x
7900xtx, Radeon 7, 5700xt, 6900xt, RX 550 640SP
Location: London
Contact:

Re: AMD GPU on Linux

Post by muziqaz »

tchiers wrote: Wed Mar 29, 2023 7:49 pm There have been some challenges over the years, but it's not too bad to get this up and running.

Try this:

Code: Select all

#install AMD drivers, only for openCL
wget https://repo.radeon.com/amdgpu-install/22.40.3/ubuntu/jammy/amdgpu-install_5.4.50403-1_all.deb
sudo apt install ./amdgpu-install_5.4.50403-1_all.deb 
sudo amdgpu-install --usecase=opencl --opencl=rocr

#install FAH client
wget https://download.foldingathome.org/releases/public/release/fahclient/debian-stable-64bit/v7.6/fahclient_7.6.21_amd64.deb
sudo apt install ./fahclient_7.6.21_amd64.deb 

#add fahclient to render group
sudo  usermod -G render fahclient

#disable systemd auto-translated service, cannot run fahclient as user fahclient
sudo systemctl stop FAHClient.service 
sudo systemctl disable FAHClient.service 

#reboot
sudo shutdown -r now

#replace with native fah.service
sudo nano /etc/systemd/system/fah.service
sudo systemctl daemon-reload
sudo systemctl start fah.service
fah.service:

Code: Select all

[Unit]
Description=Folding@Home for Systemd
After=remote-fs.target
After=network-online.target
Wants=network-online.target


[Service]
Type=simple
WorkingDirectory=/var/lib/fahclient
User=fahclient
ExecStartPre=!/usr/bin/touch /var/run/fahclient.pid
ExecStartPre=!/bin/chown fahclient /var/run/fahclient.pid
ExecStart=/usr/bin/FAHClient /etc/fahclient/config.xml --pid-file=/var/run/fahclient.pid

[Install]
WantedBy=default.target
Then apply the workaround described here: viewtopic.php?p=358184#p358184
When adding user to render group, better use sudo usermod -a -G render fahclient
Also, there is a lot of dark magic in the post :D Most of it is not needed. amdgpu stack sort everything out these days. The only thing at this current moment what is needed is the workaround linked. The fix is coming too for that
FAH Omega tester
calxalot
Site Moderator
Posts: 1140
Joined: Sat Dec 08, 2007 1:33 am
Location: San Francisco, CA
Contact:

Re: AMD GPU on Linux

Post by calxalot »

Interestingly, Joseph went with the adduser command to add groups.

https://github.com/FoldingAtHome/fah-cl ... 8c7c80d83e
muziqaz
Posts: 946
Joined: Sun Dec 16, 2007 6:22 pm
Hardware configuration: 7950x3D, 5950x, 5800x3D, 3900x
7900xtx, Radeon 7, 5700xt, 6900xt, RX 550 640SP
Location: London
Contact:

Re: AMD GPU on Linux

Post by muziqaz »

I wonder if that is still needed done by a user. I did it before I tried the workaround, but I believe the workaround was what sorted the issue and not the usermod thingy. I might try removing fahclient from render group to see how that reacts and what type of message it will show
FAH Omega tester
calxalot
Site Moderator
Posts: 1140
Joined: Sat Dec 08, 2007 1:33 am
Location: San Francisco, CA
Contact:

Re: AMD GPU on Linux

Post by calxalot »

I believe it is still needed for v7.
tchiers
Posts: 23
Joined: Tue Oct 23, 2018 4:23 am

Re: AMD GPU on Linux

Post by tchiers »

muziqaz wrote: Tue Apr 04, 2023 9:45 pm
When adding user to render group, better use sudo usermod -a -G render fahclient
Also, there is a lot of dark magic in the post :D Most of it is not needed. amdgpu stack sort everything out these days. The only thing at this current moment what is needed is the workaround linked. The fix is coming too for that
Yeah, usermod -a -G is probably better, but fahclient does not need to belong to any other groups.

The replacement systemd service is to address this issue: viewtopic.php?p=303571#p303571

It would be great to see all this resolved in the v8 client so people can just install and fold!
muziqaz
Posts: 946
Joined: Sun Dec 16, 2007 6:22 pm
Hardware configuration: 7950x3D, 5950x, 5800x3D, 3900x
7900xtx, Radeon 7, 5700xt, 6900xt, RX 550 640SP
Location: London
Contact:

Re: AMD GPU on Linux

Post by muziqaz »

tchiers wrote: Wed Apr 05, 2023 1:10 pm
muziqaz wrote: Tue Apr 04, 2023 9:45 pm
When adding user to render group, better use sudo usermod -a -G render fahclient
Also, there is a lot of dark magic in the post :D Most of it is not needed. amdgpu stack sort everything out these days. The only thing at this current moment what is needed is the workaround linked. The fix is coming too for that
Yeah, usermod -a -G is probably better, but fahclient does not need to belong to any other groups.

The replacement systemd service is to address this issue: viewtopic.php?p=303571#p303571

It would be great to see all this resolved in the v8 client so people can just install and fold!
This can be pointed out to the dev in GitHub linked few comments up. That way dev is aware of it, if he isn't already. If I have time I'll try V8 service option to see if I encounter any issues.
FAH Omega tester
tchiers
Posts: 23
Joined: Tue Oct 23, 2018 4:23 am

Re: AMD GPU on Linux

Post by tchiers »

Looks like v8 is already systemd native: https://github.com/FoldingAtHome/fah-cl ... nt.service 8)
Joe_H
Site Admin
Posts: 7939
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: AMD GPU on Linux

Post by Joe_H »

tchiers wrote: Wed Apr 05, 2023 1:10 pm Yeah, usermod -a -G is probably better, but fahclient does not need to belong to any other groups.
There have been reports of other Linux distros requiring the FAHClient user to also be in the "video" group.
Image

iMac 2.8 i7 12 GB smp8, Mac Pro 2.8 quad 12 GB smp6
MacBook Pro 2.9 i7 8 GB smp3
Llewen
Posts: 1
Joined: Sat Aug 12, 2023 1:22 pm

Re: AMD GPU on Linux

Post by Llewen »

A few gotchas, on Debian at least.

These should already be set correctly, but you may need to double check.
sudo chown fahclient /etc/fahclient/config.xml
sudo chmod 664 /etc/fahclient/config.xml

This you will absolutely need to do.
sudo chown -R fahclient /var/lib/fahclient

Another gotcha. If you use the liquorix or xanmod kernels, and perhaps any other advanced performance tuned kernel, you need to use the following command to install the opencl drivers.

amdgpu-install --usecase=opencl --opencl=rocr --no-dkms

Unfortunately when you do that, FAHClient loses access to the gpu's, unless someone has found a workaround for that, but it appears that FAHClient gpu functionality requires the opencl kernel driver created by dkms.
Post Reply