Closed xiaotiane33 closed 1 year ago
Can you try a later version of ONNX Runtime?
I just tried this on rel-1.14.0 branch and it works just fine. I used ./build.sh --skip_tests --build_dir b_14 --config MinSizeRel --use_cuda --cudnn_home /usr/local/cudnn --cuda_home /usr/local/cuda --parallel 4
. I've Ubuntu 18.04.5 LTS
.
so i have solve this issue on onnx Runtime 1.12.0 modify abseil_cpp-src/absl/container/internal/inlined_vector.h file
build success
Describe the issue
I am getting an error for building onxxruntime with CUDA. cmake version 3.26.1 cuda 11.4 cudnn 8.2.4 onnxruntime 1.12.0 nvidia 1080ti
Urgency
it is very urgent.
Target platform
oracleLinux8.5
Build script
./build.sh --skip_tests --build_dir /root/onnxruntime-v1.12.0/build/Linux/GPU/static --config MinSizeRel --use_cuda --cudnn_home /usr/local/cudnn --cuda_home /usr/local/cuda --parallel
Error / output
[ 64%] Building CXX object CMakeFiles/onnxruntime_optimizer.dir/root/onnxruntime-v1.12.0/onnxruntime/core/optimizer/selectors_actions/actions.cc.o [ 64%] Building CUDA object CMakeFiles/onnxruntime_providers_cuda.dir/root/onnxruntime-v1.12.0/onnxruntime/core/providers/cuda/activation/activations_impl.cu.o nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning). [ 64%] Building CUDA object CMakeFiles/onnxruntime_providers_cuda.dir/root/onnxruntime-v1.12.0/onnxruntime/core/providers/cuda/cuda_utils.cu.o nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning). [ 64%] Building CXX object CMakeFiles/onnxruntime_providers.dir/root/onnxruntime-v1.12.0/onnxruntime/core/providers/cpu/math/gemm.cc.o [ 65%] Building CXX object CMakeFiles/onnxruntime_optimizer.dir/root/onnxruntime-v1.12.0/onnxruntime/core/optimizer/selectors_actions/helpers.cc.o /root/onnxruntime-v1.12.0/onnxruntime/gsl/gsl-lite.hpp(1959): warning: calling a host function from a host device function is not allowed
[ 65%] Building CXX object CMakeFiles/onnxruntime_optimizer.dir/root/onnxruntime-v1.12.0/onnxruntime/core/optimizer/selectors_actions/selector_action_transformer.cc.o /root/onnxruntime-v1.12.0/onnxruntime/gsl/gsl-lite.hpp(1959): warning: calling a host function from a host device function is not allowed
/root/onnxruntime-v1.12.0/onnxruntime/gsl/gsl-lite.hpp(1959): warning: calling a host function from a host device function is not allowed
/root/onnxruntime-v1.12.0/onnxruntime/gsl/gsl-lite.hpp(1959): warning: calling a host function from a host device function is not allowed
/root/onnxruntime-v1.12.0/onnxruntime/gsl/gsl-lite.hpp(1959): warning: calling a host function from a host device function is not allowed
/root/onnxruntime-v1.12.0/onnxruntime/gsl/gsl-lite.hpp(1959): warning: calling a host function from a host device function is not allowed
/root/onnxruntime-v1.12.0/onnxruntime/gsl/gsl-lite.hpp(1959): warning: calling a host function from a host device function is not allowed
[ 65%] Building CXX object CMakeFiles/onnxruntime_optimizer.dir/root/onnxruntime-v1.12.0/onnxruntime/core/optimizer/skip_layer_norm_fusion.cc.o /root/onnxruntime-v1.12.0/onnxruntime/gsl/gsl-lite.hpp(1959): warning: calling a host function from a host device function is not allowed
/root/onnxruntime-v1.12.0/onnxruntime/gsl/gsl-lite.hpp(1959): warning: calling a host function from a host device function is not allowed
/root/onnxruntime-v1.12.0/onnxruntime/gsl/gsl-lite.hpp(1959): warning: calling a host function from a host device function is not allowed
/root/onnxruntime-v1.12.0/onnxruntime/gsl/gsl-lite.hpp(1959): warning: calling a host function from a host device function is not allowed
/root/onnxruntime-v1.12.0/onnxruntime/gsl/gsl-lite.hpp(1959): warning: calling a host function from a host device function is not allowed
/root/onnxruntime-v1.12.0/onnxruntime/gsl/gsl-lite.hpp(1959): warning: calling a host function from a host device function is not allowed
/root/onnxruntime-v1.12.0/onnxruntime/gsl/gsl-lite.hpp(1959): warning: calling a host function from a host device function is not allowed
[ 65%] Building CXX object CMakeFiles/onnxruntime_optimizer.dir/root/onnxruntime-v1.12.0/onnxruntime/core/optimizer/slice_elimination.cc.o [ 65%] Building CXX object CMakeFiles/onnxruntime_optimizer.dir/root/onnxruntime-v1.12.0/onnxruntime/core/optimizer/transformer_memcpy.cc.o /root/onnxruntime-v1.12.0/build/Linux/GPU/static/MinSizeRel/_deps/abseil_cpp-src/absl/container/internal/inlined_vector.h: in a member function ‘void absl::lts_20211102::inlined_vector_internal::Storage<T, N, A>::Swap(absl::lts_20211102::inlined_vector_internal::Storage<T, N, A>*)’ in: /root/onnxruntime-v1.12.0/build/Linux/GPU/static/MinSizeRel/_deps/abseil_cpp-src/absl/container/internal/inlined_vector.h:907:97: error:expected ‘;’ before ‘}’ token allocated_ptr->SetAllocation( ^ ; /root/onnxruntime-v1.12.0/build/Linux/GPU/static/MinSizeRel/_deps/abseil_cpp-src/absl/container/internal/inlined_vector.h:915:95: error:expected ‘;’ before ‘}’ token inlined_ptr->SetAllocation( ^ ; gmake[2]: [CMakeFiles/onnxruntime_providers_cuda.dir/build.make:1240:CMakeFiles/onnxruntime_providers_cuda.dir/root/onnxruntime-v1.12.0/onnxruntime/core/providers/cuda/cuda_utils.cu.o] error 255 gmake[2]: waiting for unfinished tasks.... [ 65%] Building CXX object CMakeFiles/onnxruntime_optimizer.dir/root/onnxruntime-v1.12.0/onnxruntime/core/optimizer/transpose_optimizer/optimizer_api_impl.cc.o [ 65%] Building CXX object CMakeFiles/onnxruntime_optimizer.dir/root/onnxruntime-v1.12.0/onnxruntime/core/optimizer/transpose_optimizer/ort_transpose_optimizer.cc.o /root/onnxruntime-v1.12.0/build/Linux/GPU/static/MinSizeRel/_deps/abseil_cpp-src/absl/container/internal/inlined_vector.h: in a member function‘void absl::lts_20211102::inlined_vector_internal::Storage<T, N, A>::Swap(absl::lts_20211102::inlined_vector_internal::Storage<T, N, A>*)’中: /root/onnxruntime-v1.12.0/build/Linux/GPU/static/MinSizeRel/_deps/abseil_cpp-src/absl/container/internal/inlined_vector.h:907:97: error:expected ‘;’ before ‘}’ token allocated_ptr->SetAllocation( ^ ; /root/onnxruntime-v1.12.0/build/Linux/GPU/static/MinSizeRel/_deps/abseil_cpp-src/absl/container/internal/inlined_vector.h:915:95: error:expected ‘;’ before ‘}’ token inlined_ptr->SetAllocation( ^ ; gmake[2]: [CMakeFiles/onnxruntime_providers_cuda.dir/build.make:1225:CMakeFiles/onnxruntime_providers_cuda.dir/root/onnxruntime-v1.12.0/onnxruntime/core/providers/cuda/activation/activations_impl.cu.o] error 255 gmake[1]: [CMakeFiles/Makefile2:1805:CMakeFiles/onnxruntime_providers_cuda.dir/all] error 2 gmake[1]: waiting for unfinished tasks.... [ 65%] Building CXX object CMakeFiles/onnxruntime_optimizer.dir/root/onnxruntime-v1.12.0/onnxruntime/core/optimizer/transpose_optimizer/transpose_optimizer.cc.o [ 65%] Building CXX object CMakeFiles/onnxruntime_optimizer.dir/root/onnxruntime-v1.12.0/onnxruntime/core/optimizer/unsqueeze_elimination.cc.o [ 65%] Building CXX object CMakeFiles/onnxruntime_optimizer.dir/root/onnxruntime-v1.12.0/onnxruntime/core/optimizer/utils.cc.o [ 65%] Building CXX object CMakeFiles/onnxruntime_providers.dir/root/onnxruntime-v1.12.0/onnxruntime/core/providers/cpu/math/hardmax.cc.o [ 65%] Building CXX object CMakeFiles/onnxruntime_providers.dir/root/onnxruntime-v1.12.0/onnxruntime/core/providers/cpu/math/matmul.cc.o [ 65%] Building CXX object CMakeFiles/onnxruntime_providers.dir/root/onnxruntime-v1.12.0/onnxruntime/core/providers/cpu/math/round.cc.o [ 67%] Building CXX object CMakeFiles/onnxruntime_providers.dir/root/onnxruntime-v1.12.0/onnxruntime/core/providers/cpu/math/sign.cc.o [ 67%] Building CXX object CMakeFiles/onnxruntime_providers.dir/root/onnxruntime-v1.12.0/onnxruntime/core/providers/cpu/math/softmax.cc.o [ 67%] Linking CXX static library libonnxruntime_optimizer.a ..... [ 76%] Building CXX object CMakeFiles/onnxruntime_providers.dir/root/onnxruntime-v1.12.0/onnxruntime/contrib_ops/cpu/tokenizer.cc.o [ 76%] Building CXX object CMakeFiles/onnxruntime_providers.dir/root/onnxruntime-v1.12.0/onnxruntime/contrib_ops/cpu/transformers/beam_search.cc.o [ 76%] Building CXX object CMakeFiles/onnxruntime_providers.dir/root/onnxruntime-v1.12.0/onnxruntime/contrib_ops/cpu/transformers/beam_search_device_helper.cc.o [ 76%] Building CXX object CMakeFiles/onnxruntime_providers.dir/root/onnxruntime-v1.12.0/onnxruntime/contrib_ops/cpu/transformers/beam_search_parameters.cc.o [ 76%] Building CXX object CMakeFiles/onnxruntime_providers.dir/root/onnxruntime-v1.12.0/onnxruntime/contrib_ops/cpu/transformers/beam_search_scorer.cc.o [ 76%] Building CXX object CMakeFiles/onnxruntime_providers.dir/root/onnxruntime-v1.12.0/onnxruntime/contrib_ops/cpu/transformers/dump_tensor.cc.o [ 76%] Building CXX object CMakeFiles/onnxruntime_providers.dir/root/onnxruntime-v1.12.0/onnxruntime/contrib_ops/cpu/transformers/logits_processor.cc.o [ 76%] Building CXX object CMakeFiles/onnxruntime_providers.dir/root/onnxruntime-v1.12.0/onnxruntime/contrib_ops/cpu/transformers/sequences.cc.o [ 76%] Building CXX object CMakeFiles/onnxruntime_providers.dir/root/onnxruntime-v1.12.0/onnxruntime/contrib_ops/cpu/transformers/subgraph_base.cc.o [ 76%] Building CXX object CMakeFiles/onnxruntime_providers.dir/root/onnxruntime-v1.12.0/onnxruntime/contrib_ops/cpu/transformers/subgraph_gpt.cc.o [ 76%] Building CXX object CMakeFiles/onnxruntime_providers.dir/root/onnxruntime-v1.12.0/onnxruntime/contrib_ops/cpu/transformers/subgraph_t5_decoder.cc.o [ 76%] Building CXX object CMakeFiles/onnxruntime_providers.dir/root/onnxruntime-v1.12.0/onnxruntime/contrib_ops/cpu/transformers/subgraph_t5_encoder.cc.o [ 76%] Building CXX object CMakeFiles/onnxruntime_providers.dir/root/onnxruntime-v1.12.0/onnxruntime/contrib_ops/cpu/unique.cc.o [ 76%] Building CXX object CMakeFiles/onnxruntime_providers.dir/root/onnxruntime-v1.12.0/onnxruntime/contrib_ops/cpu/word_conv_embedding.cc.o [ 76%] Linking CXX static library libonnxruntime_providers.a [ 76%] Built target onnxruntime_providers gmake: [Makefile:166:all] error 2 Traceback (most recent call last): File "/root/onnxruntime-v1.12.0/tools/ci_build/build.py", line 2744, in
sys.exit(main())
File "/root/onnxruntime-v1.12.0/tools/ci_build/build.py", line 2663, in main
build_targets(args, cmake_path, build_dir, configs, num_parallel_jobs, args.target)
File "/root/onnxruntime-v1.12.0/tools/ci_build/build.py", line 1301, in build_targets
run_subprocess(cmd_args, env=env)
File "/root/onnxruntime-v1.12.0/tools/ci_build/build.py", line 714, in run_subprocess
return run(*args, cwd=cwd, capture_stdout=capture_stdout, shell=shell, env=my_env)
File "/root/onnxruntime-v1.12.0/tools/python/util/run.py", line 49, in run
completed_process = subprocess.run(
File "/usr/lib64/python3.9/subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/usr/local/cmake-3.26.1/bin/cmake', '--build', '/root/onnxruntime-v1.12.0/build/Linux/GPU/static/MinSizeRel', '--config', 'MinSizeRel', '--', '-j6']' returned non-zero exit status 2.
Visual Studio Version
No response
GCC / Compiler Version
gcc8.5.o