anion0278 / mediapipe-jetson

Google's MediaPipe (v0.8.9) and Python Wheel installer for Jetson Nano (JetPack 4.6) compiled for CUDA 10.2
Apache License 2.0
9 stars 3 forks source link

Build Fails on AGX Xavier #6

Closed mericgeren closed 12 months ago

mericgeren commented 1 year ago

- Device: Jetson AGX Xavier - OS Platform and Distribution: Linux Ubuntu 18.04 (L4T 32.7.4 / Jetpack 4.6.4) - Compiler version: gcc/g++ 8.4.0 - Programming Language and version: Python 3.6, Java 1.8.0 - Installed using virtualenv? pip? Conda?: I did use pip3 without a virtual environment - MediaPipe version: I don't use a Mediapipe other than provided in mediapipe-jetson repository. - Bazel version: 4.2.1 - XCode and Tulsi versions: N/A (Not IOS) - Android SDK and NDK versions: N/A (Not Android) - Android [AAR]: No - OpenCV version: 3.2

Describe the problem:

After following the the guide on compiling from source here the build failed.

Complete Logs:


WARNING: Skipping mediapipe as it is not installed.
/usr/local/lib/python3.6/dist-packages/setuptools/dist.py:511: UserWarning: The version specified ('0.8.9_cuda102') is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details.
  "details." % version
