0%

一些编译指令记录

自动摘要: 显卡算力表:https://developer.nvidia.com/cudagpus onnxruntim ……..

显卡算力表:https://developer.nvidia.com/cuda-gpus

onnxruntime

静态编译

https://github.com/csukuangfj/onnxruntime-libs/releases/tag/v1.17.1

1
.\build.bat  --update --config RelWithDebInfo  --parallel  --enable_msvc_static_runtime --skip_tests --cmake_generator “Visual Studio 17 2022--cmake_extra_defines CMAKE_INSTALL_PREFIX=./install
1
2

.\build.bat --update --config RelWithDebInfo --parallel --use_cuda --cuda_home="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6" --cudnn_home="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6" --cmake_extra_defines 'CMAKE_CUDA_ARCHITECTURES=61;75;86;89' --enable_msvc_static_runtime --skip_tests --cmake_generator “Visual Studio 17 2022--cmake_extra_defines CMAKE_INSTALL_PREFIX=./install
1
.\build.bat  --update --config RelWithDebInfo    --parallel   --build_wheel   --use_dml   --use_cuda  --use_tensorrt --tensorrt_home="D:\software\develop\TensorRT-8.6.1.6"  --cuda_home="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8"  --cudnn_home="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8"  --cmake_extra_defines 'CMAKE_CUDA_ARCHITECTURES=61;75;86;89'  --enable_msvc_static_runtime --skip_tests --cmake_generator “Visual Studio 17 2022--cmake_extra_defines CMAKE_INSTALL_PREFIX=./install
1
2
cd build\Windows\RelWithDebInfo
cmake --build . --config RelWithDebInfo --target install -j10

protobuf 与conda冲突问题(删除conda lib的protobuf):https://github.com/microsoft/onnxruntime/discussions/17904注:复制**D:\software\develop\CompileLibrary\onnxruntime\build\Windows\Release\external **下的lib库 到生成的lib库下

open3d

  1. Debug;调试版本
  2. Release;正式版本
  3. RelWithDebInfo;既优化又能调试的版本
  4. MinSizeRel;最小体积版本

gpu

需要挂代理,会下载一堆依赖:

1
$env:HTTPS_PROXY="http://127.0.0.1:10809"
1
2
3
cmake.exe -A=x64   -DPython3_EXECUTABLE="D:/software/develop/Miniconda3/envs/ai_3d/python.exe"  -DCMAKE_INSTALL_PREFIX="./Open3d_Install/gpu/" -DBUILD_CUDA_MODULE=ON -DBUILD_COMMON_CUDA_ARCHS=ON  ..
cmake.exe --build . --config RelWithDebInfo --target INSTALL --target pip-package -j12

cpu

1
2
cmake.exe -A=x64  -DCMAKE_INSTALL_PREFIX="./Open3d_Install/cpu/"
cmake.exe --build . --config RelWithDebInfo --target INSTALL --target pip-package -j12

opencv

1
2
set CMAKE_BUILD_PARALLEL_LEVEL=12 
"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"
1
2
cmake.exe -H"D:/software/develop/CompileLibrary/opencv-4.9.0" -DOPENCV_EXTRA_MODULES_PATH="D:/software/develop/CompileLibrary/opencv_contrib-4.9.0/modules" -B"D:/software/develop/CompileLibrary/opencv-4.9.0/build" -G "Visual Studio 17 2022" -DPYTHON3_INCLUDE_DIR=D:/software/develop/Miniconda3/include -DPYTHON3_LIBRARY=D:/software/develop/Miniconda3/libs/python38.lib -DPYTHON3_EXECUTABLE=D:/software/develop/Miniconda3/python.exe -DPYTHON3_NUMPY_INCLUDE_DIRS=D:/software/develop/Miniconda3/lib/site-packages/numpy/core/include -DPYTHON3_PACKAGES_PATH=D:/software/develop/Miniconda3/Lib/site-packages -DCMAKE_BUILD_TYPE=Release -DINSTALL_TESTS=OFF -DINSTALL_C_EXAMPLES=ON -DBUILD_EXAMPLES=ON -DBUILD_opencv_world=ON -DENABLE_CUDA_FIRST_CLASS_LANGUAGE=ON -DWITH_CUDA=ON  -DBUILD_opencv_python3=ON -DWITH_TBB=ON -DWITH_OPENMP=ON -DWITH_IPP=ON -DBUILD_JAVA=OFF -DWITH_GSTREAMER=ON  -DBUILD_TESTS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_DOCS=OFF -DBUILD_PERF_TESTS=OFF -DCUDA_ARCH_BIN="61,75,86,89" -DCUDA_ARCH_PTX=86

1
cmake.exe --build . --config Release --target INSTALL -j12

欢迎关注我的其它发布渠道