Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
InferenceSession
✓ import onnxruntime
✗ import onnxruntime_rocm
InferenceSession is in the onnxruntime module, not onnxruntime_rocm. Install the ROCm variant but import onnxruntime.
get_available_providers
✓ onnxruntime.get_available_providers()
✗ from onnxruntime_rocm import ...
Providers are registered at import; use onnxruntime to list them.
Verify installation and run a basic inference with ROCm EP.
import onnxruntime
print(onnxruntime.__version__)
print('Available providers:', onnxruntime.get_available_providers())
# Example with ROCm provider
import numpy as np
sess = onnxruntime.InferenceSession(
'model.onnx',
providers=['ROCMExecutionProvider']
)
input_name = sess.get_inputs()[0].name
result = sess.run(None, {input_name: np.random.randn(1, 3, 224, 224).astype(np.float32)})
print(result[0].shape)
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'onnxruntime'
Package not installed, or only onnxruntime-rocm installed but import fails because onnxruntime is not a top-level package of the rocm variant? Actually onnxruntime-rocm provides onnxruntime, but if you accidentally installed something else or your environment is broken.
fixRun `pip install onnxruntime-rocm` then `python -c "import onnxruntime; print(onnxruntime.__version__)"`
onnxruntime.capi.onnxruntime_pybind11_state.InvalidArgument: [ONNXRuntimeError] : 2 : INVALID_ARGUMENT : No execution provider 'ROCMExecutionProvider' is registered.
You have onnxruntime (CPU) installed, not onnxruntime-rocm. The ROCm provider is not available.
fixUninstall onnxruntime (CPU) and install onnxruntime-rocm.
ImportError: libamdhip64.so.5: cannot open shared object file: No such file or directory
ROCm runtime libraries (including amdhip64.so) are not installed or not in LD_LIBRARY_PATH. The onnxruntime-rocm wheel depends on system ROCm libraries.
fixInstall ROCm: follow instructions at https://rocm.docs.amd.com/en/latest/deploy/linux/quick_start.html and set LD_LIBRARY_PATH to /opt/rocm/lib.
onnxruntime.capi.onnxruntime_pybind11_state.RuntimeException: DNN Library load failed: Cannot find DNN library at ...
MIOpen (AMD's DNN library) is not found. ROCm installation incomplete.
fixInstall MIOpen via ROCm packages: `sudo apt install miopen-hip` or ensure full ROCm stack is installed.
Upgrade
Version history
1.22.2.post1latest on PyPI · released Sep 11, 2025
Audit
Dependencies
torchoptionalCommonly used together for model export; not required at runtime
onnxoptionalNeeded for model format conversions if not using ORT format