Skip to content

Commit 9cc555a

Browse files
committed
Fix protobuf crash in Gazebo Harmonic exercises
Add PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python so gz.msgs10 bindings work alongside protobuf 4.x pulled in by onnxruntime-gpu. Remove onnx package (not needed for inference, was second source of conflict) and redundant bare numpy install that would override the pinned 1.24.3.
1 parent a11e234 commit 9cc555a

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

scripts/RADI/Dockerfile.dependencies_humble

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ ENV PYTHONPATH=/opt/ros/${ROS_DISTRO}/lib/python3.10/site-packages
2828
ENV ROS_PYTHON_VERSION=3
2929
ENV ROS_VERSION=2
3030

31+
# gz.msgs10 Python bindings (installed by gz-harmonic apt package) are compiled
32+
# with protoc 3.x and cannot create descriptors under protobuf 4.x / 5.x C++
33+
# extension. Force pure-Python protobuf parser (backward-compatible with all
34+
# .pb2 files) so gz.msgs10 and onnxruntime-gpu coexist without version pinning.
35+
ENV PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
36+
3137
# Install common tools
3238
RUN apt-get update && apt-get install -y \
3339
software-properties-common \
@@ -182,8 +188,6 @@ RUN python3.10 -m pip install --no-cache-dir \
182188
# 5. Run: ldd $(python3 -c "import onnxruntime, os; print(os.path.dirname(onnxruntime.__file__))")/capi/libonnxruntime_providers_cuda.so
183189
# Every .so must resolve (no "not found" lines).
184190
RUN python3.10 -m pip install --no-cache-dir \
185-
numpy \
186-
onnx \
187191
nvidia-cuda-runtime-cu12==12.8.90 \
188192
nvidia-cublas-cu12==12.8.4.1 \
189193
nvidia-cudnn-cu12==9.10.2.21 \

0 commit comments

Comments
 (0)