microsoft / onnxruntime

ONNX Runtime: cross-platform, high performance ML inferencing and training accelerator
https://onnxruntime.ai
MIT License
14.67k stars 2.93k forks source link

Compatibility Nvidia? #20233

Open johnnynunez opened 7 months ago

johnnynunez commented 7 months ago

Describe the documentation issue

Is compatible with Cuda 12.4 update 1 Cudnn 9 TensorRT 10 ?

Page / URL

No response

tianleiwu commented 7 months ago

AFAIK Cuda 12.4 update 1: YES if using official package; If you want to build from source: use CUDA 12.3 in build server to avoid build errors, the built package shall be compatible with CUDA 12.4 update 1 in inference. Cudnn 9: NO if using official package, MAYBE if you want to build from source TensorRT 10: NO if using official package, MAYBE if you want to build from source

For more information, see https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html https://onnxruntime.ai/docs/execution-providers/TensorRT-ExecutionProvider.html

Anivie commented 7 months ago

AFAIK Cuda 12.4 update 1: YES if using official package; If you want to build from source: use CUDA 12.3 in build server to avoid build errors, the built package shall be compatible with CUDA 12.4 update 1 in inference. Cudnn 9: NO if using official package, MAYBE if you want to build from source TensorRT 10: NO if using official package, MAYBE if you want to build from source

For more information, see https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html https://onnxruntime.ai/docs/execution-providers/TensorRT-ExecutionProvider.html

Hi! I am try to use onnx in my wsl, so I am following the nvidia doc to install the cuda and cudnn, then install the ONNX Runtime v1.17.1 release for me.

But when start my program, I am receive the error: Failed to load library libonnxruntime_providers_tensorrt.so with error: libcublas.so.11: cannot open shared object file: No such file or directory

I am search for this library and found the libcublas.so.12 only, and my cuda version is:cuda_12.4.r12.4, so could you please tell me how can I add support for Cuda 12.4?

johnnynunez commented 7 months ago

AFAIK Cuda 12.4 update 1: YES if using official package; If you want to build from source: use CUDA 12.3 in build server to avoid build errors, the built package shall be compatible with CUDA 12.4 update 1 in inference. Cudnn 9: NO if using official package, MAYBE if you want to build from source TensorRT 10: NO if using official package, MAYBE if you want to build from source For more information, see https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html https://onnxruntime.ai/docs/execution-providers/TensorRT-ExecutionProvider.html

Hi! I am try to use onnx in my wsl, so I am following the nvidia doc to install the cuda and cudnn, then install the ONNX Runtime v1.17.1 release for me.

But when start my program, I am receive the error: Failed to load library libonnxruntime_providers_tensorrt.so with error: libcublas.so.11: cannot open shared object file: No such file or directory

I am search for this library and found the libcublas.so.12 only, and my cuda version is:cuda_12.4.r12.4, so could you please tell me how can I add support for Cuda 12.4?

Last drivers: Cuda 12.4 update 1 cudnn 9 tensorrt 10

sudo apt-get remove --purge '^nvidia-.*'
sudo apt remove nvidia-*
sudo apt purge '*nvidia*'
sudo apt autoremove -y
sudo apt-get update && sudo apt-get upgrade
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt-get update
sudo apt-get install -y nvidia-driver-550-open
sudo apt-get install -y cuda-drivers-550
sudo apt-get -y install cuda-toolkit
sudo apt-get -y install cudnn tensorrt nvidia-gds

Add PATH to .bashrc

sudo gedit ~/.bashrc
export PATH=/usr/local/cuda-12.4/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-12.4/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
source ~/.bashrc

In my case is not working compiling from source

tianleiwu commented 7 months ago

@Anivie see https://onnxruntime.ai/docs/install/

Try reinstall like the following:

pip3 install --force-reinstall --no-cache-dir onnxruntime-gpu --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/
Anivie commented 7 months ago

@Anivie see https://onnxruntime.ai/docs/install/

Try reinstall like the following:

pip3 install --force-reinstall --no-cache-dir onnxruntime-gpu --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/

Thank you for your response. I am currently attempting to follow your instructions to install the ONNX Runtime in Python, and ensuring that my environment exclusively contains this particular version, but the issue persists.

johnnynunez commented 6 months ago

I've the lastest commit for tensorRT, it is now compatible with 10.0.1? and with cuda 12.4? cudnn 9.1? In jetson agx Orin is not working the build

johnnynunez commented 6 months ago
2024-04-26 13:20:44,162 tools_python_utils [INFO] - flatbuffers module is not installed. parse_config will not be available
2024-04-26 13:20:46,135 build [DEBUG] - Command line arguments:
  --build_dir /home/johnny/Projects/onnxruntime/build/Linux --config Release --update --build --parallel --build_wheel --use_tensorrt --cuda_home /usr/local/cuda --cudnn_home /usr/lib/aarch64-linux-gnu --tensorrt_home /usr/lib/aarch64-linux-gnu
