Mystro256/rocm-hip

Description

Test/exploratory builds for ROCm on Fedora (non-OpenCL related). Expect this repo to be unstable.

WARNING: REPO IS FOR TESTING PURPOSES ONLY. PLEASE USE AT YOUR OWN RISK.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Installation Instructions

Instructions not filled in by author. Author knows what to do. Everybody else should avoid this repo.

Active Releases

The following unofficial repositories are provided as-is by owner of this project. Contact the owner directly for bugs or issues (IE: not bugzilla).

* Total number of packages downloaded in the last seven days.


This is a companion discussion topic for the original entry at https://copr.fedorainfracloud.org/coprs/mystro256/rocm-hip/

Thanks @mystro256 for setting this up! Do you have any plans to update this package in the near future to the latest release (i.e. 5.2.1 at the time of writing)?

From what I understand, the latest version has several (if not all) of the extra patches included already which would simplify the spec file as well. However, I think you have a better overview of the patch situation which is why I thought to reach out to you before I start tinkering myself with this.

@awehrfritz yeah most if not all of the patches can be dropped, but I ran into compilation issues likely due to a GCC bump in fedora. I’ll get around to it eventually, but I’ve been a bit too busy lately.

I totally understand, this is not really urgent for me either at the moment, especially since ROCm OpenCL installed via the official Fedora package works like a charm so far.

Though, I was hoping to also get HIP working as that is the primary target for my HPC software development efforts.

Is this package meant as a solution for enabling HIP support in blender? I tried it, and it didn’t work for that purpose on my RX 6700XT. Any suggestions if that is not the purpose of this package?

Hi @morgana,
In principle, blender should work with this package installed. However, in practice it seems there are still quite some issues to be sorted out.

I have created a largely reworked and updated ROCm-hip package here: awehrfritz/rocm-hip Copr
And the respective spec file is here in case you are interested: GitHub - awehrfritz/rocm-hip-rpm: ROCm HIP Fedora Copr rpm package

However, even with the updated package there are still a whole lot of problems. I found in particular that the Perl wrapper scripts around clang/llvm are full of hardcoded paths and essentially only work if the entire stack is installed in /opt/rocm. I have reported some of those issues in upstream bug reports or pull requests, let’s see how fast they can fix them.

Thanks for the info. This is my first time using COPR, so I just want to confirm that i am doing this correctly. As root, I type dnf copr enable mystro256/rocm-hip for this repo or dnf copr enable awehrfritz/rocm-hip for the reworked repo. Then, it’s as simple as sudo dnf install rocm-hip? Again, I thank you for your help. Hopefully this gets resolved in the official Fedora release soon.

Yes, that should get you the packages installed. Just to mention, I have only Fedora 36 enabled at the moment as that is the only system I have tested.

Also, as mentioned above, there are still a lot of problems with these packages, all of which are due to bugs or shortcomings in the upstream source code or build system. For instance, so far I have not managed to correctly compile any of the examples out of the box, I have to manually fix the compiler commands to get that done since there are various issues still in the stack.

Furthermore, Debian and Gentoo have similar issues and implemented various workarounds for older versions. Arch Linux takes a different approach, i.e. install everything on /opt/rocm, and thus seems to have fewer problems.

I don’t think that this will be resolved any time soon, mainly because upstream doesn’t seem to have any interest in getting their software into the distros and moves rather slowly on any bug reports or pull requests.

Yeah I’ve been working with them to resolve a lot of these issues, so they’re known. The Debian guys also are trying to get this packaged too, so I can connect you with them if it helps.

Unfortunately the scale of the problem makes it difficult to resolve in a timely manner.
Please make sure you keep me in the loop and I can see what I can do; my username is Mystro256 on github. If you have any patches in a pull request, I can try to use my connections to attempt to hasten the review process. :slight_smile:

I don’t think this is true:

mainly because upstream doesn’t seem to have any interest in getting their software into the distros

But rather it’s not a priority due to resource constraints. As I said in my previous comment, if you have open pull requests, I can try to help give them a bit more attention if you CC me.

