Skip to content

Commit

Permalink
Add onnxruntime_providers_qnn.dll/.so to setup.py so that it gets cop…
Browse files Browse the repository at this point in the history
…ied when building python wheel
  • Loading branch information
adrianlizarraga committed Dec 19, 2024
1 parent f8747db commit 058e7bb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,17 +311,20 @@ def finalize_options(self):
providers_tensorrt_or_migraphx = "onnxruntime_providers_" + ("migraphx" if is_migraphx else "tensorrt")
providers_openvino = "onnxruntime_providers_openvino"
providers_cann = "onnxruntime_providers_cann"
providers_qnn = "onnxruntime_providers_qnn"

if platform.system() == "Linux":
providers_cuda_or_rocm = "lib" + providers_cuda_or_rocm + ".so"
providers_tensorrt_or_migraphx = "lib" + providers_tensorrt_or_migraphx + ".so"
providers_openvino = "lib" + providers_openvino + ".so"
providers_cann = "lib" + providers_cann + ".so"
providers_qnn = "lib" + providers_qnn + ".so"
elif platform.system() == "Windows":
providers_cuda_or_rocm = providers_cuda_or_rocm + ".dll"
providers_tensorrt_or_migraphx = providers_tensorrt_or_migraphx + ".dll"
providers_openvino = providers_openvino + ".dll"
providers_cann = providers_cann + ".dll"
providers_qnn = providers_qnn + ".dll"

# Additional binaries
dl_libs = []
Expand All @@ -341,15 +344,17 @@ def finalize_options(self):
dl_libs.append(providers_cuda_or_rocm)
dl_libs.append(providers_tensorrt_or_migraphx)
dl_libs.append(providers_cann)
dl_libs.append(providers_qnn)
dl_libs.append("libonnxruntime.so*")
# DNNL, TensorRT & OpenVINO EPs are built as shared libs
# DNNL, TensorRT, OpenVINO, and QNN EPs are built as shared libs
libs.extend(["libonnxruntime_providers_shared.so"])
libs.extend(["libonnxruntime_providers_dnnl.so"])
libs.extend(["libonnxruntime_providers_openvino.so"])
libs.extend(["libonnxruntime_providers_vitisai.so"])
libs.append(providers_cuda_or_rocm)
libs.append(providers_tensorrt_or_migraphx)
libs.append(providers_cann)
libs.append(providers_qnn)
# QNN
qnn_deps = [
"libQnnCpu.so",
Expand Down Expand Up @@ -388,13 +393,14 @@ def finalize_options(self):
providers_cann,
"onnxruntime.dll",
]
# DNNL, TensorRT & OpenVINO EPs are built as shared libs
# DNNL, TensorRT, OpenVINO, and QNN EPs are built as shared libs
libs.extend(["onnxruntime_providers_shared.dll"])
libs.extend(["onnxruntime_providers_dnnl.dll"])
libs.extend(["onnxruntime_providers_tensorrt.dll"])
libs.extend(["onnxruntime_providers_openvino.dll"])
libs.extend(["onnxruntime_providers_cuda.dll"])
libs.extend(["onnxruntime_providers_vitisai.dll"])
libs.extend(["onnxruntime_providers_qnn.dll"])
# DirectML Libs
libs.extend(["DirectML.dll"])
# QNN V68/V73 dependencies
Expand Down

0 comments on commit 058e7bb

Please sign in to comment.