Namespace(build_dir='/home/johnny/Projects/onnxruntime/build/Linux', config=['Release'], update=True, build=True, clean=False, parallel=0, nvcc_threads=-1, test=False, skip_tests=False, compile_no_warning_as_error=False, enable_nvtx_profile=False, enable_memory_profile=False, enable_training=False, enable_training_apis=False, enable_training_ops=False, enable_nccl=False, mpi_home=None, nccl_home=None, use_mpi=False, enable_onnx_tests=False, path_to_protoc_exe=None, fuzz_testing=False, enable_symbolic_shape_infer_tests=False, gen_doc=None, gen_api_doc=False, use_cuda=False, cuda_version=None, cuda_home='/usr/local/cuda', cudnn_home='/usr/lib/aarch64-linux-gnu', enable_cuda_line_info=False, enable_cuda_nhwc_ops=False, enable_pybind=False, build_wheel=True, wheel_name_suffix=None, numpy_version=None, skip_keras_test=False, build_csharp=False, build_nuget=False, msbuild_extra_options=None, build_java=False, build_nodejs=False, build_objc=False, build_shared_lib=False, build_apple_framework=False, cmake_extra_defines=None, target=None, x86=False, rv64=False, arm=False, arm64=False, arm64ec=False, buildasx=False, riscv_toolchain_root='', riscv_qemu_path='', msvc_toolset=None, windows_sdk_version=None, android=False, android_abi='arm64-v8a', android_api=27, android_sdk_path='', android_ndk_path='', android_cpp_shared=False, android_run_emulator=False, use_gdk=False, gdk_edition='.', gdk_platform='Scarlett', ios=False, visionos=False, macos=None, apple_sysroot='', ios_toolchain_file='', visionos_toolchain_file='', xcode_code_signing_team_id='', xcode_code_signing_identity='', cmake_generator=None, osx_arch='x86_64', apple_deploy_target=None, enable_address_sanitizer=False, use_binskim_compliant_compile_flags=False, disable_memleak_checker=False, build_wasm=False, build_wasm_static_lib=False, emsdk_version='3.1.57', enable_wasm_simd=False, enable_wasm_threads=False, disable_wasm_exception_catching=False, enable_wasm_api_exception_catching=False, enable_wasm_exception_throwing_override=True, wasm_run_tests_in_browser=False, enable_wasm_profiling=False, enable_wasm_debug_info=False, wasm_malloc=None, emscripten_settings=None, use_extensions=False, extensions_overridden_path=None, cmake_path='cmake', ctest_path='ctest', skip_submodule_sync=False, use_mimalloc=False, use_dnnl=False, dnnl_gpu_runtime='', dnnl_opencl_root='', use_openvino=None, dnnl_aarch64_runtime='', dnnl_acl_root='', use_coreml=False, use_webnn=False, use_snpe=False, snpe_root=None, use_nnapi=False, nnapi_min_api=None, use_jsep=False, use_qnn=False, qnn_home=None, use_rknpu=False, use_preinstalled_eigen=False, eigen_path=None, enable_msinternal=False, llvm_path=None, use_vitisai=False, use_tvm=False, tvm_cuda_runtime=False, use_tvm_hash=False, use_tensorrt=True, use_tensorrt_builtin_parser=True, use_tensorrt_oss_parser=False, tensorrt_home='/usr/lib/aarch64-linux-gnu', test_all_timeout='10800', use_migraphx=False, migraphx_home=None, use_full_protobuf=False, llvm_config='', skip_onnx_tests=False, skip_winml_tests=False, skip_nodejs_tests=False, enable_msvc_static_runtime=False, enable_language_interop_ops=False, use_dml=False, dml_path='', use_winml=False, winml_root_namespace_override=None, dml_external_project=False, use_telemetry=False, enable_wcos=False, enable_lto=False, enable_transformers_tool_test=False, use_acl=None, acl_home=None, acl_libs=None, use_armnn=False, armnn_relu=False, armnn_bn=False, armnn_home=None, armnn_libs=None, build_micro_benchmarks=False, minimal_build=None, include_ops_by_config=None, enable_reduced_operator_type_support=False, disable_contrib_ops=False, disable_ml_ops=False, disable_rtti=False, disable_types=[], disable_exceptions=False, rocm_version=None, use_rocm=False, rocm_home=None, code_coverage=False, enable_lazy_tensor=False, ms_experimental=False, enable_external_custom_op_schemas=False, external_graph_transformer_path=None, enable_cuda_profiling=False, use_cann=False, cann_home=None, enable_rocm_profiling=False, use_xnnpack=False, use_azure=False, use_cache=False, use_triton_kernel=False, use_lock_free_queue=False, allow_running_as_root=False)
2024-04-26 13:20:46,144 build [INFO] - Build started
2024-04-26 13:20:46,144 build [INFO] - git submodule sync --recursive
Synchronizing submodule url for 'cmake/external/emsdk'
Synchronizing submodule url for 'cmake/external/libprotobuf-mutator'
Synchronizing submodule url for 'cmake/external/onnx'
Synchronizing submodule url for 'cmake/external/onnx/third_party/benchmark'
Synchronizing submodule url for 'cmake/external/onnx/third_party/pybind11'
2024-04-26 13:20:46,221 build [INFO] - git submodule update --init --recursive
2024-04-26 13:20:46,396 build [INFO] - Generating CMake build tree
nvcc_threads=1 to ensure memory per thread >= 4GB for available_memory=46890475520 and fmha_parallel_jobs=12
2024-04-26 13:20:46,432 build [INFO] - /home/johnny/miniconda3/envs/py311/bin/cmake /home/johnny/Projects/onnxruntime/cmake -Donnxruntime_RUN_ONNX_TESTS=OFF -Donnxruntime_GENERATE_TEST_REPORTS=ON -DPython_EXECUTABLE=/home/johnny/miniconda3/envs/py311/bin/python3 -DPYTHON_EXECUTABLE=/home/johnny/miniconda3/envs/py311/bin/python3 -Donnxruntime_USE_MIMALLOC=OFF -Donnxruntime_ENABLE_PYTHON=ON -Donnxruntime_BUILD_CSHARP=OFF -Donnxruntime_BUILD_JAVA=OFF -Donnxruntime_BUILD_NODEJS=OFF -Donnxruntime_BUILD_OBJC=OFF -Donnxruntime_BUILD_SHARED_LIB=OFF -Donnxruntime_BUILD_APPLE_FRAMEWORK=OFF -Donnxruntime_USE_DNNL=OFF -Donnxruntime_USE_NNAPI_BUILTIN=OFF -Donnxruntime_USE_RKNPU=OFF -Donnxruntime_USE_LLVM=OFF -Donnxruntime_ENABLE_MICROSOFT_INTERNAL=OFF -Donnxruntime_USE_VITISAI=OFF -Donnxruntime_USE_TENSORRT=ON -Donnxruntime_USE_TENSORRT_BUILTIN_PARSER=ON -Donnxruntime_USE_TVM=OFF -Donnxruntime_TVM_CUDA_RUNTIME=OFF -Donnxruntime_TVM_USE_HASH=OFF -Donnxruntime_USE_MIGRAPHX=OFF -Donnxruntime_DISABLE_CONTRIB_OPS=OFF -Donnxruntime_DISABLE_ML_OPS=OFF -Donnxruntime_DISABLE_RTTI=OFF -Donnxruntime_DISABLE_EXCEPTIONS=OFF -Donnxruntime_MINIMAL_BUILD=OFF -Donnxruntime_EXTENDED_MINIMAL_BUILD=OFF -Donnxruntime_MINIMAL_BUILD_CUSTOM_OPS=OFF -Donnxruntime_REDUCED_OPS_BUILD=OFF -Donnxruntime_ENABLE_LANGUAGE_INTEROP_OPS=OFF -Donnxruntime_USE_DML=OFF -Donnxruntime_USE_WINML=OFF -Donnxruntime_BUILD_MS_EXPERIMENTAL_OPS=OFF -Donnxruntime_USE_TELEMETRY=OFF -Donnxruntime_ENABLE_LTO=OFF -Donnxruntime_USE_ACL=OFF -Donnxruntime_USE_ACL_1902=OFF -Donnxruntime_USE_ACL_1905=OFF -Donnxruntime_USE_ACL_1908=OFF -Donnxruntime_USE_ACL_2002=OFF -Donnxruntime_USE_ACL_2308=OFF -Donnxruntime_USE_ARMNN=OFF -Donnxruntime_ARMNN_RELU_USE_CPU=ON -Donnxruntime_ARMNN_BN_USE_CPU=ON -Donnxruntime_USE_JSEP=OFF -Donnxruntime_ENABLE_NVTX_PROFILE=OFF -Donnxruntime_ENABLE_TRAINING=OFF -Donnxruntime_ENABLE_TRAINING_OPS=OFF -Donnxruntime_ENABLE_TRAINING_APIS=OFF -Donnxruntime_ENABLE_CPU_FP16_OPS=OFF -Donnxruntime_USE_NCCL=OFF -Donnxruntime_BUILD_BENCHMARKS=OFF -Donnxruntime_USE_ROCM=OFF -DOnnxruntime_GCOV_COVERAGE=OFF -Donnxruntime_USE_MPI=OFF -Donnxruntime_ENABLE_MEMORY_PROFILE=OFF -Donnxruntime_ENABLE_CUDA_LINE_NUMBER_INFO=OFF -Donnxruntime_USE_CUDA_NHWC_OPS=OFF -Donnxruntime_BUILD_WEBASSEMBLY_STATIC_LIB=OFF -Donnxruntime_ENABLE_WEBASSEMBLY_EXCEPTION_CATCHING=ON -Donnxruntime_ENABLE_WEBASSEMBLY_API_EXCEPTION_CATCHING=OFF -Donnxruntime_ENABLE_WEBASSEMBLY_EXCEPTION_THROWING=ON -Donnxruntime_WEBASSEMBLY_RUN_TESTS_IN_BROWSER=OFF -Donnxruntime_ENABLE_WEBASSEMBLY_THREADS=OFF -Donnxruntime_ENABLE_WEBASSEMBLY_DEBUG_INFO=OFF -Donnxruntime_ENABLE_WEBASSEMBLY_PROFILING=OFF -Donnxruntime_ENABLE_LAZY_TENSOR=OFF -Donnxruntime_ENABLE_EXTERNAL_CUSTOM_OP_SCHEMAS=OFF -Donnxruntime_ENABLE_CUDA_PROFILING=OFF -Donnxruntime_ENABLE_ROCM_PROFILING=OFF -Donnxruntime_USE_XNNPACK=OFF -Donnxruntime_USE_WEBNN=OFF -Donnxruntime_USE_CANN=OFF -Donnxruntime_USE_TRITON_KERNEL=OFF -Donnxruntime_DISABLE_FLOAT8_TYPES=OFF -Donnxruntime_DISABLE_SPARSE_TENSORS=OFF -Donnxruntime_DISABLE_OPTIONAL_TYPE=OFF -Donnxruntime_NVCC_THREADS=1 -Donnxruntime_TENSORRT_HOME=/usr/lib/aarch64-linux-gnu -DCUDA_CUDA_LIBRARY=/usr/local/cuda/lib64/stubs -DCMAKE_TLS_VERIFY=ON -DFETCHCONTENT_QUIET=OFF -Donnxruntime_USE_CUDA=ON -Donnxruntime_CUDA_HOME=/usr/local/cuda -Donnxruntime_CUDNN_HOME=/usr/lib/aarch64-linux-gnu -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/home/johnny/Projects/onnxruntime/build/Linux/Release/installed
CMake Deprecation Warning at CMakeLists.txt:14 (cmake_policy):
  The OLD behavior for policy CMP0104 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.

