Skip to content

Allow GPU acceleration with AMD GPUs with ROCm #160

Open
CodingAndCodingAgain wants to merge 1 commit into
OHF-Voice:mainfrom
CodingAndCodingAgain:feat/rocm_support
Open

Allow GPU acceleration with AMD GPUs with ROCm #160
CodingAndCodingAgain wants to merge 1 commit into
OHF-Voice:mainfrom
CodingAndCodingAgain:feat/rocm_support

Conversation

@CodingAndCodingAgain

Copy link
Copy Markdown

I was able to run piper with an AMD GPU by installing the "onnxruntime-rocm" and the appropriate "torch" package based on my GPU.

Without taking into account the installation of the packages, it didn't require to much setup to get it to work so I thought more people could benefit of it.

Importing the "torch" package before the "onnxruntime" package it's actually necessary since "onnxruntime-rocm" will crash without it.

@malev-v

malev-v commented May 26, 2026

Copy link
Copy Markdown

NOTE ROCm Execution Provider has been removed since 1.23 release. Please Migrate your applications to use the MIGraphX Execution Provider
ROCm 7.0 is the last offiicaly AMD supported distribution of this provider and all builds going forward (ROCm 7.1+) will have ROCm EP removed.
ROCm-ExecutionProvider.html

But even if you install onnxruntime_rocm (Show)

Use AMD official for rocm-rel-7.0.2 instead pip:

onnxruntime_rocm-1.22.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

It goes with libhipblas-5aa6e563.so.3.0.70002
link /opt/rocm/lib/librocm_smi64.so.1.0.70203 -> librocm_smi64.so.7
export LD_LIBRARY_PATH= ...

The situation won't change - Python still throws an error.


When attempting to use MIGraphXExecutionProvider, the following message appears:
2026-05-26 21:23:10.N [W:onnxruntime:Default, migraphx_execution_provider.cc:180 get_flags_from_env] [MIGraphX EP] MIGraphX ENV Override Variables Set:

But it still uses the CPU!

After --force-reinstall onnxruntime_migraphx ... Оnce again, it falls back to the CPU. Only this appear:

DT [W:onnxruntime:Default, migraphx_execution_provider_utils.h:155 canEvalNodeArgument] Node:/dp/flows.7/NonZero_5 Input:/dp/flows.7/Expand_28_output_0 Can't eval shape
DT [W:onnxruntime:Default, migraphx_execution_provider_utils.h:155 canEvalNodeArgument] Node:/dp/flows.7/NonZero Input:/dp/flows.7/Not_output_0 Can't eval shape
...
DT [W:onnxruntime:Default, migraphx_execution_provider_utils.h:155 canEvalNodeArgument] Node:/Range Input:/ReduceMax_output_0 Can't eval shape

Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants