onnx-tensorrt icon indicating copy to clipboard operation
onnx-tensorrt copied to clipboard

CMake Error: : System Error: Permission denied | Building the onnx-tensorrt library within the docker

Open vilmara opened this issue 3 years ago • 1 comments

Description

make -j is throwing errors when building the onnx-tensorrt library within the docker, the servers has several gpu models, I have disabled the gpus and kept enabled only 1xA2, maybe that is the reason for the error: Makefile:151: recipe for target 'all' failed?

Environment

Baremetal or Container (if container which image + tag): Running from container image tensorrt-ubuntu18.04-cuda11.4 built as instructed in the main (TensorRT repository)[https://github.com/NVIDIA/TensorRT#setting-up-the-build-environment]

Relevant Files

Steps To Reproduce

Launch the TensorRT-OSS build container ./docker/launch.sh --tag tensorrt-ubuntu18.04-cuda11.4 --gpus all

Build the onnx-tensorrt library

sudo apt-get install libprotobuf-dev protobuf-compiler
sudo git clone --recurse-submodules https://github.com/onnx/onnx-tensorrt.git
cd onnx-tensorrt
sudo mkdir build && cd build
sudo cmake .. -DTENSORRT_ROOT="/workspace/TensorRT" && make -j8

Error:

Generated: /workspace/onnx-tensorrt/build/third_party/onnx/onnx/onnx_onnx2trt_onnx-ml.proto
Generated: /workspace/onnx-tensorrt/build/third_party/onnx/onnx/onnx-operators_onnx2trt_onnx-ml.proto
Generated: /workspace/onnx-tensorrt/build/third_party/onnx/onnx/onnx-data_onnx2trt_onnx.proto
--
-- ******** Summary ********
--   CMake version         : 3.14.4
--   CMake command         : /usr/local/bin/cmake
--   System                : Linux
--   C++ compiler          : /usr/bin/c++
--   C++ compiler version  : 7.5.0
--   CXX flags             :  -Wall -Wno-deprecated-declarations -Wno-unused-function -Wnon-virtual-dtor
--   Build type            : Release
--   Compile definitions   : SOURCE_LENGTH=25;ONNX_NAMESPACE=onnx2trt_onnx
--   CMAKE_PREFIX_PATH     :
--   CMAKE_INSTALL_PREFIX  : /usr/local
--   CMAKE_MODULE_PATH     :
--
--   ONNX version          : 1.8.0
--   ONNX NAMESPACE        : onnx2trt_onnx
--   ONNX_BUILD_TESTS      : OFF
--   ONNX_BUILD_BENCHMARKS : OFF
--   ONNX_USE_LITE_PROTO   : OFF
--   ONNXIFI_DUMMY_BACKEND : OFF
--   ONNXIFI_ENABLE_EXT    : OFF
--
--   Protobuf compiler     : /usr/bin/protoc
--   Protobuf includes     : /usr/include
--   Protobuf libraries    : /usr/lib/x86_64-linux-gnu/libprotobuf.so;-lpthread
--   BUILD_ONNX_PYTHON     : OFF
-- Found CUDA headers at /usr/local/cuda/include
-- Found TensorRT headers at /workspace/TensorRT/include
-- Find TensorRT libs at /usr/lib/x86_64-linux-gnu/libnvinfer.so;/usr/lib/x86_64-linux-gnu/libnvinfer_plugin.so
-- Configuring done
-- Generating done
-- Build files have been written to: /workspace/onnx-tensorrt/build
Scanning dependencies of target gen_onnx_proto
CMake Error: Cannot open file for write: /workspace/onnx-tensorrt/build/third_party/onnx/CMakeFiles/gen_onnx_proto.dir/depend.make.tmp
CMake Error: : System Error: Permission denied
third_party/onnx/CMakeFiles/gen_onnx_proto.dir/build.make:89: recipe for target 'third_party/onnx/CMakeFiles/gen_onnx_proto.dir/depend' failed
make[2]: *** [third_party/onnx/CMakeFiles/gen_onnx_proto.dir/depend] Error 2
CMakeFiles/Makefile2:376: recipe for target 'third_party/onnx/CMakeFiles/gen_onnx_proto.dir/all' failed
make[1]: *** [third_party/onnx/CMakeFiles/gen_onnx_proto.dir/all] Error 2
Makefile:151: recipe for target 'all' failed
make: *** [all] Error 2

vilmara avatar May 10 '22 00:05 vilmara

Can you try run the cmake command without sudo?

kevinch-nv avatar May 20 '22 22:05 kevinch-nv