F16C instruction set is not supported.
FMA instruction set is not supported.
AVX instruction set is not supported.
One or more AVX/F16C instruction flags are not supported. 
Building ONNX Runtime for aarch64 CPU ARCH
Patch found: /usr/bin/patch
Loading Dependencies URLs ...
Loading Dependencies ...
-- Populating abseil_cpp
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: /home/johnny/Projects/onnxruntime/build/Linux/Release/_deps/abseil_cpp-subbuild
[100%] Built target abseil_cpp-populate
-- Abseil source dir:/home/johnny/Projects/onnxruntime/build/Linux/Release/_deps/abseil_cpp-src
-- Populating date
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: /home/johnny/Projects/onnxruntime/build/Linux/Release/_deps/date-subbuild
[100%] Built target date-populate
-- Populating google_nsync
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: /home/johnny/Projects/onnxruntime/build/Linux/Release/_deps/google_nsync-subbuild
[100%] Built target google_nsync-populate
-- Populating safeint
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: /home/johnny/Projects/onnxruntime/build/Linux/Release/_deps/safeint-subbuild
[100%] Built target safeint-populate
-- Populating utf8_range
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: /home/johnny/Projects/onnxruntime/build/Linux/Release/_deps/utf8_range-subbuild
[100%] Built target utf8_range-populate
-- Populating protobuf
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: /home/johnny/Projects/onnxruntime/build/Linux/Release/_deps/protobuf-subbuild
[100%] Built target protobuf-populate
-- 
-- 3.21.12.0
-- Populating nlohmann_json
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: /home/johnny/Projects/onnxruntime/build/Linux/Release/_deps/nlohmann_json-subbuild
[100%] Built target nlohmann_json-populate
-- Using the single-header code from /home/johnny/Projects/onnxruntime/build/Linux/Release/_deps/nlohmann_json-src/single_include/
-- Populating mp11
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: /home/johnny/Projects/onnxruntime/build/Linux/Release/_deps/mp11-subbuild
[100%] Built target mp11-populate
-- Populating re2
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: /home/johnny/Projects/onnxruntime/build/Linux/Release/_deps/re2-subbuild
[100%] Built target re2-populate
-- Populating gsl
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: /home/johnny/Projects/onnxruntime/build/Linux/Release/_deps/gsl-subbuild
[100%] Built target gsl-populate
-- Populating flatbuffers
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: /home/johnny/Projects/onnxruntime/build/Linux/Release/_deps/flatbuffers-subbuild
[100%] Built target flatbuffers-populate
-- Proceeding with version: 23.5.26.0
-- CMAKE_CXX_FLAGS:  -ffunction-sections -fdata-sections -Wno-restrict  -DCPUINFO_SUPPORTED
-- Populating pytorch_cpuinfo
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: /home/johnny/Projects/onnxruntime/build/Linux/Release/_deps/pytorch_cpuinfo-subbuild
[100%] Built target pytorch_cpuinfo-populate
-- Populating pytorch_clog
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: /home/johnny/Projects/onnxruntime/build/Linux/Release/_deps/pytorch_clog-subbuild
[100%] Built target pytorch_clog-populate
-- Populating googletest
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: /home/johnny/Projects/onnxruntime/build/Linux/Release/_deps/googletest-subbuild
[100%] Built target googletest-populate
-- Populating eigen
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: /home/johnny/Projects/onnxruntime/build/Linux/Release/_deps/eigen-subbuild
[100%] Built target eigen-populate
-- Populating onnx
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: /home/johnny/Projects/onnxruntime/build/Linux/Release/_deps/onnx-subbuild
[100%] Built target onnx-populate
Generated: /home/johnny/Projects/onnxruntime/build/Linux/Release/_deps/onnx-build/onnx/onnx-ml.proto
Generated: /home/johnny/Projects/onnxruntime/build/Linux/Release/_deps/onnx-build/onnx/onnx-operators-ml.proto
Generated: /home/johnny/Projects/onnxruntime/build/Linux/Release/_deps/onnx-build/onnx/onnx-data.proto
-- 
-- ******** Summary ********
--   CMake version                     : 3.26.4
--   CMake command                     : /home/johnny/miniconda3/envs/py311/bin/cmake
--   System                            : Linux
--   C++ compiler                      : /usr/lib/ccache/c++
--   C++ compiler version              : 11.4.0
--   CXX flags                         :  -ffunction-sections -fdata-sections -Wno-restrict  -DCPUINFO_SUPPORTED -Wnon-virtual-dtor
--   Build type                        : Release
--   Compile definitions               : ORT_ENABLE_STREAM;EIGEN_MPL2_ONLY;_GNU_SOURCE;__STDC_FORMAT_MACROS
--   CMAKE_PREFIX_PATH                 : /home/johnny/Projects/onnxruntime/build/Linux/Release/installed
--   CMAKE_INSTALL_PREFIX              : /usr/local
--   CMAKE_MODULE_PATH                 : /home/johnny/Projects/onnxruntime/cmake/external
-- 
--   ONNX version                      : 1.16.0
--   ONNX NAMESPACE                    : onnx
--   ONNX_USE_LITE_PROTO               : ON
--   USE_PROTOBUF_SHARED_LIBS          : OFF
--   Protobuf_USE_STATIC_LIBS          : ON
--   ONNX_DISABLE_EXCEPTIONS           : OFF
--   ONNX_DISABLE_STATIC_REGISTRATION  : OFF
--   ONNX_WERROR                       : OFF
--   ONNX_BUILD_TESTS                  : OFF
--   ONNX_BUILD_BENCHMARKS             : OFF
--   ONNX_BUILD_SHARED_LIBS            : 
--   BUILD_SHARED_LIBS                 : OFF
-- 
--   Protobuf compiler                 : 
--   Protobuf includes                 : 
--   Protobuf libraries                : 
--   BUILD_ONNX_PYTHON                 : OFF
Finished fetching external dependencies
-- Found CUDAToolkit: /usr/local/cuda/include (found version "12.4.131") 
NVCC_ERROR = nvcc fatal   : Unknown option '-Wstrict-aliasing'

