How can I get started with Blender Cycles/HIP Rendering?

Okay, I’ve removed all the ROCm packages I previously installed & disabled the rocm-hip copr repository.

After that, I followed u/szooloo’s instructions and encountered the same issues as @joni999. Following @joni999’s instructions allowed me to render the default cube with Device set to GPU Compute.

After testing with another scene, I discovered that rendering performance had not improved when compared to the CPU. However, enabling the “Experimental” Feature Set fixed this!

So, in summary, following first u/szooloo’s instructions, then @joni999’s extra steps, then enabling the Experimental Feature Set and GPU Compute in the Cycles render settings allowed me to use my Radeon RX 5700 XT for rendering with Cycles.

Thank you all very much!

1 Like

Hi there!

Hey that’s me! :smiley:

Glad you got it working! I knew documenting this was the right thing to do :smiley:
It’s weird that it seems to work for other people without doing my workaround.

I have now benchmarked my render times because I was curious if the “Experimental” switch “issue” applies to me as well.

The results may be influenced by something like Cache - but I didn’t use the PC while doing the benchmark.

For the CPU Tests only the CPU was enabled in Blender System Settings and for GPU Tests only the GPU.

My Specs:
AMD RX6900XT
AMD Ryzen 7 5800X



**CPU TESTS:**

CPU Only (Supported && Open Shading Language is OFF ):
01min 44.34sec

CPU Only (Experimental && Open Shading Language is OFF ):
01min 45.05sec

CPU Only (Supported && Open Shading Language is ON ):
02min 21.49sec

CPU Only (Experimental && Open Shading Language is ON ):
02min 19.64sec

=> All of the above CPU cases show the CPU maxed out and the GPU was not used according to CoreCtl.

=> both CPU Renders show almost no activity on the GPU according to CoreCtl



**GPU TESTS:**

GPU Only ("Supported"):
25.16sec

GPU Only ("Experimental"):
25.16sec

=> Both “Supported” and “Experimental” cases above have my GPU maxed out according to CoreCtl

CPU and GPU Enabled in System Settings (Device: "GPU Compute"):
28.09sec

CPU and GPU Enabled in System Settings (Device: "CPU" && Open Shading Language is OFF ):
01min 42.90sec

CPU and GPU Enabled in System Settings (Device: "CPU" && Open Shading Language is ON ):
02min 20.28sec

=> Conclusion: Looks like I dont need the Experimental switch to utilize the GPU and I will switch off my CPU fully.

Best Regards and have fun rendering :slight_smile:

2 Likes

I suspect that the Experimental option is only needed for GPU architectures other than RDNA2. The image texture bug I linked before (which can cause Blender to crash) reportedly affects RDNA1 & Vega, but not RDNA2. I don’t own any RDNA2 or Vega hardware to test this with, though.

Thats’ a completely reasonable assumption so I just tried installing without amdgpu-core:

 [joni@linuxjoni02 Downloads]$ sudo dnf install libdrm-amdgpu-2.4.110.50200-1438747.el9.x86_64.rpm libdrm-amdgpu-common-1.0.0.50200-1438747.el9.noarch.rpm
AMDGPU 22.20 repository                                                                                                                                              38  B/s | 178  B     00:04    
[...]
Error: 
 Problem 1: conflicting requests
  - nothing provides amdgpu-core needed by libdrm-amdgpu-1:2.4.110.50200-1438747.el9.x86_64
 Problem 2: conflicting requests
  - nothing provides amdgpu-core needed by libdrm-amdgpu-common-1.0.0.50200-1438747.el9.noarch
(try to add '--skip-broken' to skip uninstallable packages)

Seems like amdgpu-core ist just included, because we have to trick dnf into installing the other packages which have dependencies to it.

1 Like

I’m unticking the “solution” box because it seems that Blender Cycles still doesn’t consistently use my GPU. I haven’t found a pattern yet.

It would be possible if blended makes a subprocess (ie, to ffmpeg) and the DRI_PRIME=1 isn’t being preserved in the subprocess call. Adding it to the desktop for for blender would probably help.

Okay, it turns out that the “Experimental” Feature Set option was a red herring. It doesn’t actually matter whether the “Supported” or “Experimental” Feature Set is used. It turns out that opening Edit > Preferences is what actually gets GPU rendering to work.

Corrected summary of how I got Blender Cycles to use my Radeon RX 5700 XT on Fedora:

  1. Followed the instructions which were written by u/szooloo & repeated by @bhibb
  2. Followed @joni999’s extra steps
  3. For every new Blender session, before rendering with Cycles, opened Blender’s Preferences menu.

The Preferences menu does not need to remain open for this to work.

2 Likes

I can tell when GPU rendering isn’t going to work when I switch “Device” in a scene’s render settings to GPU Compute & the dropdown menu becomes greyed out. When this happens, I can open the Preferences menu to restore it to normal, allowing me to render with the GPU.

