Currently the blender ebuild's just find the latest installed when it should be possible to enable a specific llvm. Add a rocm use flag so that the llvm-roc / llvm:roc can be built against.
I do not have access to an AMD GPU and would be unable to develop this myself. However I would be happy to review a patch.
You don't need access to a AMD GPU to test it, you need access to a USE flag! This is a ebuild problem.
If a straight swap of sys-devel/llvm for sys-devel/llvm-roc is all that is required, it might be possible to add this feature by putting llvm? ( rocm? ( sys-devel/llvm-roc:= ) !rocm? ( sys-devel/llvm:= ) ) in RDEPEND and rocm? ( llvm opencl ) in REQUIRED_USE My concern is whether llvm-roc might used during rendering for creating the opencl kernel or for compiling the OSL shaders. Looking at the github page there are also a lot of rocm libraries and I don't know whether some of these might be required as well. Without hardware I can only test whether emerge blender is successful, not whether blender crashes during rendering. This should be developed and tested by someone with hardware so I can be sure it works prior to integration. The main advantage of the llvm eclass seems to be the ability to limit the maximum version of llvm to use when several are installed, however blender can use all versions of llvm from the tree. It seems that it is not possible to specify use of llvm-roc using it yet, pending bug #693198.
(In reply to Adrian from comment #3) > If a straight swap of sys-devel/llvm for sys-devel/llvm-roc is all that is > required, it might be possible to add this feature by putting > llvm? ( rocm? ( sys-devel/llvm-roc:= ) !rocm? ( sys-devel/llvm:= ) ) in > RDEPEND and rocm? ( llvm opencl ) in REQUIRED_USE > Sadly no, blender doesn't work with rocm and amdgpu. When activating cycles-useflag with rocm-opencl, the system-llvm and rocm-llvm will be mixed. The system-llvm is pulled in by mesa and interferes with the rocm-llvm for opencl. I've tried to get it work, but always get this error: mesa: CommandLine Error: Option 'help-list' registered more than once! LLVM ERROR: inconsistency in registered CommandLine options I'm afraid, as long as rocm is independent from upstream llvm, this doesn't really work.
llvm upstream bugreports: https://bugs.llvm.org/show_bug.cgi?id=30587 https://bugs.llvm.org/show_bug.cgi?id=22952