NVCC_OUT = 1
-- CMAKE_CUDA_COMPILER_VERSION: 12.4.131
-- Enable flash attention for CUDA EP
-- Enable memory efficient attention for CUDA EP
-- Found CUDAToolkit: /usr/local/cuda/include (found version "12.4.131") 
CMake Warning at CMakeLists.txt:1618 (message):
  MPI and NCCL are disabled because build is on Windows or USE_NCCL is set to
  OFF.

-- Python Build is enabled
-- Populating cutlass
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: /home/johnny/Projects/onnxruntime/build/Linux/Release/_deps/cutlass-subbuild
[100%] Built target cutlass-populate
-- Search for nvinfer, nvinfer_plugin and nvonnxparser
-- Find TensorRT libs at /usr/lib/aarch64-linux-gnu/libnvinfer.so;/usr/lib/aarch64-linux-gnu/libnvinfer_plugin.so;/usr/lib/aarch64-linux-gnu/libnvonnxparser.so
-- Populating pybind11_project
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: /home/johnny/Projects/onnxruntime/build/Linux/Release/_deps/pybind11_project-subbuild
[100%] Built target pybind11_project-populate
-- pybind11 v2.10.1 
-- Configuring done (4.6s)
-- Generating done (0.9s)
CMake Warning:
  Manually-specified variables were not used by the project:

    CUDA_CUDA_LIBRARY

-- Build files have been written to: /home/johnny/Projects/onnxruntime/build/Linux/Release
2024-04-26 13:20:52,242 build [INFO] - Building targets for Release configuration
2024-04-26 13:20:52,243 build [INFO] - /home/johnny/miniconda3/envs/py311/bin/cmake --build /home/johnny/Projects/onnxruntime/build/Linux/Release --config Release -- -j12
[  0%] Built target absl_flags_commandlineflag_internal
[  0%] Built target absl_log_severity
[  0%] Built target absl_int128
[  0%] Built target absl_spinlock_wait
[  0%] Built target absl_exponential_biased
[  1%] Built target flatbuffers
[  1%] Built target absl_civil_time
[  2%] Built target absl_time_zone
[  2%] Built target onnxruntime_providers_shared
[  2%] Built target custom_op_invalid_library
[  2%] Built target clog
[  2%] Built target custom_op_library
[  2%] Building CXX object CMakeFiles/onnxruntime_mlas.dir/home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/platform.cpp.o
[  2%] Building CXX object CMakeFiles/onnxruntime_mlas.dir/home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/threading.cpp.o
[  2%] Building CXX object CMakeFiles/onnxruntime_mlas.dir/home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/sgemm.cpp.o
[  3%] Built target cpuinfo
[  3%] Built target custom_op_get_const_input_test_library
[  4%] Building CXX object CMakeFiles/onnxruntime_mlas.dir/home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/halfgemm.cpp.o
[  4%] Built target absl_raw_logging_internal
[  4%] Built target custom_op_local_function
[  5%] Built target libprotobuf-lite
[  6%] Built target re2
[  7%] Built target nsync_cpp
[  7%] Building CXX object CMakeFiles/onnxruntime_mlas.dir/home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/qgemm.cpp.o
[  8%] Built target flatc
[  8%] Building CXX object CMakeFiles/onnxruntime_mlas.dir/home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/qdwconv.cpp.o
[  8%] Built target absl_throw_delegate
[  8%] Built target absl_base
[  8%] Built target absl_bad_variant_access
[  8%] Built target absl_debugging_internal
[  8%] Building CXX object CMakeFiles/onnxruntime_mlas.dir/home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/convolve.cpp.o
[  8%] Built target absl_bad_optional_access
[  8%] Building CXX object CMakeFiles/onnxruntime_mlas.dir/home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/convsym.cpp.o
[  8%] Built target absl_cordz_functions
[  8%] Built target absl_malloc_internal
[  8%] Built target absl_bad_any_cast_impl
[  8%] Building CXX object CMakeFiles/onnxruntime_mlas.dir/home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/pooling.cpp.o
[  8%] Built target absl_stacktrace
[  8%] Built target absl_strings_internal
[  8%] Built target absl_demangle_internal
[ 12%] Built target libprotobuf
[ 12%] Built target absl_string_view
[ 12%] Building CXX object CMakeFiles/onnxruntime_mlas.dir/home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/transpose.cpp.o
[ 13%] Built target absl_graphcycles_internal
[ 13%] Built target absl_city
[ 13%] Built target absl_low_level_hash
[ 13%] Building CXX object CMakeFiles/onnxruntime_mlas.dir/home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/reorder.cpp.o
[ 13%] Built target absl_crc_cpu_detect
[ 18%] Built target libprotoc
[ 19%] Built target absl_strings
[ 19%] Built target absl_crc_internal
[ 19%] Building CXX object _deps/abseil_cpp-build/absl/strings/CMakeFiles/absl_str_format_internal.dir/internal/str_format/arg.cc.o
In file included from /home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/mlasi.h:161,
                 from /home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/platform.cpp:18:
