-
Notifications
You must be signed in to change notification settings - Fork 172
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 5 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.0 | ||
tag: v1.19.0 | ||
source: https://github.com/microsoft/onnxruntime | ||
requires: | ||
- protobuf | ||
|
@@ -19,7 +19,61 @@ prepend_path: | |
|
||
mkdir -p $INSTALLROOT | ||
|
||
ORT_BUILD_FLAGS="" | ||
case $ARCHITECTURE in | ||
osx_*) | ||
if [[ $ARCHITECTURE == *_x86-64 ]]; then | ||
echo "Installing ONNXRuntime for MacOS (CPU version)" | ||
else | ||
echo "Installing ONNXRuntime for MacOS (Metal backend)" | ||
fi | ||
;; | ||
*) | ||
if command -v rocminfo >/dev/null 2>&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.
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. Good point, das check ich nochmal |
||
echo "Installing ONNXRuntime for ROCm" | ||
ORT_BUILD_FLAGS="\ | ||
-Donnxruntime_USE_ROCM=ON \ | ||
-Donnxruntime_USE_MIGRAPHX=ON \ | ||
-Donnxruntime_ROCM_HOME=/opt/rocm \ | ||
-DCMAKE_HIP_COMPILER=/opt/rocm/llvm/bin/clang++ \ | ||
-D__HIP_PLATFORM_AMD__=1 \ | ||
-DCMAKE_HIP_ARCHITECTURES=gfx906,gfx908 \ | ||
-Donnxruntime_USE_COMPOSABLE_KERNEL=OFF \ | ||
-Donnxruntime_USE_ROCBLAS_EXTENSION_API=ON \ | ||
-Donnxruntime_USE_COMPOSABLE_KERNEL_CK_TILE=ON \ | ||
-Donnxruntime_ENABLE_TRAINING=OFF \ | ||
-Donnxruntime_DISABLE_RTTI=OFF \ | ||
-DMSVC=OFF \ | ||
" | ||
elif command -v nvcc >/dev/null 2>&1; then | ||
CUDA_VERSION=$(nvcc --version | grep "release" | awk '{print $NF}' | cut -d. -f1) | ||
if [[ "$CUDA_VERSION" == "V11" ]]; 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. glaube CUDA 11 kannst du weglassen, und nur >=12 annehmen |
||
echo "Installing ONNXRuntime for CUDA 11.x" | ||
ORT_BUILD_FLAGS=" -Donnxruntime_USE_CUDA=ON \ | ||
-DCUDA_TOOLKIT_ROOT_DIR=$CUDA_ROOT \ | ||
-Donnxruntime_USE_CUDA_NHWC_OPS=ON \ | ||
-Donnxruntime_CUDA_USE_TENSORRT=ON \ | ||
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. Wenn du tensorrt nutzt, musst du dann prüfen, ob das explicit installiert ist? Oder ist das immer beim CUDA SDK dabei? 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. Scheint nicht automatisch mitzukommen (https://docs.nvidia.com/deeplearning/tensorrt/install-guide/index.html)... Ok da bau ich auch noch einen Check mit ein |
||
" | ||
elif [[ "$CUDA_VERSION" == "V12" ]]; 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. Was ist wenn ROCm und CUDA beides vorhanden ist? Können wir dann nicht beides bauen? 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. Ne, die kann man nicht parallel bauen, es geht immer nur eins von beiden: https://github.com/microsoft/onnxruntime/blob/afd642a194b39138ad891e7bb2c8bca26d37b785/cmake/CMakeLists.txt#L288-L290 |
||
echo "Installing ONNXRuntime for CUDA 12.x" | ||
ORT_BUILD_FLAGS=" -Donnxruntime_USE_CUDA=ON \ | ||
-DCUDA_TOOLKIT_ROOT_DIR=$CUDA_ROOT \ | ||
-Donnxruntime_USE_CUDA_NHWC_OPS=ON \ | ||
-Donnxruntime_CUDA_USE_TENSORRT=ON \ | ||
" | ||
else | ||
echo "CUDA version is not 11.x or 12.x, installing ONNXRuntime basic CPU version" | ||
ORT_BUILD_FLAGS="" | ||
fi | ||
else | ||
echo "Installing ONNXRuntime basic CPU version" | ||
ORT_BUILD_FLAGS="" | ||
fi | ||
;; | ||
esac | ||
|
||
cmake "$SOURCEDIR/cmake" \ | ||
$ORT_BUILD_FLAGS \ | ||
-DCMAKE_INSTALL_PREFIX=$INSTALLROOT \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DCMAKE_INSTALL_LIBDIR=lib \ | ||
|
@@ -35,8 +89,8 @@ cmake "$SOURCEDIR/cmake" | |
${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" \ | ||
-DCMAKE_C_FLAGS="$CFLAGS -Wno-unknown-warning -Wno-unknown-warning-option -Wno-error=unused-but-set-variable" | ||
-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" \ | ||
-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" | ||
|
||
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.
Solche printouts würde ich weglassen, das ist ja hauptsächlich für debugging
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.
Ja, aber ich nehme an das es auch einen macOS build gibt der die Mac GPU anspricht. Da muss ich nochmal ein bisschen rumsuchen, dann könnte man den if-Block nämlich nehmen um da die build flags rein zu packen. Aber ja, die print-outs nehm ich am Ende natürlich noch raus