Browse Source

disable execstack for amd libraries

Jeffrey Morgan 1 year ago
parent
commit
d10d3aac58
3 changed files with 6 additions and 2 deletions
  1. 1 1
      Dockerfile
  2. 4 0
      llm/generate/gen_linux.sh
  3. 1 1
      scripts/rh_linux_deps.sh

+ 1 - 1
Dockerfile

@@ -42,7 +42,7 @@ ARG AMDGPU_TARGETS
 RUN OLLAMA_SKIP_CPU_GENERATE=1 sh gen_linux.sh
 RUN mkdir /tmp/scratch && \
     for dep in $(cat /go/src/github.com/jmorganca/ollama/llm/llama.cpp/build/linux/x86_64/rocm*/lib/deps.txt) ; do \
-        cp ${dep} /tmp/scratch/ || exit 1 ; \
+    cp ${dep} /tmp/scratch/ || exit 1 ; \
     done && \
     (cd /opt/rocm/lib && tar cf - rocblas/library) | (cd /tmp/scratch/ && tar xf - ) && \
     mkdir -p /go/src/github.com/jmorganca/ollama/dist/deps/ && \

+ 4 - 0
llm/generate/gen_linux.sh

@@ -191,6 +191,10 @@ if [ -d "${ROCM_PATH}" ]; then
     # Record the ROCM dependencies
     rm -f "${BUILD_DIR}/lib/deps.txt"
     touch "${BUILD_DIR}/lib/deps.txt"
+
+    # having the execstack bit set on the HIP runtime sometimes causes `ldd` to error
+    execstack -c "${ROCM_PATH}/lib/libamdhip64.so*"
+
     for dep in $(ldd "${BUILD_DIR}/lib/libext_server.so" | grep "=>" | cut -f2 -d= | cut -f2 -d' ' | grep -e rocm -e amdgpu -e libtinfo ); do
         echo "${dep}" >> "${BUILD_DIR}/lib/deps.txt"
     done

+ 1 - 1
scripts/rh_linux_deps.sh

@@ -9,7 +9,7 @@ if grep -i "centos" /etc/system-release >/dev/null; then
     # Centos 7 derivatives have too old of a git version to run our generate script
     # uninstall and ignore failures
     yum remove -y git
-    yum -y install epel-release centos-release-scl
+    yum -y install epel-release centos-release-scl prelink
     yum -y install dnf
     if [ "${MACHINE}" = "x86_64" ]; then
         yum -y install https://repo.ius.io/ius-release-el7.rpm