OK, @mystro256, you might have more insight to this than I do. This is just how it appears to me, and is largely based on the number of obvious issues that are in the build and configuration scripts for the entire ROCm stack.

For instance, the OpenCL and HIP packages, require still a whole lot of patches from the development branch, even for the latest release, as well as additional workarounds and fixes to at least get OpenCL side working. HIP is still not yet usable in Fedora - and that is after a major effort from you over the past half a year or so.

Here a list of issues/PRs which address some of the issues in the HIP packages for Fedora (and apply equally to Debian/Gentoo):

In a comment in the first issue (hipamd/#43-comment), I also describe another issue with a link to a patch in Debian. I will open a separate issue for that as requested by one of the developers.

@awehrfritz @morgana FYI I have rocm-hip in review for Fedora:
https://bugzilla.redhat.com/show_bug.cgi?id=2209759

There should be a new build in this copr, ignore the aarch64 failure in rawhide though:
https://copr.fedorainfracloud.org/coprs/mystro256/rocm-hip/build/5952487/

I haven’t tested Blender yet.

unfortunately blender crashes when i select to enter render mode, however blender recognized that rocm is installed

Which build did you try? I pushed fixes in 5.5.1-4, which now works for me on Blender on a RX 6750. I did some benchmarks, and render mode works for me at least.

What HW are you using? You can get the exact info with “rocminfo”. I can see if I can procure the HW to test on my machine.

if i select shading mode in viewport blender crashes using cycles when starting from the terminal and accessing the crash log file this is what appears.

Blender 3.5.1, Commit date: 1970-01-01 00:00, Hash unknown

bpy.context.space_data.context = ‘RENDER’ # Property
bpy.context.scene.render.engine = ‘CYCLES’ # Property
bpy.context.scene.cycles.device = ‘GPU’ # Property

backtrace

Python backtrace

ROCMINFO:

rocminfo
ROCk module is loaded

HSA System Attributes

Runtime Version: 1.1
System Timestamp Freq.: 1000.000000MHz
Sig. Max Wait Duration: 18446744073709551615 (0xFFFFFFFFFFFFFFFF) (timestamp count)
Machine Model: LARGE
System Endianness: LITTLE

==========
HSA Agents


Agent 1


Name: AMD Ryzen 7 2700 Eight-Core Processor
Uuid: CPU-XX
Marketing Name: AMD Ryzen 7 2700 Eight-Core Processor
Vendor Name: CPU
Feature: None specified
Profile: FULL_PROFILE
Float Round Mode: NEAR
Max Queue Number: 0(0x0)
Queue Min Size: 0(0x0)
Queue Max Size: 0(0x0)
Queue Type: MULTI
Node: 0
Device Type: CPU
Cache Info:
L1: 32768(0x8000) KB
Chip ID: 0(0x0)
ASIC Revision: 0(0x0)
Cacheline Size: 64(0x40)
Max Clock Freq. (MHz): 3200
BDFID: 0
Internal Node ID: 0
Compute Unit: 16
SIMDs per CU: 0
Shader Engines: 0
Shader Arrs. per Eng.: 0
WatchPts on Addr. Ranges:1
Features: None
Pool Info:
Pool 1
Segment: GLOBAL; FLAGS: FINE GRAINED
Size: 16277268(0xf85f14) KB
Allocatable: TRUE
Alloc Granule: 4KB
Alloc Alignment: 4KB
Accessible by all: TRUE
Pool 2
Segment: GLOBAL; FLAGS: KERNARG, FINE GRAINED
Size: 16277268(0xf85f14) KB
Allocatable: TRUE
Alloc Granule: 4KB
Alloc Alignment: 4KB
Accessible by all: TRUE
Pool 3
Segment: GLOBAL; FLAGS: COARSE GRAINED
Size: 16277268(0xf85f14) KB
Allocatable: TRUE
Alloc Granule: 4KB
Alloc Alignment: 4KB
Accessible by all: TRUE
ISA Info:


Agent 2


Name: gfx1031
Uuid: GPU-XX
Marketing Name: AMD Radeon RX 6750 XT
Vendor Name: AMD
Feature: KERNEL_DISPATCH
Profile: BASE_PROFILE
Float Round Mode: NEAR
Max Queue Number: 128(0x80)
Queue Min Size: 64(0x40)
Queue Max Size: 131072(0x20000)
Queue Type: MULTI
Node: 1
Device Type: GPU
Cache Info:
L1: 16(0x10) KB
L2: 3072(0xc00) KB
L3: 98304(0x18000) KB
Chip ID: 29663(0x73df)
ASIC Revision: 0(0x0)
Cacheline Size: 64(0x40)
Max Clock Freq. (MHz): 2880
BDFID: 2560
Internal Node ID: 1
Compute Unit: 40
SIMDs per CU: 2
Shader Engines: 4
Shader Arrs. per Eng.: 2
WatchPts on Addr. Ranges:4
Features: KERNEL_DISPATCH
Fast F16 Operation: TRUE
Wavefront Size: 32(0x20)
Workgroup Max Size: 1024(0x400)
Workgroup Max Size per Dimension:
x 1024(0x400)
y 1024(0x400)
z 1024(0x400)
Max Waves Per CU: 32(0x20)
Max Work-item Per CU: 1024(0x400)
Grid Max Size: 4294967295(0xffffffff)
Grid Max Size per Dimension:
x 4294967295(0xffffffff)
y 4294967295(0xffffffff)
z 4294967295(0xffffffff)
Max fbarriers/Workgrp: 32
Pool Info:
Pool 1
Segment: GLOBAL; FLAGS: COARSE GRAINED
Size: 12566528(0xbfc000) KB
Allocatable: TRUE
Alloc Granule: 4KB
Alloc Alignment: 4KB
Accessible by all: FALSE
Pool 2
Segment: GROUP
Size: 64(0x40) KB
Allocatable: FALSE
Alloc Granule: 0KB
Alloc Alignment: 0KB
Accessible by all: FALSE
ISA Info:
ISA 1
Name: amdgcn-amd-amdhsa–gfx1031
Machine Models: HSA_MACHINE_MODEL_LARGE
Profiles: HSA_PROFILE_BASE
Default Rounding Mode: NEAR
Default Rounding Mode: NEAR
Fast f16: TRUE
Workgroup Max Size: 1024(0x400)
Workgroup Max Size per Dimension:
x 1024(0x400)
y 1024(0x400)
z 1024(0x400)
Grid Max Size: 4294967295(0xffffffff)
Grid Max Size per Dimension:
x 4294967295(0xffffffff)
y 4294967295(0xffffffff)
z 4294967295(0xffffffff)
FBarrier Max Size: 32
*** Done ***

maybe it could be my fedora installation. I don’t mind waiting until rocm-hip is in the fedora 39 repositories

Hello, I found the culprit and it is the blender itself from the fedora repositories. i downloaded blender portable from blender official website and rocm works finally. I just don’t know how to report this problem and I don’t know if I’m the only one with problems with blender in the repositories. and one more thing that blender from the repositories downloads the language packs but does not recognize them within the settings the translation option of the interfaces are empty without any translation just english. which is funny since there are language packs for blender in the repositories. this version of blender from the fedora repositories is completely buggy for me. my knowledge is very limited since this is not my native language. if you see this and can report these blender bugs from the repositories since it should have more integration compared to the official website. if it’s not an isolated problem I would be happy if you made this report or told me who is responsible for this blender package so that I can warn you about it.

Hello Ryan, Blender maintainer here. For the future to report bug, type “bugz.fedoraproject.org/blender”. About the international fonts issue, the problem is from the source tarball itself duplicating lang files. We will try the workaround around again.
Back to the topic, now that the missing element needs to enable HIP support is in the main repository, we will update the build.

Thanks Luya, I assume you need Tom’s patch? [1] If so, let me know if you want me to bring it into f38, or if just rawhide is fine.

  1. https://src.fedoraproject.org/rpms/rocclr/pull-request/2

Let’s bring it to f38 as well.

Done, I’ve tagged the build to f38-build-side-69204
Please feel free to use this sidetag for an update to blender