/home/johnny/Projects/onnxruntime/onnxruntime/core/common/cpuid_info.h:126:52: error: ‘maybe_unused’ attribute ignored [-Werror=attributes]
  126 |   [[maybe_unused]] bool pytorch_cpuinfo_init_{false};
      |                                                    ^
cc1plus: all warnings being treated as errors
gmake[2]: *** [CMakeFiles/onnxruntime_mlas.dir/build.make:76: CMakeFiles/onnxruntime_mlas.dir/home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/platform.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
[ 19%] Building CXX object _deps/abseil_cpp-build/absl/strings/CMakeFiles/absl_str_format_internal.dir/internal/str_format/bind.cc.o
In file included from /home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/mlasi.h:161,
                 from /home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/threading.cpp:17:
/home/johnny/Projects/onnxruntime/onnxruntime/core/common/cpuid_info.h:126:52: error: ‘maybe_unused’ attribute ignored [-Werror=attributes]
  126 |   [[maybe_unused]] bool pytorch_cpuinfo_init_{false};
      |                                                    ^
cc1plus: all warnings being treated as errors
gmake[2]: *** [CMakeFiles/onnxruntime_mlas.dir/build.make:90: CMakeFiles/onnxruntime_mlas.dir/home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/threading.cpp.o] Error 1
[ 19%] Building CXX object _deps/abseil_cpp-build/absl/strings/CMakeFiles/absl_str_format_internal.dir/internal/str_format/extension.cc.o
In file included from /home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/mlasi.h:161,
                 from /home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/qdwconv.cpp:17:
/home/johnny/Projects/onnxruntime/onnxruntime/core/common/cpuid_info.h:126:52: error: ‘maybe_unused’ attribute ignored [-Werror=attributes]
  126 |   [[maybe_unused]] bool pytorch_cpuinfo_init_{false};
      |                                                    ^
cc1plus: all warnings being treated as errors
gmake[2]: *** [CMakeFiles/onnxruntime_mlas.dir/build.make:146: CMakeFiles/onnxruntime_mlas.dir/home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/qdwconv.cpp.o] Error 1
[ 19%] Building CXX object _deps/abseil_cpp-build/absl/strings/CMakeFiles/absl_str_format_internal.dir/internal/str_format/float_conversion.cc.o
In file included from /home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/mlasi.h:161,
                 from /home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/convolve.cpp:17:
/home/johnny/Projects/onnxruntime/onnxruntime/core/common/cpuid_info.h:126:52: error: ‘maybe_unused’ attribute ignored [-Werror=attributes]
  126 |   [[maybe_unused]] bool pytorch_cpuinfo_init_{false};
      |                                                    ^
cc1plus: all warnings being treated as errors
gmake[2]: *** [CMakeFiles/onnxruntime_mlas.dir/build.make:160: CMakeFiles/onnxruntime_mlas.dir/home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/convolve.cpp.o] Error 1
[ 19%] Building CXX object _deps/abseil_cpp-build/absl/strings/CMakeFiles/absl_str_format_internal.dir/internal/str_format/output.cc.o
In file included from /home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/mlasi.h:161,
                 from /home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/convsym.cpp:18:
/home/johnny/Projects/onnxruntime/onnxruntime/core/common/cpuid_info.h:126:52: error: ‘maybe_unused’ attribute ignored [-Werror=attributes]
  126 |   [[maybe_unused]] bool pytorch_cpuinfo_init_{false};
      |                                                    ^
cc1plus: all warnings being treated as errors
gmake[2]: *** [CMakeFiles/onnxruntime_mlas.dir/build.make:174: CMakeFiles/onnxruntime_mlas.dir/home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/convsym.cpp.o] Error 1
[ 19%] Building CXX object _deps/abseil_cpp-build/absl/strings/CMakeFiles/absl_str_format_internal.dir/internal/str_format/parser.cc.o
In file included from /home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/mlasi.h:161,
                 from /home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/qgemm.cpp:18:
/home/johnny/Projects/onnxruntime/onnxruntime/core/common/cpuid_info.h:126:52: error: ‘maybe_unused’ attribute ignored [-Werror=attributes]
  126 |   [[maybe_unused]] bool pytorch_cpuinfo_init_{false};
      |                                                    ^
cc1plus: all warnings being treated as errors
gmake[2]: *** [CMakeFiles/onnxruntime_mlas.dir/build.make:132: CMakeFiles/onnxruntime_mlas.dir/home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/qgemm.cpp.o] Error 1
In file included from /home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/mlasi.h:161,
                 from /home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/transpose.cpp:17:
/home/johnny/Projects/onnxruntime/onnxruntime/core/common/cpuid_info.h:126:52: error: ‘maybe_unused’ attribute ignored [-Werror=attributes]
  126 |   [[maybe_unused]] bool pytorch_cpuinfo_init_{false};
      |                                                    ^
cc1plus: all warnings being treated as errors
gmake[2]: *** [CMakeFiles/onnxruntime_mlas.dir/build.make:202: CMakeFiles/onnxruntime_mlas.dir/home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/transpose.cpp.o] Error 1
[ 19%] Building CXX object _deps/abseil_cpp-build/absl/flags/CMakeFiles/absl_flags_commandlineflag.dir/commandlineflag.cc.o
In file included from /home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/mlasi.h:161,
                 from /home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/sgemm.cpp:18:
/home/johnny/Projects/onnxruntime/onnxruntime/core/common/cpuid_info.h:126:52: error: ‘maybe_unused’ attribute ignored [-Werror=attributes]
  126 |   [[maybe_unused]] bool pytorch_cpuinfo_init_{false};
      |                                                    ^
cc1plus: all warnings being treated as errors
gmake[2]: *** [CMakeFiles/onnxruntime_mlas.dir/build.make:104: CMakeFiles/onnxruntime_mlas.dir/home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/sgemm.cpp.o] Error 1
In file included from /home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/mlasi.h:161,
                 from /home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/reorder.cpp:19:
/home/johnny/Projects/onnxruntime/onnxruntime/core/common/cpuid_info.h:126:52: error: ‘maybe_unused’ attribute ignored [-Werror=attributes]
  126 |   [[maybe_unused]] bool pytorch_cpuinfo_init_{false};
      |                                                    ^
cc1plus: all warnings being treated as errors
gmake[2]: *** [CMakeFiles/onnxruntime_mlas.dir/build.make:216: CMakeFiles/onnxruntime_mlas.dir/home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/reorder.cpp.o] Error 1
In file included from /home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/mlasi.h:161,
                 from /home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/halfgemm.cpp:18:
/home/johnny/Projects/onnxruntime/onnxruntime/core/common/cpuid_info.h:126:52: error: ‘maybe_unused’ attribute ignored [-Werror=attributes]
  126 |   [[maybe_unused]] bool pytorch_cpuinfo_init_{false};
      |                                                    ^
cc1plus: all warnings being treated as errors
gmake[2]: *** [CMakeFiles/onnxruntime_mlas.dir/build.make:118: CMakeFiles/onnxruntime_mlas.dir/home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/halfgemm.cpp.o] Error 1
In file included from /home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/mlasi.h:161,
                 from /home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/pooling.cpp:17:
/home/johnny/Projects/onnxruntime/onnxruntime/core/common/cpuid_info.h:126:52: error: ‘maybe_unused’ attribute ignored [-Werror=attributes]
  126 |   [[maybe_unused]] bool pytorch_cpuinfo_init_{false};
      |                                                    ^
cc1plus: all warnings being treated as errors
gmake[2]: *** [CMakeFiles/onnxruntime_mlas.dir/build.make:188: CMakeFiles/onnxruntime_mlas.dir/home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/pooling.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:1832: CMakeFiles/onnxruntime_mlas.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
[ 20%] Linking CXX static library libabsl_flags_commandlineflag.a
[ 20%] Built target absl_flags_commandlineflag
[ 20%] Linking CXX static library libabsl_str_format_internal.a
[ 20%] Built target absl_str_format_internal
gmake: *** [Makefile:146: all] Error 2
Traceback (most recent call last):
  File "/home/johnny/Projects/onnxruntime/tools/ci_build/build.py", line 2962, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/johnny/Projects/onnxruntime/tools/ci_build/build.py", line 2854, in main
    build_targets(args, cmake_path, build_dir, configs, num_parallel_jobs, args.target)
  File "/home/johnny/Projects/onnxruntime/tools/ci_build/build.py", line 1743, in build_targets
    run_subprocess(cmd_args, env=env)
  File "/home/johnny/Projects/onnxruntime/tools/ci_build/build.py", line 861, in run_subprocess
    return run(*args, cwd=cwd, capture_stdout=capture_stdout, shell=shell, env=my_env)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/johnny/Projects/onnxruntime/tools/python/util/run.py", line 49, in run
    completed_process = subprocess.run(
                        ^^^^^^^^^^^^^^^
  File "/home/johnny/miniconda3/envs/py311/lib/python3.11/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/home/johnny/miniconda3/envs/py311/bin/cmake', '--build', '/home/johnny/Projects/onnxruntime/build/Linux/Release', '--config', 'Release', '--', '-j12']' returned non-zero exit status 2.
tianleiwu commented 6 months ago

@johnnynunez, maybe_unused need a compiler supporting c++17. Try upgrade your compiler or switch to latest gcc.

johnnynunez commented 6 months ago

how? @tianleiwu

./build.sh --config Release --update --parallel --build --build_wheel --build_shared_lib \
        --skip_tests \
        --cmake_extra_defines CMAKE_CXX_FLAGS="-Wno-unused-variable -I/usr/local/cuda-12.4/include" \
        --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES="8.7" \
        --cmake_extra_defines onnxruntime_BUILD_UNIT_TESTS=OFF \
        --cmake_extra_defines CMAKE_CXX_STANDARD=17 \
        --cuda_home /usr/local/cuda-12.4 --cudnn_home /usr/lib/$(uname -m)-linux-gnu \
        --use_tensorrt --tensorrt_home /usr/lib/$(uname -m)-linux-gnu
NVCC_OUT = 1
-- CMAKE_CUDA_COMPILER_VERSION: 12.4.131
-- Enable flash attention for CUDA EP
-- Enable memory efficient attention for CUDA EP
CMake Warning at CMakeLists.txt:1618 (message):
  MPI and NCCL are disabled because build is on Windows or USE_NCCL is set to
  OFF.

-- Python Build is enabled
-- Populating cutlass
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: /home/johnny/Projects/onnxruntime/build/Linux/Release/_deps/cutlass-subbuild
[100%] Built target cutlass-populate
-- Search for nvinfer, nvinfer_plugin and nvonnxparser
-- Find TensorRT libs at /usr/lib/aarch64-linux-gnu/libnvinfer.so;/usr/lib/aarch64-linux-gnu/libnvinfer_plugin.so;/usr/lib/aarch64-linux-gnu/libnvonnxparser.so
-- Populating pybind11_project
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: /home/johnny/Projects/onnxruntime/build/Linux/Release/_deps/pybind11_project-subbuild
[100%] Built target pybind11_project-populate
CMake Deprecation Warning at /home/johnny/Projects/onnxruntime/build/Linux/Release/_deps/pybind11_project-src/CMakeLists.txt:8 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

-- pybind11 v2.10.1 
-- Configuring done (3.4s)
-- Generating done (0.6s)
-- Build files have been written to: /home/johnny/Projects/onnxruntime/build/Linux/Release
2024-04-27 20:59:09,662 build [INFO] - Building targets for Release configuration
2024-04-27 20:59:09,662 build [INFO] - /usr/local/bin/cmake --build /home/johnny/Projects/onnxruntime/build/Linux/Release --config Release -- -j12
[  0%] Built target absl_spinlock_wait
[  0%] Built target absl_flags_commandlineflag_internal
[  0%] Built target absl_exponential_biased
[  0%] Built target absl_log_severity
[  0%] Built target absl_int128
[  0%] Built target absl_civil_time
[  0%] Built target flatbuffers
[  0%] Built target absl_time_zone
[  0%] Generating onnxruntime.lds, generated_source.c
[  0%] Building CXX object CMakeFiles/onnxruntime_providers_shared.dir/home/johnny/Projects/onnxruntime/onnxruntime/core/providers/shared/common.cc.o
[  0%] Built target clog
[  1%] Built target cpuinfo
[  1%] Building CXX object _deps/abseil_cpp-build/absl/base/CMakeFiles/absl_raw_logging_internal.dir/internal/raw_logging.cc.o
[  1%] Building CXX object CMakeFiles/onnxruntime_mlas.dir/home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/platform.cpp.o
[  1%] Building CXX object CMakeFiles/onnxruntime_mlas.dir/home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/threading.cpp.o
[  1%] Building CXX object CMakeFiles/onnxruntime_mlas.dir/home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/sgemm.cpp.o
[  1%] Building CXX object CMakeFiles/onnxruntime_mlas.dir/home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/halfgemm.cpp.o
[  1%] Building CXX object _deps/re2-build/CMakeFiles/re2.dir/re2/bitstate.cc.o
[  3%] Built target nsync_cpp
[  5%] Built target libprotobuf-lite
Generating symbol file for ['cpu', 'cuda', 'tensorrt']
VERSION:1.18.0
[  5%] Building CXX object _deps/re2-build/CMakeFiles/re2.dir/re2/compile.cc.o
[  5%] Building CXX object CMakeFiles/onnxruntime_mlas.dir/home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/qgemm.cpp.o
[  7%] Built target flatc
[  7%] Building CXX object _deps/re2-build/CMakeFiles/re2.dir/re2/dfa.cc.o
[  7%] Linking CXX shared library libonnxruntime_providers_shared.so
[  7%] Built target onnxruntime_generate_def
[  7%] Building CXX object CMakeFiles/onnxruntime_mlas.dir/home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/qdwconv.cpp.o
[ 13%] Built target libprotobuf
[ 13%] Building CXX object _deps/re2-build/CMakeFiles/re2.dir/re2/filtered_re2.cc.o
[ 13%] Built target onnxruntime_providers_shared
[ 13%] Building CXX object CMakeFiles/onnxruntime_mlas.dir/home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/convolve.cpp.o
[ 13%] Linking CXX static library libabsl_raw_logging_internal.a
[ 13%] Built target absl_raw_logging_internal
[ 13%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/code_generator.cc.o
[ 13%] Building CXX object _deps/re2-build/CMakeFiles/re2.dir/re2/mimics_pcre.cc.o
[ 13%] Building CXX object _deps/re2-build/CMakeFiles/re2.dir/re2/nfa.cc.o
In file included from /home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/mlasi.h:161,
                 from /home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/platform.cpp:18:
/home/johnny/Projects/onnxruntime/onnxruntime/core/common/cpuid_info.h:126:52: error: ‘maybe_unused’ attribute ignored [-Werror=attributes]
  126 |   [[maybe_unused]] bool pytorch_cpuinfo_init_{false};
      |                                                    ^
cc1plus: all warnings being treated as errors
gmake[2]: *** [CMakeFiles/onnxruntime_mlas.dir/build.make:76: CMakeFiles/onnxruntime_mlas.dir/home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/platform.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
[ 13%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/command_line_interface.cc.o
In file included from /home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/mlasi.h:161,
                 from /home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/threading.cpp:17:
/home/johnny/Projects/onnxruntime/onnxruntime/core/common/cpuid_info.h:126:52: error: ‘maybe_unused’ attribute ignored [-Werror=attributes]
  126 |   [[maybe_unused]] bool pytorch_cpuinfo_init_{false};
      |                                                    ^
cc1plus: all warnings being treated as errors
gmake[2]: *** [CMakeFiles/onnxruntime_mlas.dir/build.make:90: CMakeFiles/onnxruntime_mlas.dir/home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/threading.cpp.o] Error 1
[ 13%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/cpp/enum.cc.o
In file included from /home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/mlasi.h:161,
                 from /home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/qdwconv.cpp:17:
/home/johnny/Projects/onnxruntime/onnxruntime/core/common/cpuid_info.h:126:52: error: ‘maybe_unused’ attribute ignored [-Werror=attributes]
  126 |   [[maybe_unused]] bool pytorch_cpuinfo_init_{false};
      |                                                    ^
cc1plus: all warnings being treated as errors
gmake[2]: *** [CMakeFiles/onnxruntime_mlas.dir/build.make:146: CMakeFiles/onnxruntime_mlas.dir/home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/qdwconv.cpp.o] Error 1
[ 13%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/cpp/enum_field.cc.o
In file included from /home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/mlasi.h:161,
                 from /home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/halfgemm.cpp:18:
/home/johnny/Projects/onnxruntime/onnxruntime/core/common/cpuid_info.h:126:52: error: ‘maybe_unused’ attribute ignored [-Werror=attributes]
  126 |   [[maybe_unused]] bool pytorch_cpuinfo_init_{false};
      |                                                    ^
cc1plus: all warnings being treated as errors
gmake[2]: *** [CMakeFiles/onnxruntime_mlas.dir/build.make:118: CMakeFiles/onnxruntime_mlas.dir/home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/halfgemm.cpp.o] Error 1
[ 13%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/cpp/extension.cc.o
In file included from /home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/mlasi.h:161,
                 from /home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/convolve.cpp:17:
/home/johnny/Projects/onnxruntime/onnxruntime/core/common/cpuid_info.h:126:52: error: ‘maybe_unused’ attribute ignored [-Werror=attributes]
  126 |   [[maybe_unused]] bool pytorch_cpuinfo_init_{false};
      |                                                    ^
cc1plus: all warnings being treated as errors
gmake[2]: *** [CMakeFiles/onnxruntime_mlas.dir/build.make:160: CMakeFiles/onnxruntime_mlas.dir/home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/convolve.cpp.o] Error 1
[ 13%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/cpp/field.cc.o
[ 13%] Building CXX object _deps/re2-build/CMakeFiles/re2.dir/re2/onepass.cc.o
In file included from /home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/mlasi.h:161,
                 from /home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/qgemm.cpp:18:
/home/johnny/Projects/onnxruntime/onnxruntime/core/common/cpuid_info.h:126:52: error: ‘maybe_unused’ attribute ignored [-Werror=attributes]
  126 |   [[maybe_unused]] bool pytorch_cpuinfo_init_{false};
      |                                                    ^
cc1plus: all warnings being treated as errors
gmake[2]: *** [CMakeFiles/onnxruntime_mlas.dir/build.make:132: CMakeFiles/onnxruntime_mlas.dir/home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/qgemm.cpp.o] Error 1
In file included from /home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/mlasi.h:161,
                 from /home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/sgemm.cpp:18:
/home/johnny/Projects/onnxruntime/onnxruntime/core/common/cpuid_info.h:126:52: error: ‘maybe_unused’ attribute ignored [-Werror=attributes]
  126 |   [[maybe_unused]] bool pytorch_cpuinfo_init_{false};
      |                                                    ^
cc1plus: all warnings being treated as errors
gmake[2]: *** [CMakeFiles/onnxruntime_mlas.dir/build.make:104: CMakeFiles/onnxruntime_mlas.dir/home/johnny/Projects/onnxruntime/onnxruntime/core/mlas/lib/sgemm.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:1760: CMakeFiles/onnxruntime_mlas.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
[ 13%] Building CXX object _deps/abseil_cpp-build/absl/base/CMakeFiles/absl_base.dir/internal/cycleclock.cc.o
[ 13%] Building CXX object _deps/abseil_cpp-build/absl/base/CMakeFiles/absl_base.dir/internal/spinlock.cc.o
[ 13%] Building CXX object _deps/abseil_cpp-build/absl/base/CMakeFiles/absl_base.dir/internal/sysinfo.cc.o
[ 13%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/cpp/file.cc.o
[ 13%] Building CXX object _deps/re2-build/CMakeFiles/re2.dir/re2/parse.cc.o
[ 13%] Building CXX object _deps/abseil_cpp-build/absl/base/CMakeFiles/absl_base.dir/internal/thread_identity.cc.o
[ 13%] Building CXX object _deps/re2-build/CMakeFiles/re2.dir/re2/perl_groups.cc.o
[ 13%] Building CXX object _deps/re2-build/CMakeFiles/re2.dir/re2/prefilter.cc.o
[ 13%] Building CXX object _deps/re2-build/CMakeFiles/re2.dir/re2/prefilter_tree.cc.o
[ 13%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/cpp/generator.cc.o
[ 13%] Building CXX object _deps/re2-build/CMakeFiles/re2.dir/re2/prog.cc.o
[ 13%] Building CXX object _deps/abseil_cpp-build/absl/base/CMakeFiles/absl_base.dir/internal/unscaledcycleclock.cc.o
[ 13%] Linking CXX static library libabsl_base.a
[ 13%] Built target absl_base
[ 14%] Building CXX object _deps/re2-build/CMakeFiles/re2.dir/re2/re2.cc.o
[ 14%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/cpp/helpers.cc.o
[ 14%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/cpp/map_field.cc.o
[ 14%] Building CXX object _deps/re2-build/CMakeFiles/re2.dir/re2/regexp.cc.o
[ 14%] Building CXX object _deps/re2-build/CMakeFiles/re2.dir/re2/set.cc.o
[ 14%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/cpp/message.cc.o
[ 14%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/cpp/message_field.cc.o
[ 14%] Building CXX object _deps/re2-build/CMakeFiles/re2.dir/re2/simplify.cc.o
[ 14%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/cpp/padding_optimizer.cc.o
[ 14%] Building CXX object _deps/re2-build/CMakeFiles/re2.dir/re2/stringpiece.cc.o
[ 14%] Building CXX object _deps/re2-build/CMakeFiles/re2.dir/re2/tostring.cc.o
[ 14%] Building CXX object _deps/re2-build/CMakeFiles/re2.dir/re2/unicode_casefold.cc.o
[ 14%] Building CXX object _deps/re2-build/CMakeFiles/re2.dir/re2/unicode_groups.cc.o
[ 14%] Building CXX object _deps/re2-build/CMakeFiles/re2.dir/util/rune.cc.o
[ 15%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/cpp/parse_function_generator.cc.o
[ 15%] Building CXX object _deps/re2-build/CMakeFiles/re2.dir/util/strutil.cc.o
[ 15%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/cpp/primitive_field.cc.o
[ 15%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/cpp/service.cc.o
[ 15%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/cpp/string_field.cc.o
[ 15%] Linking CXX static library libre2.a
[ 15%] Built target re2
[ 15%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/csharp/csharp_doc_comment.cc.o
[ 15%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/csharp/csharp_enum.cc.o
[ 15%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/csharp/csharp_enum_field.cc.o
[ 15%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/csharp/csharp_field_base.cc.o
[ 15%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/csharp/csharp_generator.cc.o
[ 15%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/csharp/csharp_helpers.cc.o
[ 15%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/csharp/csharp_map_field.cc.o
[ 15%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/csharp/csharp_message.cc.o
[ 15%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/csharp/csharp_message_field.cc.o
[ 15%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/csharp/csharp_primitive_field.cc.o
[ 15%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/csharp/csharp_reflection_class.cc.o
[ 15%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc.o
[ 15%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc.o
[ 16%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc.o
[ 16%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc.o
[ 16%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/csharp/csharp_wrapper_field.cc.o
[ 16%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/java/context.cc.o
[ 16%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/java/doc_comment.cc.o
[ 16%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/java/enum.cc.o
[ 16%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/java/enum_field.cc.o
[ 16%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/java/enum_field_lite.cc.o
[ 16%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/java/enum_lite.cc.o
[ 16%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/java/extension.cc.o
[ 16%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/java/extension_lite.cc.o
[ 16%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/java/field.cc.o
[ 16%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/java/file.cc.o
[ 16%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/java/generator.cc.o
[ 16%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/java/generator_factory.cc.o
[ 16%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/java/helpers.cc.o
[ 16%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/java/kotlin_generator.cc.o
[ 17%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/java/map_field.cc.o
[ 17%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/java/map_field_lite.cc.o
[ 17%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/java/message.cc.o
[ 17%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/java/message_builder.cc.o
[ 17%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/java/message_builder_lite.cc.o
[ 17%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/java/message_field.cc.o
[ 17%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/java/message_field_lite.cc.o
[ 17%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/java/message_lite.cc.o
[ 17%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/java/name_resolver.cc.o
[ 17%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/java/primitive_field.cc.o
[ 17%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/java/primitive_field_lite.cc.o
[ 17%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/java/service.cc.o
[ 17%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/java/shared_code_generator.cc.o
[ 17%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/java/string_field.cc.o
[ 17%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/java/string_field_lite.cc.o
[ 17%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/objectivec/objectivec_enum.cc.o
[ 17%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc.o
[ 18%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/objectivec/objectivec_extension.cc.o
[ 18%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/objectivec/objectivec_field.cc.o
[ 18%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/objectivec/objectivec_file.cc.o
[ 18%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/objectivec/objectivec_generator.cc.o
[ 18%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc.o
[ 18%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/objectivec/objectivec_map_field.cc.o
[ 18%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/objectivec/objectivec_message.cc.o
[ 18%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/objectivec/objectivec_message_field.cc.o
[ 18%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/objectivec/objectivec_oneof.cc.o
[ 18%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc.o
[ 18%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/php/php_generator.cc.o
[ 18%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/plugin.cc.o
[ 18%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/plugin.pb.cc.o
[ 18%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/python/generator.cc.o
[ 18%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/python/helpers.cc.o
[ 18%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/python/pyi_generator.cc.o
[ 18%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/ruby/ruby_generator.cc.o
[ 20%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/subprocess.cc.o
[ 20%] Building CXX object _deps/protobuf-build/CMakeFiles/libprotoc.dir/src/google/protobuf/compiler/zip_writer.cc.o
[ 20%] Linking CXX static library libprotoc.a
[ 20%] Built target libprotoc
gmake: *** [Makefile:146: all] Error 2
Traceback (most recent call last):
  File "/home/johnny/Projects/onnxruntime/tools/ci_build/build.py", line 2962, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/johnny/Projects/onnxruntime/tools/ci_build/build.py", line 2854, in main
    build_targets(args, cmake_path, build_dir, configs, num_parallel_jobs, args.target)
  File "/home/johnny/Projects/onnxruntime/tools/ci_build/build.py", line 1743, in build_targets
    run_subprocess(cmd_args, env=env)
  File "/home/johnny/Projects/onnxruntime/tools/ci_build/build.py", line 861, in run_subprocess
    return run(*args, cwd=cwd, capture_stdout=capture_stdout, shell=shell, env=my_env)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/johnny/Projects/onnxruntime/tools/python/util/run.py", line 49, in run
    completed_process = subprocess.run(
                        ^^^^^^^^^^^^^^^
  File "/home/johnny/miniconda3/envs/py311/lib/python3.11/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/usr/local/bin/cmake', '--build', '/home/johnny/Projects/onnxruntime/build/Linux/Release', '--config', 'Release', '--', '-j12']' returned non-zero exit status 2.
(py311) johnny@johnny-jetson:~/Projects/onnxruntime$ 
tianleiwu commented 6 months ago

@johnnynunez, you can edit the line to remove [[maybe_unused]], which I think it is not needed. If it resolve the issue, we can fix it in 1.18 release.

johnnynunez commented 6 months ago

@johnnynunez, you can edit the line to remove [[maybe_unused]], which I think it is not needed. If it resolve the issue, we can fix it in 1.18 release.

As expected, it works! @tianleiwu Cuda 12.4 Update 1 Cudnn 9.1 TensorRT 10.0.1.6

image