However, the greying out doesn’t always occur, and when the dropdown menu’s appearance remains normal after switching to “GPU Compute”, GPU rendering works immediately. In these cases, there is no need to open the Preferences menu.

Use this copr repo https://copr.fedorainfracloud.org/coprs/cosmicfusion/ROCm-GFX8P/ , and do

sudo dnf install rocm-hip

Do a reboot to load libraries and profiles

And you should be able to render your GPU on the latest blender binary

3 Likes

Thank you! I just tried it out with blender and it works great (only short test in blender).

After uninstalling all the amdgpu junk and the other stuff from the rocm repo I did the steps in the copr repo and it worked instantly. (This could have saved me a lot of time/effort and will definitely save some in the future :smiley:)

3 Likes

I second that. Thank you for linking this; it’s so much simpler!

I see that the os copr are only for fc36 Any idea how it runs on 37? or if the hip will arrive with the 38?

You could test that for now:
https://discussion.fedoraproject.org/t/how-to-install-amd-drivers-on-fedora/5838/7

FYI I have rocm-hip in review for Fedora 38 if anyone is interested:
https://bugzilla.redhat.com/show_bug.cgi?id=2209759

i try your repos , installing rocm-hip , etc , but blender still can’t see my 5700xt gpu , are those packages incomplete ?

maybe i need install another thing , but i have the impresion for what i read here , that i only need the hip things to work , rocminfo list the card as agent .

Thanks for the feedback. I haven’t tested blender yet, so I’ll need to try that out next. The packages are still somewhat experimental.

Please bare with me while I try to figure this out, but any feedback really does help!

There’s a few pieces I put in hip-devel and rocm-hip-devel, and you might be seeing failures if some files are mispackaged, so you can try installing those devel packages to see if it helps.

Also there’s a few annoying bugs that came up when i upgraded from 5.4 to 5.5, so look for a 5.5.1 update in the coming days.

1 Like

i have already install those packages , but not sure if are the correct one , thanks for the work anyway !!

here some pacakge info:

[root@fedora yum.repos.d]# dnf info hip-devel
Last metadata expiration check: 0:05:24 ago on Sat 27 May 2023 02:54:01 PM AST.
Installed Packages
Name : hip-devel
Version : 5.5.0
Release : 1.fc38
Architecture : noarch
Size : 1.8 M
Source : rocclr-5.5.0-1.fc38.src.rpm
Repository : @System
From repo : copr:copr.fedorainfracloud.org:mystro256:rocm-hip
Summary : HIP API development package
URL : GitHub - ROCm-Developer-Tools/clr
License : MIT
Description : HIP is a C++ Runtime API and Kernel Language that allows developers to create
: portable applications for AMD and NVIDIA GPUs from the same source code.

Available Packages
Name : hip-devel
Version : 5.4.22804.50406
Release : 148.el9
Architecture : x86_64
Size : 217 k
Source : hip-devel-5.4.22804.50406-148.el9.src.rpm
Repository : rocm
Summary : HIP:Heterogenous-computing Interface for Portability
License : MIT
Description : HIP: Heterogenous-computing Interface for Portability [DEVELOPMENT]

[root@fedora yum.repos.d]# dnf info rocm-hip-devel
Last metadata expiration check: 0:05:53 ago on Sat 27 May 2023 02:54:01 PM AST.
Installed Packages
Name : rocm-hip-devel
Version : 5.5.0
Release : 1.fc38
Architecture : x86_64
Size : 63 k
Source : rocclr-5.5.0-1.fc38.src.rpm
Repository : @System
From repo : copr:copr.fedorainfracloud.org:mystro256:rocm-hip
Summary : ROCm HIP development package
URL : GitHub - ROCm-Developer-Tools/clr
License : MIT
Description : AMD ROCm HIP development package.

if you need me to try/test something , let me know.

Ok, so I got blender to work! This build works fine for me (rocm-hip-5.5.1-4):
https://copr.fedorainfracloud.org/coprs/mystro256/rocm-hip/build/5989231/

It should now work without the devel packages, as all you need to do is install rocm-hip and it will pull in all the required packages as needed.
I also tested blender’s benchmark and it performed as expected given my HW.

I hope this helps! I hope it’ll land in Fedora relatively soon, so you don’t need to use my copr.

hello jeremy , i was lurking the bug link:
https://bugzilla.redhat.com/show_bug.cgi?id=2209759

when you add the commend " Jeremy Newton 2023-05-30 19:13:45 UTC " ( number 8 )

i remove everything using dnf and install again , not luck , now with this last update i did the same but not luck with blender , the version i am using is the flathub one , did you try with the oficinal fedora repository one ? ,

i check the lib too and look ok:

Screenshot from 2023-05-31 05-57-32

i remove the flat version of blender and install the fedora one , i restart but nothing really work , then i restart again and this time it work

blender can see my graphic card as option now , i will try later a render and report the result time , compare to windows accelerete render too.

thanks jeremy for all this work.