#356 Added How to OpenCL quick doc.
Closed 2 years ago by ankursinha. Opened 3 years ago by jatin1812.
fedora-docs/ jatin1812/quick-docs master  into  master

empty or binary file added
@@ -0,0 +1,85 @@ 

+ = How to install OpenCL alongside mesa

+ 

+ == Introduction

+ 

+ The Objective is to install OpenCL userspace drivers as provided in the amdgpu-pro driver stack to work along default mesa drivers. A common use case is, for enabling GPU rendering in softwares like Blender, Darktable.

+ 

+ [WARNING]

+ 

+ ====

+ 

+ Make sure you don't have mesa-libOpenCL installed. If you have installed it, please remove it. The mesa library for OpenCL is not currently supported by softwares like Blender and it will conflict with the OpenCL drivers provided by this driver stack. Also make sure you don't have OpenCL or drivers installed from Rocm repository as it has had issues in the past and is not recommended.

+ ----

+ 	

+ sudo dnf remove mesa-libOpenCL

+ 	

+ ----

+ 

+ ====

+ 

+ == Step #1 : Download Radeon Software for Linux

+ 

+ Download the tar.gz from AMD website provided for RHEL for RedHat/CentOS 8.xx. Currently the latest version tested is 20.50 -

+ 

+ https://www.amd.com/en/support/kb/release-notes/rn-amdgpu-unified-linux-20-50[Radeon Software for linux 20.50]

+ 

+ == Step #2 : Extract and move

+ 

+ Extract and move it into /var/local and rename the extracted folder to amdgpu. Execute -

+ 

+ ----

+ cd /var/local

+ sudo tar xf /path/to/amdgpu-pro-xx-xx-xxxxxx-rhel-x.x.tar.xz

+ sudo mv amdgpu-pro-xx-xx-xxxxxx-rhel-x.x amdgpu

+ ----

+ 

+ == Step #3 : Setup a repository

+ 

+ Create a repository file using your favorite text editor I will use nano. You can also use gedit for ease of use.

+ 

+ ----

+ sudo nano /etc/yum.repos.d/amdgpu.repo

+ ----

+ 

+ Copy paste and save the following:

+ 

+ ----

+ [amdgpu]

+ name=AMDGPU Packages

+ baseurl=file:///var/local/amdgpu/

+ enabled=1

+ skip_if_unavailable=1

+ gpgcheck=0

+ cost=500

+ metadata_expire=300

+ ----

+ 

+ == Step #4 : Install the required packages

+ 

+ Now update and install the required OpenCL packages. Execute

+ ----

+ sudo dnf update

+ sudo dnf install opencl-rocr-amdgpu-pro rocm-device-libs-amdgpu-pro hsa-runtime-rocr-amdgpu hsakmt-roct-amdgpu hip-rocr-amdgpu-pro comgr-amdgpu-pro opencl-orca-amdgpu-pro-icd

+ ----

+ 

+ [NOTE]

+ 

+ ====

+ 

+ AMD GPU Core (amdgpu-core) package will fail to install and it is fine as we want to use amdgpu drivers already in the kernel.

+ 

+ ====

+ 

+ == Step #5 : Restart the System 

+ 

+ Restart your system and you can test OpenCL in softwares like Blender and Darktable.

+ 

+ image:how-to-opencl-blender.png[OpenCL user-space drivers from 20.50 working with default mesa drivers on Fedora 33]

+ 

+ [NOTE]

+ 	

+ ====

+ 	

+ You can update OpenCL by simply replacing /var/local/amdgpu folder with the new one and running a dnf update, however in rare cases AMD changes the package names. I will keep this guide updated according to the latest radeon software repository.

+ 	

+ ====

A quick doc on how to correctly setup OpenCL usespace drivers to work alongside mesa.

This installs required userspace components from the radeon repository, without installing any kernel/dkms components. This is identical to how Arch Linux provides opencl-amd package https://aur.archlinux.org/packages/opencl-amd/

This guide installs radeon repository in /var/local and adds a repository file in /etc/yum.repos.d
And required packages are then installed.

Problems this will solve -

-Many users install openCL from mesa-libOpenCL package or Rocm repository, which is NOT currently supported by many applications.

-Many users install not needed components like amdgpu dkms which results in kernel build failure.

