AMD GPU on Linux
Moderators: Site Moderators, FAHC Science Team
AMD GPU on Linux
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
-
- Site Admin
- Posts: 7922
- 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
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.
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.
iMac 2.8 i7 12 GB smp8, Mac Pro 2.8 quad 12 GB smp6
MacBook Pro 2.9 i7 8 GB smp3
Re: AMD GPU on Linux
There have been some challenges over the years, but it's not too bad to get this up and running.
Try this:
fah.service:
Then apply the workaround described here: viewtopic.php?p=358184#p358184
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
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
Last edited by tchiers on Wed Apr 12, 2023 7:39 pm, edited 1 time in total.
-
- Posts: 938
- 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
When adding user to render group, better use sudo usermod -a -G render fahclienttchiers 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:
fah.service: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
Then apply the workaround described here: viewtopic.php?p=358184#p358184Code: 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
Also, there is a lot of dark magic in the post 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
-
- Site Moderator
- Posts: 1091
- Joined: Sat Dec 08, 2007 1:33 am
- Location: San Francisco, CA
- Contact:
Re: AMD GPU on Linux
Interestingly, Joseph went with the adduser command to add groups.
https://github.com/FoldingAtHome/fah-cl ... 8c7c80d83e
https://github.com/FoldingAtHome/fah-cl ... 8c7c80d83e
-
- Posts: 938
- 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
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
-
- Site Moderator
- Posts: 1091
- Joined: Sat Dec 08, 2007 1:33 am
- Location: San Francisco, CA
- Contact:
Re: AMD GPU on Linux
I believe it is still needed for v7.
Re: AMD GPU on Linux
Yeah, usermod -a -G is probably better, but fahclient does not need to belong to any other groups.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 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
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!
-
- Posts: 938
- 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
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.tchiers wrote: ↑Wed Apr 05, 2023 1:10 pmYeah, usermod -a -G is probably better, but fahclient does not need to belong to any other groups.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 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
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!
FAH Omega tester
Re: AMD GPU on Linux
Looks like v8 is already systemd native: https://github.com/FoldingAtHome/fah-cl ... nt.service 8)
-
- Site Admin
- Posts: 7922
- 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
There have been reports of other Linux distros requiring the FAHClient user to also be in the "video" group.
iMac 2.8 i7 12 GB smp8, Mac Pro 2.8 quad 12 GB smp6
MacBook Pro 2.9 i7 8 GB smp3
Re: AMD GPU on Linux
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.
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.