Skip to content

Commit 99b76ce

Browse files
committed
fix sam
1 parent 05ae5c8 commit 99b76ce

File tree

1 file changed

+3
-4
lines changed
  • label_studio_ml/examples/segment_anything_model

1 file changed

+3
-4
lines changed

label_studio_ml/examples/segment_anything_model/Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ RUN --mount=type=cache,target="/var/cache/apt",sharing=locked \
2323
apt-get update; \
2424
apt-get upgrade -y; \
2525
apt install --no-install-recommends -y \
26-
wget git libopencv-dev cmake protobuf-compiler binutils; \
26+
wget git libopencv-dev cmake protobuf-compiler binutils patchelf; \
2727
apt-get autoremove -y
2828

2929
# Copy and run the model download script
@@ -45,10 +45,9 @@ COPY requirements.txt .
4545
RUN --mount=type=cache,target=${PIP_CACHE_DIR},sharing=locked \
4646
pip install -r requirements.txt
4747

48-
# Fix executable stack issue with onnxruntime shared library
49-
# Remove the .note.GNU-stack section which marks the stack as executable
48+
# Fix executable stack issue with onnxruntime shared library using patchelf
5049
RUN PYTHON_VER=$(python3 -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')") && \
51-
find /usr/local/lib/python${PYTHON_VER}/site-packages/onnxruntime/capi -name "onnxruntime_pybind11_state*.so" -exec sh -c 'objcopy --remove-section .note.GNU-stack "$1" 2>/dev/null || true' _ {} \; || true
50+
find /usr/local/lib/python${PYTHON_VER}/site-packages/onnxruntime/capi -name "onnxruntime_pybind11_state*.so" -exec sh -c 'patchelf --clear-execstack "$1" 2>/dev/null || true' _ {} \; || true
5251

5352
# install test requirements if needed
5453
COPY requirements-test.txt .

0 commit comments

Comments
 (0)