I recently joined this community last week and I experienced quite a faff in order to get my use case for this desktop to work. I did some searching on this Discourse and couldn’t find the info I needed, so I thought I would contribute it here in case anyone needed it in the future.
Here’s my use case:
I’m a Blender user who switched to Fedora. I recently acquired an AMD card which falls under the newer proprietary AMD driver capabilities (Radeon RX 6700 XT). I want to make use of Blender’s HIP GPU rendering under AMD which doesn’t work without their proprietary OpenCL magic.
Is this about the Blender removal of OpenCL support on AMD GPUs and the effort to make Blender usable on those graphics cards? It may be a bit specific but there are probably enough Blender users in the Fedora Linux realm to make it worth while.
@rlengland I agree that this may be a pretty specific use case. With Nvidia cards, there’s so much that ‘just works’ for Blender users who run Fedora, but in order for AMD users to be able to get GPU compute capability out of their cards, more steps are necessary. This was something I really needed when I switched.
@glb That warning rings true. It is a hack, and someone else’s mileage may vary. In fact, it’s entirely possible that this hack will only work until AMD produces a newer proprietary driver (if there are changes to the OpenCL portion) or if Blender makes a breaking change to their HIP implementation.
My intention was only to point other Blender/Fedora AMD users toward something that helped me get GPU compute capabilities out of the Cycles render engine under Blender 3.2. The reddit article was difficult for me to find, so I thought drawing some attention to it may help others find it, too!
After following the steps I unfortunately still had a few issues:
No devices would show up in the HIP Tab in the Blender System Settings.
When I checked the console where I opened blender I saw an error something like “which: hipcc not found”. (I don’t have the exact error anymore unfortunately)
To get hipcc I had to install the package hip-devel
Even after installing that package I didn’t have /opt/rocm/bin (where hipcc is located) in my $PATH, so I created the following file: echo 'export PATH=$PATH:/opt/rocm/bin:/opt/rocm/profiler/bin:/opt/rocm/opencl/bin/x86_64' | sudo tee -a /etc/profile.d/rocm.sh
(I found this command in the ROCm Docs)
Only then my GPU and CPU (5900XT & 5800X) showed up in the HIP Panel in blender.
After turning on both devices in the Blender HIP System Settings I tried rendering in Cycles using the GPU but got the following error in the console (and the render just didn’t start):
Compiling HIP kernel ...
hipcc -Wno-parentheses-equality -Wno-unused-value --hipcc-func-supp -O3 -ffast-math --amdgpu-target=gfx1030 -I /usr/share/blender/3.2/scripts/addons/cycles/source --genco /usr/share/blender/3.2/scripts/addons/cycles/source/kernel/device/hip/kernel.cpp -o "/home/joni/.cache/cycles/kernels/cycles_kernel_gfx1030_D473C7AC23F611898D03A1AA639945AA"
clang-14: error: cannot find ROCm device library; provide its path via '--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build without ROCm device library
Failed to execute compilation command, see console for details.
So I tinkered and researched for a bit and tried installing the package “rocm-device-libs” which provides /usr/lib64/amdgcn/bitcode which apparently is needed?!
I also had to set DEVICE_LIB_PATH=/usr/lib64/amdgcn/bitcode because hipcc just wouldn’t find it.
So I expanded the file which I created earlier by a second line:
I’m sorry to hear that you encountered some bumps along the way. It sounds like you did a lot of extra research and work to make this possible on your machine. I’m not certian why you needed to do so much more faffing than I did in order to get Blender to recognize your AMD GPU/CPU.
How do you download Blender? For instance, I always download the AppImage directly from Blender.org. Do you use the Fedora repositories? Flatpak?
All the HIP packages I needed were in those libraries I downloaded, as well as the amdgpu-install package for hip in step 5.
I think there’s an open bug for it, (https://bugzilla.redhat.com/show_bug.cgi?id=2022980) but almost every time I try to navigate through the viewport using my RX 6700 XT, my entire X session (or Wayland) crashes and I have to pkill my user to log back in. It’s a very frustrating issue, but HIP works consistently for rendering (again, just not viewport in Blender).
I would love to hear about the stability of Blender viewport using the method you described here, and how you’re using Blender (AppImage, flatpak, rpm) to compare!
I didn’t have any issues so far, but I only worked with it for ~3h yesterday creating some textures in the node editor.
I wasn’t using the viewport much, but I was moving around/rotating a bit to get a good view in the “rendered” view checking reflections for example and had no issues - it was smooth, fast and stable.
I am running on Wayland (and KDE) - I don’t use X11 anymore, so I can’t say anything about that.
I attached a Screenshot of my Setup (I can only embed one picture unfortunately):
I have to say a huge THANK YOU for explaining your process. I followed your steps:
Install blender,hip-devel, and rocm-device-libs
echo 'export PATH=$PATH:/opt/rocm/bin:/opt/rocm/profiler/bin:/opt/rocm/opencl/bin/x86_64 export DEVICE_LIB_PATH=/usr/lib64/amdgcn/bitcode' | sudo tee -a /etc/profile.d/rocm.sh
Restart the machine
Login under Wayland OR X
After I followed those steps, now I can use my RX 6700 XT with Blender and navigate around the viewport without having terrible crashes that result in lost work and having to kill the user session to log back in.
Thank you, and thank you again.
EDIT: I’m still seeing some instability, but it seems to be localized to certain textures. I could be wrong, but I think my machine is still having trouble with the setup
Ahh yes. So the ‘fix’ I thought I had has been a fine line and I’m still getting this exact same crash. When you have that bug up, would you mind linking it so that I can throw a +1 on there, too? It’s been making me crazy enough to want to try other Linux distros just to see if someone out there has a magical answer to this dilemma.
I was considering AMD for my next GPU after my Nvidia or Intel burns out. Exactly because I thought it is Open Source (ROCm Core Technology · GitHub), which means bugs can be fixed without waiting on upstream. So I am surprised to see ROCm referenced as proprietary. What I don’t know?