running gen_protos
generating proto file: mediapipe/framework/packet_generator_pb2.py
generating proto file: mediapipe/framework/stream_handler_pb2.py
generating proto file: mediapipe/framework/test_calculators_pb2.py
generating proto file: mediapipe/framework/calculator_pb2.py
generating proto file: mediapipe/framework/thread_pool_executor_pb2.py
generating proto file: mediapipe/framework/calculator_profile_pb2.py
generating proto file: mediapipe/framework/status_handler_pb2.py
generating proto file: mediapipe/framework/packet_factory_pb2.py
generating proto file: mediapipe/framework/calculator_options_pb2.py
generating proto file: mediapipe/framework/mediapipe_options_pb2.py
generating proto file: mediapipe/framework/tool/switch_container_pb2.py
generating proto file: mediapipe/framework/tool/field_data_pb2.py
generating proto file: mediapipe/framework/tool/packet_generator_wrapper_calculator_pb2.py
generating proto file: mediapipe/framework/tool/source_pb2.py
generating proto file: mediapipe/framework/tool/node_chain_subgraph_pb2.py
generating proto file: mediapipe/framework/tool/calculator_graph_template_pb2.py
generating proto file: mediapipe/framework/formats/affine_transform_data_pb2.py
generating proto file: mediapipe/framework/formats/time_series_header_pb2.py
generating proto file: mediapipe/framework/formats/matrix_data_pb2.py
generating proto file: mediapipe/framework/formats/detection_pb2.py
generating proto file: mediapipe/framework/formats/location_data_pb2.py
generating proto file: mediapipe/framework/formats/rect_pb2.py
generating proto file: mediapipe/framework/formats/landmark_pb2.py
generating proto file: mediapipe/framework/formats/body_rig_pb2.py
generating proto file: mediapipe/framework/formats/image_format_pb2.py
generating proto file: mediapipe/framework/formats/image_file_properties_pb2.py
generating proto file: mediapipe/framework/formats/classification_pb2.py
generating proto file: mediapipe/framework/formats/annotation/locus_pb2.py
generating proto file: mediapipe/framework/formats/annotation/rasterization_pb2.py
generating proto file: mediapipe/framework/formats/motion/optical_flow_field_data_pb2.py
generating proto file: mediapipe/framework/formats/object_detection/anchor_pb2.py
generating proto file: mediapipe/framework/stream_handler/default_input_stream_handler_pb2.py
generating proto file: mediapipe/framework/stream_handler/timestamp_align_input_stream_handler_pb2.py
generating proto file: mediapipe/framework/stream_handler/fixed_size_input_stream_handler_pb2.py
generating proto file: mediapipe/framework/stream_handler/sync_set_input_stream_handler_pb2.py
generating proto file: mediapipe/framework/deps/proto_descriptor_pb2.py
generating proto file: mediapipe/calculators/image/opencv_image_encoder_calculator_pb2.py
generating proto file: mediapipe/calculators/image/feature_detector_calculator_pb2.py
generating proto file: mediapipe/calculators/image/set_alpha_calculator_pb2.py
generating proto file: mediapipe/calculators/image/recolor_calculator_pb2.py
generating proto file: mediapipe/calculators/image/scale_image_calculator_pb2.py
generating proto file: mediapipe/calculators/image/warp_affine_calculator_pb2.py
generating proto file: mediapipe/calculators/image/image_transformation_calculator_pb2.py
generating proto file: mediapipe/calculators/image/image_cropping_calculator_pb2.py
generating proto file: mediapipe/calculators/image/segmentation_smoothing_calculator_pb2.py
generating proto file: mediapipe/calculators/image/image_clone_calculator_pb2.py
generating proto file: mediapipe/calculators/image/bilateral_filter_calculator_pb2.py
generating proto file: mediapipe/calculators/image/opencv_encoded_image_to_image_frame_calculator_pb2.py
generating proto file: mediapipe/calculators/image/mask_overlay_calculator_pb2.py
generating proto file: mediapipe/calculators/audio/stabilized_log_calculator_pb2.py
generating proto file: mediapipe/calculators/audio/spectrogram_calculator_pb2.py
generating proto file: mediapipe/calculators/audio/time_series_framer_calculator_pb2.py
generating proto file: mediapipe/calculators/audio/mfcc_mel_calculators_pb2.py
generating proto file: mediapipe/calculators/audio/rational_factor_resample_calculator_pb2.py
generating proto file: mediapipe/calculators/tflite/ssd_anchors_calculator_pb2.py
generating proto file: mediapipe/calculators/tflite/tflite_converter_calculator_pb2.py
generating proto file: mediapipe/calculators/tflite/tflite_tensors_to_landmarks_calculator_pb2.py
generating proto file: mediapipe/calculators/tflite/tflite_tensors_to_segmentation_calculator_pb2.py
generating proto file: mediapipe/calculators/tflite/tflite_inference_calculator_pb2.py
generating proto file: mediapipe/calculators/tflite/tflite_tensors_to_classification_calculator_pb2.py
generating proto file: mediapipe/calculators/tflite/tflite_tensors_to_detections_calculator_pb2.py
generating proto file: mediapipe/calculators/tflite/tflite_custom_op_resolver_calculator_pb2.py
generating proto file: mediapipe/calculators/tensor/inference_calculator_pb2.py
generating proto file: mediapipe/calculators/tensor/landmarks_to_tensor_calculator_pb2.py
generating proto file: mediapipe/calculators/tensor/tensors_to_segmentation_calculator_pb2.py
generating proto file: mediapipe/calculators/tensor/tensors_to_classification_calculator_pb2.py
generating proto file: mediapipe/calculators/tensor/tensors_to_detections_calculator_pb2.py
generating proto file: mediapipe/calculators/tensor/tensor_converter_calculator_pb2.py
generating proto file: mediapipe/calculators/tensor/tensors_to_landmarks_calculator_pb2.py
generating proto file: mediapipe/calculators/tensor/image_to_tensor_calculator_pb2.py
generating proto file: mediapipe/calculators/tensor/tensors_to_floats_calculator_pb2.py
generating proto file: mediapipe/calculators/util/landmarks_to_floats_calculator_pb2.py
generating proto file: mediapipe/calculators/util/packet_frequency_calculator_pb2.py
generating proto file: mediapipe/calculators/util/non_max_suppression_calculator_pb2.py
generating proto file: mediapipe/calculators/util/timed_box_list_id_to_label_calculator_pb2.py
generating proto file: mediapipe/calculators/util/annotation_overlay_calculator_pb2.py
generating proto file: mediapipe/calculators/util/landmark_projection_calculator_pb2.py
generating proto file: mediapipe/calculators/util/rect_transformation_calculator_pb2.py
generating proto file: mediapipe/calculators/util/timed_box_list_to_render_data_calculator_pb2.py
generating proto file: mediapipe/calculators/util/detection_label_id_to_text_calculator_pb2.py
generating proto file: mediapipe/calculators/util/visibility_smoothing_calculator_pb2.py
generating proto file: mediapipe/calculators/util/rect_to_render_scale_calculator_pb2.py
generating proto file: mediapipe/calculators/util/association_calculator_pb2.py
generating proto file: mediapipe/calculators/util/top_k_scores_calculator_pb2.py
generating proto file: mediapipe/calculators/util/collection_has_min_size_calculator_pb2.py
generating proto file: mediapipe/calculators/util/packet_frequency_pb2.py
generating proto file: mediapipe/calculators/util/local_file_contents_calculator_pb2.py
generating proto file: mediapipe/calculators/util/logic_calculator_pb2.py
generating proto file: mediapipe/calculators/util/landmarks_to_render_data_calculator_pb2.py
generating proto file: mediapipe/calculators/util/landmarks_smoothing_calculator_pb2.py
generating proto file: mediapipe/calculators/util/rect_to_render_data_calculator_pb2.py
generating proto file: mediapipe/calculators/util/labels_to_render_data_calculator_pb2.py
generating proto file: mediapipe/calculators/util/packet_latency_calculator_pb2.py
generating proto file: mediapipe/calculators/util/filter_detections_calculator_pb2.py
generating proto file: mediapipe/calculators/util/landmarks_to_detection_calculator_pb2.py
generating proto file: mediapipe/calculators/util/detections_to_render_data_calculator_pb2.py
generating proto file: mediapipe/calculators/util/visibility_copy_calculator_pb2.py
generating proto file: mediapipe/calculators/util/landmarks_refinement_calculator_pb2.py
generating proto file: mediapipe/calculators/util/detections_to_rects_calculator_pb2.py
generating proto file: mediapipe/calculators/util/refine_landmarks_from_heatmap_calculator_pb2.py
generating proto file: mediapipe/calculators/util/thresholding_calculator_pb2.py
generating proto file: mediapipe/calculators/util/latency_pb2.py
generating proto file: mediapipe/calculators/core/packet_resampler_calculator_pb2.py
generating proto file: mediapipe/calculators/core/clip_vector_size_calculator_pb2.py
generating proto file: mediapipe/calculators/core/quantize_float_vector_calculator_pb2.py
generating proto file: mediapipe/calculators/core/packet_cloner_calculator_pb2.py
generating proto file: mediapipe/calculators/core/graph_profile_calculator_pb2.py
generating proto file: mediapipe/calculators/core/concatenate_vector_calculator_pb2.py
generating proto file: mediapipe/calculators/core/gate_calculator_pb2.py
generating proto file: mediapipe/calculators/core/dequantize_byte_array_calculator_pb2.py
generating proto file: mediapipe/calculators/core/flow_limiter_calculator_pb2.py
generating proto file: mediapipe/calculators/core/sequence_shift_calculator_pb2.py
generating proto file: mediapipe/calculators/core/constant_side_packet_calculator_pb2.py
generating proto file: mediapipe/calculators/core/packet_thinner_calculator_pb2.py
generating proto file: mediapipe/calculators/core/split_vector_calculator_pb2.py
generating proto file: mediapipe/calculators/video/tracked_detection_manager_calculator_pb2.py
generating proto file: mediapipe/calculators/video/flow_packager_calculator_pb2.py
generating proto file: mediapipe/calculators/video/box_tracker_calculator_pb2.py
generating proto file: mediapipe/calculators/video/flow_to_image_calculator_pb2.py
generating proto file: mediapipe/calculators/video/opencv_video_encoder_calculator_pb2.py
generating proto file: mediapipe/calculators/video/box_detector_calculator_pb2.py
generating proto file: mediapipe/calculators/video/video_pre_stream_calculator_pb2.py
generating proto file: mediapipe/calculators/video/motion_analysis_calculator_pb2.py
generating proto file: mediapipe/calculators/video/tool/flow_quantizer_model_pb2.py
generating proto file: mediapipe/calculators/internal/callback_packet_calculator_pb2.py
generating proto file: mediapipe/gpu/gl_scaler_calculator_pb2.py
generating proto file: mediapipe/gpu/gl_surface_sink_calculator_pb2.py
generating proto file: mediapipe/gpu/scale_mode_pb2.py
generating proto file: mediapipe/gpu/copy_calculator_pb2.py
generating proto file: mediapipe/gpu/gpu_origin_pb2.py
generating proto file: mediapipe/gpu/gl_context_options_pb2.py
generating proto file: mediapipe/modules/objectron/calculators/camera_parameters_pb2.py
generating proto file: mediapipe/modules/objectron/calculators/lift_2d_frame_annotation_to_3d_calculator_pb2.py
generating proto file: mediapipe/modules/objectron/calculators/filter_detection_calculator_pb2.py
generating proto file: mediapipe/modules/objectron/calculators/object_pb2.py
generating proto file: mediapipe/modules/objectron/calculators/tensors_to_objects_calculator_pb2.py
generating proto file: mediapipe/modules/objectron/calculators/frame_annotation_to_rect_calculator_pb2.py
generating proto file: mediapipe/modules/objectron/calculators/frame_annotation_tracker_calculator_pb2.py
generating proto file: mediapipe/modules/objectron/calculators/belief_decoder_config_pb2.py
generating proto file: mediapipe/modules/objectron/calculators/annotation_data_pb2.py
generating proto file: mediapipe/modules/objectron/calculators/tflite_tensors_to_objects_calculator_pb2.py
generating proto file: mediapipe/modules/objectron/calculators/a_r_capture_metadata_pb2.py
generating proto file: mediapipe/modules/holistic_landmark/calculators/roi_tracking_calculator_pb2.py
generating proto file: mediapipe/modules/face_geometry/geometry_pipeline_calculator_pb2.py
generating proto file: mediapipe/modules/face_geometry/env_generator_calculator_pb2.py
generating proto file: mediapipe/modules/face_geometry/effect_renderer_calculator_pb2.py
generating proto file: mediapipe/modules/face_geometry/protos/environment_pb2.py
generating proto file: mediapipe/modules/face_geometry/protos/face_geometry_pb2.py
generating proto file: mediapipe/modules/face_geometry/protos/geometry_pipeline_metadata_pb2.py
generating proto file: mediapipe/modules/face_geometry/protos/mesh_3d_pb2.py
generating proto file: mediapipe/util/render_data_pb2.py
generating proto file: mediapipe/util/audio_decoder_pb2.py
generating proto file: mediapipe/util/color_pb2.py
generating proto file: mediapipe/util/tracking/box_detector_pb2.py
generating proto file: mediapipe/util/tracking/motion_models_pb2.py
generating proto file: mediapipe/util/tracking/region_flow_pb2.py
generating proto file: mediapipe/util/tracking/motion_estimation_pb2.py
generating proto file: mediapipe/util/tracking/box_tracker_pb2.py
generating proto file: mediapipe/util/tracking/push_pull_filtering_pb2.py
generating proto file: mediapipe/util/tracking/tracking_pb2.py
generating proto file: mediapipe/util/tracking/tracked_detection_manager_config_pb2.py
generating proto file: mediapipe/util/tracking/motion_analysis_pb2.py
generating proto file: mediapipe/util/tracking/flow_packager_pb2.py
generating proto file: mediapipe/util/tracking/tone_estimation_pb2.py
generating proto file: mediapipe/util/tracking/camera_motion_pb2.py
generating proto file: mediapipe/util/tracking/motion_saliency_pb2.py
generating proto file: mediapipe/util/tracking/frame_selection_pb2.py
generating proto file: mediapipe/util/tracking/region_flow_computation_pb2.py
generating proto file: mediapipe/util/tracking/tone_models_pb2.py
generating proto file: mediapipe/util/tracking/frame_selection_solution_evaluator_pb2.py
/usr/local/lib/python3.6/dist-packages/setuptools/dist.py:511: UserWarning: The version specified ('0.8.9_cuda102') is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details.
  "details." % version
