Page 1 of 1

AMD GPU on Linux

Posted: Tue Mar 28, 2023 4:53 pm
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

Re: AMD GPU on Linux

Posted: Tue Mar 28, 2023 5:08 pm
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.

Re: AMD GPU on Linux

Posted: Wed Mar 29, 2023 7:49 pm
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

Re: AMD GPU on Linux

Posted: Tue Apr 04, 2023 9:45 pm
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

Re: AMD GPU on Linux

Posted: Tue Apr 04, 2023 9:58 pm
by calxalot
Interestingly, Joseph went with the adduser command to add groups.

https://github.com/FoldingAtHome/fah-cl ... 8c7c80d83e

Re: AMD GPU on Linux

Posted: Tue Apr 04, 2023 10:28 pm
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

Re: AMD GPU on Linux

Posted: Tue Apr 04, 2023 10:40 pm
by calxalot
I believe it is still needed for v7.

Re: AMD GPU on Linux

Posted: Wed Apr 05, 2023 1:10 pm
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!

Re: AMD GPU on Linux

Posted: Wed Apr 05, 2023 1:23 pm
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.

Re: AMD GPU on Linux

Posted: Wed Apr 05, 2023 1:29 pm
by tchiers
Looks like v8 is already systemd native: https://github.com/FoldingAtHome/fah-cl ... nt.service 8)

Re: AMD GPU on Linux

Posted: Wed Apr 05, 2023 3:26 pm
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.

Re: AMD GPU on Linux

Posted: Sat Aug 12, 2023 2:20 pm
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.