-This guide also takes care of using the free amdgpu drivers in the kernel and NOT the nonfree ones.

You should use ROCm on Fedora instead of Ubuntu/RHEL only AMDGPU-PRO.

Check this manual (in Russian, but you can use Google Translate).

@xvitaly Rocm is not meant for GUI apps. Many GUI apps don't support OpenCL installed from Rocm repository. Most AI/ML stuff does work tho.

And this will not use any AMD GPU pro drivers or dkms. But only components that we need and will use mesa/amdgpu in kernel as the graphics stack.

I also recommend you to look at the PKGBUILD of https://aur.archlinux.org/packages/opencl-amd/

Blender for example will have either a segfault or will not support Rocm (It is not meant for GUI apps)

So currently this guide is a solution for keeping mesa/amdgpu drivers in the kernel alongside openCL userspace components from Radeon software repository.

I also recommend you to look at the PKGBUILD of https://aur.archlinux.org/packages/opencl-amd/

Fedora is not Arch. What next proprietary software we will advise to install in official Fedora docs?

And this will not use any AMD GPU pro drivers or dkms.

The Objective is to install OpenCL userspace drivers as provided in the amdgpu-pro driver stack

Mutually exclusive.

Blender for example will have either a segfault or will not support Rocm (It is not meant for GUI apps)

Not Blender. Cycles render - https://github.com/RadeonOpenCompute/ROCm/issues/1106. ROCm devs promised to fix this in next versions.

Per Legal, official docs which recommend third-party (and possibly closed-license) software should have the "caution" template at the top of the page https://docs.fedoraproject.org/en-US/quick-docs/installing-chromium-or-google-chrome-browsers/

That's:

include::{partialsdir}/3rdparty-message.adoc[]

@atim Thanks for sharing the issue thread. I too want Rocm to support GUI apps better.

  • I just gave PKGBUILD reference to assure that they are user space components, I was not comparing things in any way. Sorry If i shouldn't have mentioned it.
  • Not just cycles render but AMD radeon pro render and also other GUI apps. https://www.phoronix.com/scan.php?page=news_item&px=ROCm-Will-Support-GUI-Apps This info also mentions a good info about apps that are considered unsupported. And the guide does install Rocm components present in Radeon software stack mentioned here.
  • From https://github.com/RadeonOpenCompute/ROCm#hardware-and-software-support
    Note: The AMD ROCmâ„¢ open software platform is a compute stack for headless system deployments. GUI-based software applications are currently not supported.

  • However latest info according to the issue thread -
    We are going to rephrase the text about GUI apps in our rocm documentation.
    We have come up with some plans to handle GUI apps in a way.

I will keep up with latest updates however they may have a plan to support GUI apps, but it is just not CURRENTLY designed that way to support GUI apps and is meant to run on headless system deployments. There are people on fedora forum sites who ask this alot and its just to make their experience better.

but it is just not CURRENTLY designed that way to support GUI apps and is meant to run on headless system deployments. There are people on fedora forum sites who ask this alot and its just to make their experience better.

A i am ask a lot as well functional OpenCL from AMD for decades. :) And thanks for trying help and improve experiences. Sorry, i should clarify my point better too: for some group of users ROCm would enough, without GUI support and ROCm is open stack. So maybe we can provide both methods in docs? One with open stack (ROCm) and another one with amdgpu-pro hacks?

Sure I can do another PR covering both Rocm and OpenCL userspace drivers from Radeon software repository and use cases of both of them. Spliting the Doc into 2 parts. I think that will be ideal. Also will add this as matthew said.

include::{partialsdir}/3rdparty-message.adoc[]

Do I have to close this PR and re fork and open another PR ? As I am quite new to pagure and as pagure has some bugs I faced before like HTTPS pushes (403). I will be more comfortable doing SSH clone again and doing changes and submit a follow up PR.
Also its not letting me update my fork to upstream, so I will delete my fork and do the fork again. @atim

Hey,

No, like GitHub you can keep pushing more commits to your branch and Pagure
will keep updating the PR.

--
Thanks,

Ankur

(Via email)

Metadata Update from @pbokoc:
- Request assigned

2 years ago

I have gathered Rocm information will work on the doc today ! Thanks for all the support.

Pull-Request has been closed by ankursinha

2 years ago