running bdist_wheel
running build
running build_py
running build_binary_graphs
generating binarypb: mediapipe/modules/face_detection/face_detection_short_range_gpu
Extracting Bazel installation...
Starting local Bazel server and connecting to it...
INFO: SHA256 (https://github.com/bazelbuild/rules_foreign_cc/archive/0.1.0.zip) = c2cdcf55ffaf49366725639e45dedd449b8c3fe22b54e31625eb80ce3a240f1e
DEBUG: Rule 'rules_foreign_cc' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "c2cdcf55ffaf49366725639e45dedd449b8c3fe22b54e31625eb80ce3a240f1e"
DEBUG: Repository rules_foreign_cc instantiated at:
  /home/mericgeren/mediapipe-jetson/WORKSPACE:42:13: in <toplevel>
Repository rule http_archive defined at:
  /home/mericgeren/.cache/bazel/_bazel_root/1203cec2c0418060ccddce75ea9152a3/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in <toplevel>
WARNING: Download from http://mirror.tensorflow.org/github.com/bazelbuild/rules_closure/archive/cf1e44edb908e9616030cc83d085989b8e6cd6df.tar.gz failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException GET returned 404 Not Found
WARNING: Download from https://storage.googleapis.com/mirror.tensorflow.org/github.com/tensorflow/runtime/archive/fc70a32ecd248dd7612d75d2177125ed14541367.tar.gz failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException GET returned 404 Not Found
WARNING: Download from https://storage.googleapis.com/mirror.tensorflow.org/github.com/llvm/llvm-project/archive/a87782c34d667d1c1a18fe82a9a7abfc72fd345b.tar.gz failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException GET returned 404 Not Found
DEBUG: /home/mericgeren/.cache/bazel/_bazel_root/1203cec2c0418060ccddce75ea9152a3/external/org_tensorflow/third_party/repo.bzl:122:14: 
Warning: skipping import of repository 'com_google_absl' because it already exists.
DEBUG: /home/mericgeren/.cache/bazel/_bazel_root/1203cec2c0418060ccddce75ea9152a3/external/org_tensorflow/third_party/repo.bzl:122:14: 
Warning: skipping import of repository 'com_google_benchmark' because it already exists.
DEBUG: /home/mericgeren/.cache/bazel/_bazel_root/1203cec2c0418060ccddce75ea9152a3/external/org_tensorflow/third_party/repo.bzl:122:14: 
Warning: skipping import of repository 'pybind11_bazel' because it already exists.
DEBUG: /home/mericgeren/.cache/bazel/_bazel_root/1203cec2c0418060ccddce75ea9152a3/external/org_tensorflow/third_party/repo.bzl:122:14: 
Warning: skipping import of repository 'com_google_protobuf' because it already exists.
DEBUG: /home/mericgeren/.cache/bazel/_bazel_root/1203cec2c0418060ccddce75ea9152a3/external/org_tensorflow/third_party/repo.bzl:122:14: 
Warning: skipping import of repository 'com_google_googletest' because it already exists.
DEBUG: /home/mericgeren/.cache/bazel/_bazel_root/1203cec2c0418060ccddce75ea9152a3/external/org_tensorflow/third_party/repo.bzl:122:14: 
Warning: skipping import of repository 'com_github_gflags_gflags' because it already exists.
DEBUG: /home/mericgeren/.cache/bazel/_bazel_root/1203cec2c0418060ccddce75ea9152a3/external/org_tensorflow/third_party/repo.bzl:122:14: 
Warning: skipping import of repository 'build_bazel_rules_apple' because it already exists.
DEBUG: /home/mericgeren/.cache/bazel/_bazel_root/1203cec2c0418060ccddce75ea9152a3/external/org_tensorflow/third_party/repo.bzl:122:14: 
Warning: skipping import of repository 'build_bazel_rules_swift' because it already exists.
DEBUG: /home/mericgeren/.cache/bazel/_bazel_root/1203cec2c0418060ccddce75ea9152a3/external/org_tensorflow/third_party/repo.bzl:122:14: 
Warning: skipping import of repository 'build_bazel_apple_support' because it already exists.
DEBUG: /home/mericgeren/.cache/bazel/_bazel_root/1203cec2c0418060ccddce75ea9152a3/external/org_tensorflow/third_party/repo.bzl:122:14: 
Warning: skipping import of repository 'xctestrunner' because it already exists.
DEBUG: /home/mericgeren/.cache/bazel/_bazel_root/1203cec2c0418060ccddce75ea9152a3/external/org_tensorflow/third_party/repo.bzl:122:14: 
Warning: skipping import of repository 'pybind11' because it already exists.
INFO: SHA256 (https://github.com/bazelbuild/rules_cc/archive/main.zip) = 66cf298ee7c55b686fc070d7270754b68e2cdb3ee0c0bb84144ddf19af57daab
DEBUG: Rule 'rules_cc' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "66cf298ee7c55b686fc070d7270754b68e2cdb3ee0c0bb84144ddf19af57daab"
DEBUG: Repository rules_cc instantiated at:
  /home/mericgeren/mediapipe-jetson/WORKSPACE:36:13: in <toplevel>
Repository rule http_archive defined at:
  /home/mericgeren/.cache/bazel/_bazel_root/1203cec2c0418060ccddce75ea9152a3/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in <toplevel>
ERROR: Traceback (most recent call last):
    File "/home/mericgeren/.cache/bazel/_bazel_root/1203cec2c0418060ccddce75ea9152a3/external/rules_cc/cc/private/rules_impl/compiler_flag.bzl", line 17, column 76, in <toplevel>
        load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain", "use_cpp_toolchain")
Error: file '@bazel_tools//tools/cpp:toolchain_utils.bzl' does not contain symbol 'use_cpp_toolchain' (did you mean 'find_cpp_toolchain'?)
ERROR: While resolving toolchains for target //mediapipe/modules/face_detection:face_detection_short_range_gpu: com.google.devtools.build.lib.packages.BuildFileContainsErrorsException: error loading package '@bazel_tools//tools/cpp': in /home/mericgeren/.cache/bazel/_bazel_root/1203cec2c0418060ccddce75ea9152a3/external/rules_cc/cc/defs.bzl: Extension file 'cc/private/rules_impl/compiler_flag.bzl' has errors
ERROR: Analysis of target '//mediapipe/modules/face_detection:face_detection_short_range_gpu' failed; build aborted: com.google.devtools.build.lib.packages.BuildFileContainsErrorsException: error loading package '@bazel_tools//tools/cpp': in /home/mericgeren/.cache/bazel/_bazel_root/1203cec2c0418060ccddce75ea9152a3/external/rules_cc/cc/defs.bzl: Extension file 'cc/private/rules_impl/compiler_flag.bzl' has errors
INFO: Elapsed time: 88.878s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (2 packages loaded, 0 targets conf\
igured)

Could you offer your guidance and advice please?

Kindest regards.

anion0278 commented 12 months ago

hi, try changing Bazel version parameter inside .bazelversion according to this answer. Unfortunately, I don't have Jetson to try it myself.

mericgeren commented 12 months ago

Thank you for your suggestion.

I have tried changing the .bazelversion file as mentioned there. But, unfortunately it didn't solve the problem. For me, upgrading bazel to 5.2.0 was the solution. Also, I have discovered that, in fact, .bazelversion doesn't affect the compile process that much since, I have changed .bazelversion to 4.2.1 again before succeeding on compiling the Mediapipe. If you don't mind I am closing this issue as solved.

Kindest regards.

anion0278 commented 12 months ago

@mericgeren Thank you for sharing your experience! And I'm glad that you've managed to resolve the issue.

mericgeren commented 12 months ago

@anion0278 you are welcome.