Skip to content

Commit

Permalink
Update CUDA archs to 5.0;6.0;7.0;8.0;9.0 in builds for OpenCV, ONNX R…
Browse files Browse the repository at this point in the history
…untime, PyTorch
  • Loading branch information
saudet committed Nov 10, 2023
1 parent 5507552 commit f1d1fd0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion onnxruntime/cppbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ sedinplace '/omp_get_max_threads/d' onnxruntime/core/providers/dnnl/dnnl_executi
sedinplace '/omp_set_num_threads/d' onnxruntime/core/providers/dnnl/dnnl_execution_provider.cc

# use PTX instead of compiling for all CUDA archs to reduce library size
sedinplace 's/-gencode=arch=compute_52,code=sm_52/-gencode arch=compute_50,code=sm_50 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_70,code=compute_70/g' cmake/CMakeLists.txt
sedinplace 's/-gencode=arch=compute_52,code=sm_52/-gencode arch=compute_50,code=sm_50 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_90,code=sm_90/g' cmake/CMakeLists.txt
sedinplace '/-gencode=arch=compute_..,code=sm_../d' cmake/CMakeLists.txt

# provide a default constructor to Ort::Value to make it more usable with std::vector
Expand Down
2 changes: 1 addition & 1 deletion opencv/cppbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ BUILD_CONTRIB_X="-DBUILD_opencv_stereo=OFF -DBUILD_opencv_plot=ON -DBUILD_opencv

GPU_FLAGS="-DWITH_CUDA=OFF"
if [[ "$EXTENSION" == *gpu ]]; then
GPU_FLAGS="-DWITH_CUDA=ON -DWITH_CUDNN=ON -DOPENCV_DNN_CUDA=ON -DCUDA_VERSION=12.3 -DCUDNN_VERSION=8.9 -DCUDA_ARCH_BIN='5.0;6.0;7.0' -DCUDA_ARCH_PTX='7.0' -DCUDA_NVCC_FLAGS=--expt-relaxed-constexpr -DCUDA_nppicom_LIBRARY="
GPU_FLAGS="-DWITH_CUDA=ON -DWITH_CUDNN=ON -DOPENCV_DNN_CUDA=ON -DCUDA_VERSION=12.3 -DCUDNN_VERSION=8.9 -DCUDA_ARCH_BIN='5.0;6.0;7.0;8.0;9.0' -DCUDA_ARCH_PTX='' -DCUDA_NVCC_FLAGS=--expt-relaxed-constexpr -DCUDA_nppicom_LIBRARY="
fi

# exclude openblas dependencies
Expand Down

0 comments on commit f1d1fd0

Please sign in to comment.