Skip to content

Running darktable ai on AMD Fedora 44 with MIGraphiX support for GPU #20926

@stoflom

Description

@stoflom

Is there an existing issue for this?

  • I checked and did not find my issue in the already reported ones

Describe the bug

I have been compiling nightly darktable builds on Fedora43 and lately Fedora 44. The new ai features are tremendous and I express my sincere thanks to Andrii and the team.

On Fedora it is a bit frustrating that the ROCm (7.1) modules installed by dnf is not under /opt/rocm but under /usr/lib64/rocm. On my AMD Radeon 9 8945HS, box I had to jump through some loops to get the iGPU to run the onnx models. The onnxruntime (ORT 1.22.2) in the Fedora repository (7.1.1) does not support MIGraphX, so I found that you have to compile onnxruntime from the source, after installing the required ROCM, HIP, MIGRaphX dependencies from the Fedora repo. I now have it running on (ORT 1.26.0). Refer to my script and notes at: https://github.com/stoflom/onnxruntime

To get darktable ai to use the GPU a small patch is needed (my_changes.patch) to fix the location of the rocm libs. Also it seems the mxr cache directory environment variable has changed. See https://github.com/stoflom/build-darktable. Now that I have it working it is well worth the trouble (after waiting about 40 minutes for MIGraphX to initially generate the kernels), the AI tools are about 10x faster.

A suggestion: it would be good to be able to generate the mxr kernels offline with a Python, script. I have vipe coded a working script, however, I need the shapes required by darktable for my raw files. Maybe we could patch the src to include the shapes used when the "-d ai" flag is given?

I am a newbie here (but an old timer in coding), let me know if I need to make myself more clear or engage elsewhere. Thanks again!

Steps to reproduce

Running darktable on AMD hardware on Fedora 43/44 does not use the migraphx provider and consequently only runs on the CPU.

Expected behavior

Using the GPU greatly enhances usr experience with AI.

Logfile | Screenshot | Screencast

No response

Commit

No response

Where did you obtain darktable from?

darktable.org / GitHub release

darktable version

5.5.0+1128~g4c244ff

What OS are you using?

Linux

What is the version of your OS?

Fedora 44, updated to latest build.

Describe your system

AMD Ryzen 8945HS with iGPU and 64GB RAM.

Are you using OpenCL GPU in darktable?

Yes

If yes, what is the GPU card and driver?

iGPU AMD Radeon 780M

Please provide additional context if applicable. You can attach files too, but might need to rename to .txt or .zip

Latest daily build: 5.5.0+1128~g4c244ff

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions