Blender HIP library libamdhip64.so loading issue in linux #109562

Closed
opened 2023-06-30 17:03:35 +02:00 by Lee-Ringham · 4 comments

System Information
Operating system: Linux-5.15.0-76-generic-x86_64-with-glibc2.29 64 Bits
Graphics card: AMD Radeon VII (VEGA20, DRM 3.42.0, 5.15.0-76-generic, LLVM 12.0.0) AMD 4.6 (Core Profile) Mesa 21.2.6

Blender Version
Broken: version: 2.82 (sub 7), branch: Unknown, commit date: Unknown Unknown, hash: rBUnknown
Worked: (optional)

Short description of error
Currently blender looks for these libraries when loading HIP:
libamdhip64.so and /opt/rocm/hip/lib/libamdhip64.so

libamdhip64.so is currently found in the package libamdhip64-dev

A non-developer might reasonably only have the libamdhip64-5 package installed (and not libamdhip64-dev) and thus, only have access to the library libamdhip64.so.5

Exact steps for others to reproduce the error
install hip
install blender
Edit > Preferences > System > HIP
No compatible GPUs found for path tracing...

Proposed solution
add libamdhip64.so.5 to the beginning of hip_paths so it is loaded first if available, but still falls back to libamdhip64.so if libamdhip64.so.5 is not found:

diff --git a/extern/hipew/src/hipew.c b/extern/hipew/src/hipew.c
index fda27f66aa1..87584f8bc52 100644
--- a/extern/hipew/src/hipew.c
+++ b/extern/hipew/src/hipew.c
@@ -238,7 +238,7 @@ static int hipewHipInit(void) {
   /* Default installation path. */
   const char *hip_paths[] = {"", NULL};
 #else
-  const char *hip_paths[] = {"libamdhip64.so", "/opt/rocm/hip/lib/libamdhip64.so", NULL};
+  const char *hip_paths[] = {"libamdhip64.so.5", "/opt/rocm/hip/lib/libamdhip64.so.5", "libamdhip64.so", "/opt/rocm/hip/lib/libamdhip64.so", NULL};
 #endif
   static int initialized = 0;
   static int result = 0;
**System Information** Operating system: Linux-5.15.0-76-generic-x86_64-with-glibc2.29 64 Bits Graphics card: AMD Radeon VII (VEGA20, DRM 3.42.0, 5.15.0-76-generic, LLVM 12.0.0) AMD 4.6 (Core Profile) Mesa 21.2.6 **Blender Version** Broken: version: 2.82 (sub 7), branch: Unknown, commit date: Unknown Unknown, hash: `rBUnknown` Worked: (optional) **Short description of error** Currently blender looks for these libraries when loading HIP: `libamdhip64.so` and `/opt/rocm/hip/lib/libamdhip64.so` `libamdhip64.so` is currently found in the package `libamdhip64-dev` A non-developer might reasonably only have the `libamdhip64-5` package installed (and not `libamdhip64-dev`) and thus, only have access to the library `libamdhip64.so.5` **Exact steps for others to reproduce the error** install hip install blender Edit > Preferences > System > HIP No compatible GPUs found for path tracing... **Proposed solution** add `libamdhip64.so.5` to the beginning of `hip_paths` so it is loaded first if available, but still falls back to `libamdhip64.so` if `libamdhip64.so.5` is not found: ```Diff diff --git a/extern/hipew/src/hipew.c b/extern/hipew/src/hipew.c index fda27f66aa1..87584f8bc52 100644 --- a/extern/hipew/src/hipew.c +++ b/extern/hipew/src/hipew.c @@ -238,7 +238,7 @@ static int hipewHipInit(void) { /* Default installation path. */ const char *hip_paths[] = {"", NULL}; #else - const char *hip_paths[] = {"libamdhip64.so", "/opt/rocm/hip/lib/libamdhip64.so", NULL}; + const char *hip_paths[] = {"libamdhip64.so.5", "/opt/rocm/hip/lib/libamdhip64.so.5", "libamdhip64.so", "/opt/rocm/hip/lib/libamdhip64.so", NULL}; #endif static int initialized = 0; static int result = 0; ```
Lee-Ringham added the
Status
Needs Triage
Type
Report
Severity
Normal
labels 2023-06-30 17:03:35 +02:00
Member

Thanks for reporting and you managed to add it to HIP meta task. Appreciated!

Thanks for reporting and you managed to add it to HIP meta task. Appreciated!
YimingWu changed title from Blender HIP library loading Bug Report to Blender HIP library `libamdhip64.so` loading issue in linux 2023-07-02 17:10:47 +02:00

I think following soversion conventions, it is indeed more correct to use .so.5, with major version bumps indicating API breaking changes we can't safely use .so.6. Perhaps that is why the .so is only part of the development package, with the intent of the application linking against .so.5. But I'm not sure if ROCm versions actually work that way.

If we can safely use ROCm 6, 7, 8, .. we can add a few more versions for future proofing. This would be to work around what is probably an issue better solved in packaging or ROCm.

@BrianSavery @Sayak-Biswas do you have any suggestion for what we can best do here, add .so.5 only, or add a few additional versions as well? Do you think this is worth reporting to Debian packaging or is it as intended?

I think following soversion conventions, it is indeed more correct to use `.so.5`, with major version bumps indicating API breaking changes we can't safely use `.so.6`. Perhaps that is why the `.so` is only part of the development package, with the intent of the application linking against `.so.5`. But I'm not sure if ROCm versions actually work that way. If we can safely use ROCm 6, 7, 8, .. we can add a few more versions for future proofing. This would be to work around what is probably an issue better solved in packaging or ROCm. @BrianSavery @Sayak-Biswas do you have any suggestion for what we can best do here, add `.so.5` only, or add a few additional versions as well? Do you think this is worth reporting to Debian packaging or is it as intended?
Blender Bot added
Status
Resolved
and removed
Status
Needs Info from Developers
labels 2023-07-04 14:31:39 +02:00

I will committed the fix for ROCm 5 since that's safe, will wait for more information to see if we need to do more.

I will committed the fix for ROCm 5 since that's safe, will wait for more information to see if we need to do more.
Blender Bot added
Status
Confirmed
and removed
Status
Resolved
labels 2023-07-04 14:31:56 +02:00
Brecht Van Lommel added
Status
Needs Info from Developers
and removed
Status
Confirmed
labels 2023-07-04 14:32:04 +02:00

Closing since the bug itself is fixed. In #113219 it seems that we do have to keep adding entries for new ROCm version.

Closing since the bug itself is fixed. In #113219 it seems that we do have to keep adding entries for new ROCm version.
Blender Bot added
Status
Archived
and removed
Status
Needs Info from Developers
labels 2023-10-06 15:28:38 +02:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#109562
No description provided.