-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ORT GPU build #5622
ORT GPU build #5622
Changes from 10 commits
c80e36c
4d42b1f
23c3e5f
78fcf07
6e3689b
0fa8a06
73b54ce
5e42e46
9e47dfd
e90a9e5
d7b089d
d45d194
000afbb
9613081
f28a341
4813226
2713a61
62ece4e
ea219bf
ae214b5
6f3d636
f5fd93b
5e0f296
e01351a
6bf0ad8
d093398
6624f3f
0cfeaa0
48e25ed
bee78c8
1493b80
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
package: ONNXRuntime | ||
version: "%(tag_basename)s" | ||
tag: v1.18.1 | ||
tag: v1.19.0 | ||
source: https://github.com/microsoft/onnxruntime | ||
requires: | ||
- protobuf | ||
|
@@ -19,24 +19,70 @@ prepend_path: | |
|
||
mkdir -p $INSTALLROOT | ||
|
||
cmake "$SOURCEDIR/cmake" \ | ||
-DCMAKE_INSTALL_PREFIX=$INSTALLROOT \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DCMAKE_INSTALL_LIBDIR=lib \ | ||
-DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") \ | ||
-Donnxruntime_BUILD_UNIT_TESTS=OFF \ | ||
-Donnxruntime_PREFER_SYSTEM_LIB=ON \ | ||
-Donnxruntime_BUILD_SHARED_LIB=ON \ | ||
-DProtobuf_USE_STATIC_LIBS=ON \ | ||
${PROTOBUF_ROOT:+-DProtobuf_LIBRARY=$PROTOBUF_ROOT/lib/libprotobuf.a} \ | ||
${PROTOBUF_ROOT:+-DProtobuf_LITE_LIBRARY=$PROTOBUF_ROOT/lib/libprotobuf-lite.a} \ | ||
${PROTOBUF_ROOT:+-DProtobuf_PROTOC_LIBRARY=$PROTOBUF_ROOT/lib/libprotoc.a} \ | ||
${PROTOBUF_ROOT:+-DProtobuf_INCLUDE_DIR=$PROTOBUF_ROOT/include} \ | ||
${PROTOBUF_ROOT:+-DProtobuf_PROTOC_EXECUTABLE=$PROTOBUF_ROOT/bin/protoc} \ | ||
${RE2_ROOT:+-DRE2_INCLUDE_DIR=${RE2_ROOT}/include} \ | ||
${BOOST_ROOT:+-DBOOST_INCLUDE_DIR=${BOOST_ROOT}/include} \ | ||
-DCMAKE_CXX_FLAGS="$CXXFLAGS -Wno-unknown-warning -Wno-unknown-warning-option -Wno-error=unused-but-set-variable -Wno-error=deprecated" \ | ||
-DCMAKE_C_FLAGS="$CFLAGS -Wno-unknown-warning -Wno-unknown-warning-option -Wno-error=unused-but-set-variable -Wno-error=deprecated" | ||
# Check ROCm build conditions | ||
if { [ "$ALIBUILD_O2_FORCE_GPU" -ne 0 ] || [ "$ALIBUILD_ENABLE_HIP" -ne 0 ] || command -v rocminfo >/dev/null 2>&1; } && \ | ||
{ [ -z "$DISABLE_GPU" ] || [ "$DISABLE_GPU" -eq 0 ]; }; then | ||
export ORT_ROCM_BUILD=1 | ||
else | ||
export ORT_ROCM_BUILD=0 | ||
fi | ||
ChSonnabend marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# Check CUDA build conditions | ||
if { [ "$ALIBUILD_O2_FORCE_GPU" -ne 0 ] || [ "$ALIBUILD_ENABLE_CUDA" -ne 0 ] || command -v nvcc >/dev/null 2>&1; } && \ | ||
{ [ -z "$DISABLE_GPU" ] || [ "$DISABLE_GPU" -eq 0 ]; }; then | ||
export ORT_CUDA_BUILD=1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would also set a default for ALIBUILD_O2_OVERRIDE_CUDA_ARCHS to |
||
else | ||
export ORT_CUDA_BUILD=0 | ||
fi | ||
|
||
# Optional builds | ||
### MIGraphX | ||
if [ "$ORT_ROCM_BUILD" -eq 1 ] && [ $(find /opt/rocm* -name "libmigraphx*" -print -quit | wc -l 2>&1) -eq 1 ]; then | ||
export ORT_MIGRAPHX_BUILD=1 | ||
else | ||
export ORT_MIGRAPHX_BUILD=0 | ||
fi | ||
### TensorRT | ||
if [ "$ORT_CUDA_BUILD" -eq 1 ] && [ $(find /opt/rocm* -name "libnvinfer*" -print -quit | wc -l 2>&1) -eq 1 ]; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do you search for tensort in /opt/rocm? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 😅 |
||
export ORT_TENSORRT_BUILD=1 | ||
else | ||
export ORT_TENSORRT_BUILD=0 | ||
fi | ||
|
||
cmake "$SOURCEDIR/cmake" \ | ||
-DCMAKE_INSTALL_PREFIX=$INSTALLROOT \ | ||
ktf marked this conversation as resolved.
Show resolved
Hide resolved
|
||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DCMAKE_INSTALL_LIBDIR=lib \ | ||
-DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") \ | ||
ktf marked this conversation as resolved.
Show resolved
Hide resolved
|
||
-Donnxruntime_BUILD_UNIT_TESTS=OFF \ | ||
-Donnxruntime_PREFER_SYSTEM_LIB=ON \ | ||
-Donnxruntime_BUILD_SHARED_LIB=ON \ | ||
-DProtobuf_USE_STATIC_LIBS=ON \ | ||
-Donnxruntime_ENABLE_TRAINING=OFF \ | ||
${PROTOBUF_ROOT:+-DProtobuf_LIBRARY=$PROTOBUF_ROOT/lib/libprotobuf.a} \ | ||
${PROTOBUF_ROOT:+-DProtobuf_LITE_LIBRARY=$PROTOBUF_ROOT/lib/libprotobuf-lite.a} \ | ||
${PROTOBUF_ROOT:+-DProtobuf_PROTOC_LIBRARY=$PROTOBUF_ROOT/lib/libprotoc.a} \ | ||
${PROTOBUF_ROOT:+-DProtobuf_INCLUDE_DIR=$PROTOBUF_ROOT/include} \ | ||
${PROTOBUF_ROOT:+-DProtobuf_PROTOC_EXECUTABLE=$PROTOBUF_ROOT/bin/protoc} \ | ||
${RE2_ROOT:+-DRE2_INCLUDE_DIR=${RE2_ROOT}/include} \ | ||
${BOOST_ROOT:+-DBOOST_INCLUDE_DIR=${BOOST_ROOT}/include} \ | ||
-Donnxruntime_USE_MIGRAPHX=${ORT_MIGRAPHX_BUILD} \ | ||
-Donnxruntime_USE_ROCM=${ORT_ROCM_BUILD} \ | ||
-Donnxruntime_ROCM_HOME=/opt/rocm \ | ||
-Donnxruntime_CUDA_HOME=/usr/local/cuda \ | ||
-DCMAKE_HIP_COMPILER=/opt/rocm/llvm/bin/clang++ \ | ||
-D__HIP_PLATFORM_AMD__=1 \ | ||
-DCMAKE_HIP_ARCHITECTURES=gfx906,gfx908 \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand this. You first set CMAKE_HIP_ARCHITECTURES, and then you possibly override it in the next line? Why don't you expand ALIBUILD_O2_OVERRIDE_HIP_ARCHS to the defaults if empty? |
||
${ALIBUILD_O2_OVERRIDE_HIP_ARCHS:+-DCMAKE_HIP_ARCHITECTURES=${ALIBUILD_O2_OVERRIDE_HIP_ARCHS}} \ | ||
ChSonnabend marked this conversation as resolved.
Show resolved
Hide resolved
|
||
-Donnxruntime_USE_COMPOSABLE_KERNEL=OFF \ | ||
-Donnxruntime_USE_ROCBLAS_EXTENSION_API=ON \ | ||
-Donnxruntime_USE_COMPOSABLE_KERNEL_CK_TILE=ON \ | ||
-Donnxruntime_DISABLE_RTTI=OFF \ | ||
-DMSVC=OFF \ | ||
-Donnxruntime_USE_CUDA=${ORT_CUDA_BUILD} \ | ||
-Donnxruntime_USE_CUDA_NHWC_OPS=${ORT_CUDA_BUILD} \ | ||
-Donnxruntime_CUDA_USE_TENSORRT=${ORT_TENSORRT_BUILD} \ | ||
-DCMAKE_CXX_FLAGS="$CXXFLAGS -Wno-unknown-warning -Wno-unknown-warning-option -Wno-pass-failed -Wno-error=unused-but-set-variable -Wno-pass-failed=transform-warning -Wno-error=deprecated" \ | ||
-DCMAKE_C_FLAGS="$CFLAGS -Wno-unknown-warning -Wno-unknown-warning-option -Wno-pass-failed -Wno-error=unused-but-set-variable -Wno-pass-failed=transform-warning -Wno-error=deprecated" | ||
|
||
cmake --build . -- ${JOBS:+-j$JOBS} install | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it guaranteed that rocminfo is in the path? Perhaps, try rocminfo or /opt/rocm/bin/rocminfo?
Also, perhaps it needs HIP, not rocminfo? So perhaps check for /opt/rocm/bin/hipcc?