From 5ff72aaf5081d8cac38b2ab4dd4f304535cbc94a Mon Sep 17 00:00:00 2001 From: Mario Ruiz Date: Wed, 12 Mar 2025 12:15:20 +0000 Subject: [PATCH 01/40] Depend on Ubuntu 24.04.2 --- scripts/linux/xdna-driver-builder/Dockerfile | 43 +++++++------------- scripts/linux/xdna-driver-builder/build.sh | 36 ++++------------ 2 files changed, 23 insertions(+), 56 deletions(-) diff --git a/scripts/linux/xdna-driver-builder/Dockerfile b/scripts/linux/xdna-driver-builder/Dockerfile index 38dd4b2..87d5c40 100644 --- a/scripts/linux/xdna-driver-builder/Dockerfile +++ b/scripts/linux/xdna-driver-builder/Dockerfile @@ -1,53 +1,40 @@ -# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved. # SPDX-License-Identifier: MIT FROM ubuntu:24.04 ARG DEBIAN_FRONTEND=noninteractive -ARG KERNEL_HEADERS -ARG KERNEL_HEADERS_GENERIC -ARG KERNEL_MODULES -ARG KERNEL_IMAGE RUN apt-get update -RUN apt-get install -y vim git -RUN apt-get install -y flex bison - -RUN git config --global http.postBuffer 157286400 -RUN apt-get install make - -RUN apt-get install -y dpkg-dev +RUN apt-get install --install-recommends linux-generic-hwe-24.04 +RUN apt-get install -y vim git flex bison make libelf1t64 +RUN apt-get install -y dpkg-dev libelf-dev zstd RUN apt-get install -y bc debhelper rsync kmod cpio libssl-dev:native -RUN apt-get install -y libelf-dev -RUN apt-get install -y zstd - -COPY _work /root/ -RUN apt-get install -y libelf1t64 -RUN apt-get install -y kmod -RUN apt-get install -y linux-base +RUN git config --global http.postBuffer 157286400 -RUN dpkg -i /root/$KERNEL_HEADERS -RUN dpkg -i /root/$KERNEL_HEADERS_GENERIC -RUN dpkg -i /root/$KERNEL_MODULES -RUN dpkg -i /root/$KERNEL_IMAGE +#RUN apt-get install -y linux-base RUN git config --global url."https://github.com/".insteadOf "git@github.com:" RUN cd /root && git clone https://github.com/amd/xdna-driver.git --recursive -RUN cd /root/xdna-driver && git checkout f60608b +RUN cd /root/xdna-driver && git checkout 1e1c63f RUN cd /root/xdna-driver && git submodule update --recursive RUN apt-get install -y cmake jq pkg-config wget libdrm-dev -RUN apt-get install -y python3-pip -RUN apt-get install -y ocl-icd-opencl-dev +RUN apt-get install -y python3-pip ocl-icd-opencl-dev RUN /root/xdna-driver/xrt/src/runtime_src/tools/scripts/xrtdeps.sh -docker -RUN mkdir /root/debs RUN cd /root/xdna-driver/build && ./build.sh -release RUN cd /root/xdna-driver/build && ./build.sh -package -RUN cd /root/xdna-driver/xrt/build && ./build.sh -noert +RUN cd /root/xdna-driver/xrt/build && ./build.sh -npu -opt +## Install xdna-driver +RUN -E dpkg -i /root/xdna-driver/xrt/build/Release/xrt_*-amd64-xrt.deb +RUN -E dpkg -i /root/xdna-driver/build/Release/xrt_plugin*-amdxdna.deb + +# Make a copy of the deb files +RUN mkdir /root/debs RUN cp /root/xdna-driver/build/Release/xrt_plugin*.deb /root/debs/ RUN cp /root/xdna-driver/xrt/build/Release/xrt*xrt.deb /root/debs/ diff --git a/scripts/linux/xdna-driver-builder/build.sh b/scripts/linux/xdna-driver-builder/build.sh index 56ec679..b9fbfb1 100755 --- a/scripts/linux/xdna-driver-builder/build.sh +++ b/scripts/linux/xdna-driver-builder/build.sh @@ -1,45 +1,25 @@ #!/bin/bash # -# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved. # SPDX-License-Identifier: MIT -KERNEL_VERSION="6.10-rc2" -KERNEL_VERSION_FULL="6.10.0-061000rc2" -BUILD_DATE="202406022333" - -KERNEL_HEADERS="linux-headers-${KERNEL_VERSION_FULL}_${KERNEL_VERSION_FULL}.${BUILD_DATE}_all.deb" -KERNEL_HEADERS_GENERIC="linux-headers-${KERNEL_VERSION_FULL}-generic_${KERNEL_VERSION_FULL}.${BUILD_DATE}_amd64.deb" -KERNEL_MODULES="linux-modules-${KERNEL_VERSION_FULL}-generic_${KERNEL_VERSION_FULL}.${BUILD_DATE}_amd64.deb" -KERNEL_IMAGE="linux-image-unsigned-${KERNEL_VERSION_FULL}-generic_${KERNEL_VERSION_FULL}.${BUILD_DATE}_amd64.deb" - -rm -rf _work -mkdir -p _work -wget -P _work https://kernel.ubuntu.com/mainline/v$KERNEL_VERSION/amd64/$KERNEL_HEADERS_GENERIC -wget -P _work https://kernel.ubuntu.com/mainline/v$KERNEL_VERSION/amd64/$KERNEL_HEADERS -wget -P _work https://kernel.ubuntu.com/mainline/v$KERNEL_VERSION/amd64/$KERNEL_IMAGE -wget -P _work https://kernel.ubuntu.com/mainline/v$KERNEL_VERSION/amd64/$KERNEL_MODULES - # Build a container that creates the appropriate linux kernel version docker build \ - -t xdna_deb_builder:latest \ - --build-arg KERNEL_HEADERS=$KERNEL_HEADERS \ - --build-arg KERNEL_HEADERS_GENERIC=$KERNEL_HEADERS_GENERIC \ - --build-arg KERNEL_MODULES=$KERNEL_MODULES \ - --build-arg KERNEL_IMAGE=$KERNEL_IMAGE \ + -t npubase:latest \ ./ -docker kill xdna_deb_builder_container || true +docker kill npubase_build_container || true # Lauch an image with that container -docker run -dit --rm --name xdna_deb_builder_container \ +docker run -dit --rm --name npubase_build_container \ -v $(pwd):/workspace \ -w /workspace/ \ - xdna_deb_builder:latest \ + npubase:latest \ /bin/bash -docker exec xdna_deb_builder_container bash -c "tar -zcvf driver.tar.gz /root/debs && mv driver.tar.gz /workspace/ubuntu24.04_npu_drivers.tar.gz" +# Execute container to get the driver and plugin +docker exec npubase_build_container bash -c "tar -zcvf driver.tar.gz /root/debs && mv driver.tar.gz /workspace/ubuntu24.04_npu_drivers.tar.gz" ## cleanup -docker kill xdna_deb_builder_container || true -docker image rm --force xdna_deb_builder:latest +docker kill npubase_build_container || true From 3b2d8d756b587f423a56737d767433aa6474163f Mon Sep 17 00:00:00 2001 From: Mario Ruiz Date: Wed, 12 Mar 2025 12:27:06 +0000 Subject: [PATCH 02/40] Set to executable --- scripts/wsl/setup_env.sh | 0 scripts/wsl/ubuntu_deps.sh | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 scripts/wsl/setup_env.sh mode change 100644 => 100755 scripts/wsl/ubuntu_deps.sh diff --git a/scripts/wsl/setup_env.sh b/scripts/wsl/setup_env.sh old mode 100644 new mode 100755 diff --git a/scripts/wsl/ubuntu_deps.sh b/scripts/wsl/ubuntu_deps.sh old mode 100644 new mode 100755 From d1e1f16afad7af9aedad607baf217bbd3eb3d086 Mon Sep 17 00:00:00 2001 From: Mario Ruiz Date: Wed, 12 Mar 2025 12:31:12 +0000 Subject: [PATCH 03/40] Get kernel headers --- scripts/linux/xdna-driver-builder/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/linux/xdna-driver-builder/Dockerfile b/scripts/linux/xdna-driver-builder/Dockerfile index 87d5c40..5dcc115 100644 --- a/scripts/linux/xdna-driver-builder/Dockerfile +++ b/scripts/linux/xdna-driver-builder/Dockerfile @@ -6,7 +6,8 @@ FROM ubuntu:24.04 ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update -RUN apt-get install --install-recommends linux-generic-hwe-24.04 +#RUN apt-get install --install-recommends linux-generic-hwe-24.04 +RUN apt-get install linux-headers-$(uname -r) RUN apt-get install -y vim git flex bison make libelf1t64 RUN apt-get install -y dpkg-dev libelf-dev zstd RUN apt-get install -y bc debhelper rsync kmod cpio libssl-dev:native From f315d65c79673b5eab804955bb96de42a694e4ec Mon Sep 17 00:00:00 2001 From: Mario Ruiz Date: Wed, 12 Mar 2025 12:35:52 +0000 Subject: [PATCH 04/40] Move where headers are installed --- scripts/linux/xdna-driver-builder/Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/linux/xdna-driver-builder/Dockerfile b/scripts/linux/xdna-driver-builder/Dockerfile index 5dcc115..dc3b222 100644 --- a/scripts/linux/xdna-driver-builder/Dockerfile +++ b/scripts/linux/xdna-driver-builder/Dockerfile @@ -6,8 +6,6 @@ FROM ubuntu:24.04 ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update -#RUN apt-get install --install-recommends linux-generic-hwe-24.04 -RUN apt-get install linux-headers-$(uname -r) RUN apt-get install -y vim git flex bison make libelf1t64 RUN apt-get install -y dpkg-dev libelf-dev zstd RUN apt-get install -y bc debhelper rsync kmod cpio libssl-dev:native @@ -26,6 +24,10 @@ RUN apt-get install -y python3-pip ocl-icd-opencl-dev RUN /root/xdna-driver/xrt/src/runtime_src/tools/scripts/xrtdeps.sh -docker +RUN apt-get update +RUN apt-get install --install-recommends linux-generic-hwe-24.04 +RUN apt-get install linux-headers-$(uname -r) + RUN cd /root/xdna-driver/build && ./build.sh -release RUN cd /root/xdna-driver/build && ./build.sh -package From 6b644b2d5b4c4c502d0faa96a13af952914577cc Mon Sep 17 00:00:00 2001 From: Mario Ruiz Date: Wed, 12 Mar 2025 12:37:00 +0000 Subject: [PATCH 05/40] Add -y --- scripts/linux/xdna-driver-builder/Dockerfile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/linux/xdna-driver-builder/Dockerfile b/scripts/linux/xdna-driver-builder/Dockerfile index dc3b222..d7f8fa4 100644 --- a/scripts/linux/xdna-driver-builder/Dockerfile +++ b/scripts/linux/xdna-driver-builder/Dockerfile @@ -6,6 +6,8 @@ FROM ubuntu:24.04 ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update +RUN apt-get install -y --install-recommends linux-generic-hwe-24.04 +RUN apt-get install -y linux-headers-$(uname -r) RUN apt-get install -y vim git flex bison make libelf1t64 RUN apt-get install -y dpkg-dev libelf-dev zstd RUN apt-get install -y bc debhelper rsync kmod cpio libssl-dev:native @@ -24,10 +26,6 @@ RUN apt-get install -y python3-pip ocl-icd-opencl-dev RUN /root/xdna-driver/xrt/src/runtime_src/tools/scripts/xrtdeps.sh -docker -RUN apt-get update -RUN apt-get install --install-recommends linux-generic-hwe-24.04 -RUN apt-get install linux-headers-$(uname -r) - RUN cd /root/xdna-driver/build && ./build.sh -release RUN cd /root/xdna-driver/build && ./build.sh -package From b4082424a531fc601341126eb8b8755017b2b590 Mon Sep 17 00:00:00 2001 From: Mario Ruiz Date: Wed, 12 Mar 2025 12:50:33 +0000 Subject: [PATCH 06/40] Update package name --- scripts/linux/xdna-driver-builder/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/linux/xdna-driver-builder/Dockerfile b/scripts/linux/xdna-driver-builder/Dockerfile index d7f8fa4..e926682 100644 --- a/scripts/linux/xdna-driver-builder/Dockerfile +++ b/scripts/linux/xdna-driver-builder/Dockerfile @@ -32,10 +32,10 @@ RUN cd /root/xdna-driver/build && ./build.sh -package RUN cd /root/xdna-driver/xrt/build && ./build.sh -npu -opt ## Install xdna-driver -RUN -E dpkg -i /root/xdna-driver/xrt/build/Release/xrt_*-amd64-xrt.deb +RUN -E dpkg -i /root/xdna-driver/xrt/build/Release/xrt_*-amd64-npu.deb RUN -E dpkg -i /root/xdna-driver/build/Release/xrt_plugin*-amdxdna.deb # Make a copy of the deb files RUN mkdir /root/debs +RUN cp /root/xdna-driver/xrt/build/Release/xrt_*-amd64-npu.deb /root/debs/ RUN cp /root/xdna-driver/build/Release/xrt_plugin*.deb /root/debs/ -RUN cp /root/xdna-driver/xrt/build/Release/xrt*xrt.deb /root/debs/ From 01ff18c490589eefd9a67743a143e17e5a1fd75d Mon Sep 17 00:00:00 2001 From: Mario Ruiz Date: Wed, 12 Mar 2025 12:56:00 +0000 Subject: [PATCH 07/40] Remove install code --- scripts/linux/xdna-driver-builder/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/linux/xdna-driver-builder/Dockerfile b/scripts/linux/xdna-driver-builder/Dockerfile index e926682..f768b20 100644 --- a/scripts/linux/xdna-driver-builder/Dockerfile +++ b/scripts/linux/xdna-driver-builder/Dockerfile @@ -32,8 +32,8 @@ RUN cd /root/xdna-driver/build && ./build.sh -package RUN cd /root/xdna-driver/xrt/build && ./build.sh -npu -opt ## Install xdna-driver -RUN -E dpkg -i /root/xdna-driver/xrt/build/Release/xrt_*-amd64-npu.deb -RUN -E dpkg -i /root/xdna-driver/build/Release/xrt_plugin*-amdxdna.deb +#RUN -E dpkg -i /root/xdna-driver/xrt/build/Release/xrt_*-amd64-npu.deb +#RUN -E dpkg -i /root/xdna-driver/build/Release/xrt_plugin*-amdxdna.deb # Make a copy of the deb files RUN mkdir /root/debs From d13a8bce3b95f398337726e8af960eadad58264d Mon Sep 17 00:00:00 2001 From: Mario Ruiz Date: Wed, 12 Mar 2025 12:57:24 +0000 Subject: [PATCH 08/40] Update install package --- scripts/linux/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/linux/Dockerfile b/scripts/linux/Dockerfile index e3de3be..ce83644 100644 --- a/scripts/linux/Dockerfile +++ b/scripts/linux/Dockerfile @@ -1,7 +1,7 @@ -# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved. # SPDX-License-Identifier: MIT -FROM ubuntu:24.04 +FROM npubase:latest ARG BUILD_TEMPDIR ARG LIC_MAC=00:00:00:00:00:00 @@ -49,7 +49,7 @@ COPY $BUILD_TEMPDIR/root/debs npu_ubuntu_debs RUN sudo apt-get install -y dkms udev python3 RUN sudo apt-get install -y python3-pip ocl-icd-opencl-dev uuid-dev libopencv-dev python3-opencv -RUN sudo -E dpkg -i npu_ubuntu_debs/xrt_*-amd64-xrt.deb +RUN sudo -E dpkg -i npu_ubuntu_debs/xrt_*-amd64-npu.deb RUN sudo -E dpkg -i npu_ubuntu_debs/xrt_plugin*-amdxdna.deb RUN git clone https://github.com/AMDResearch/Riallto --depth=1 From 2f818e33b3c57ab172a103b2059ff04d6f76a7ea Mon Sep 17 00:00:00 2001 From: Mario Ruiz Date: Wed, 12 Mar 2025 12:57:48 +0000 Subject: [PATCH 09/40] Update code not to install kernel --- scripts/linux/setup_riallto_linux.sh | 69 +++------------------------- 1 file changed, 6 insertions(+), 63 deletions(-) diff --git a/scripts/linux/setup_riallto_linux.sh b/scripts/linux/setup_riallto_linux.sh index 145ca52..abf55f1 100755 --- a/scripts/linux/setup_riallto_linux.sh +++ b/scripts/linux/setup_riallto_linux.sh @@ -5,18 +5,6 @@ set -e -KERNEL_VERSION="6.10-rc2" -KERNEL_VERSION_FULL="6.10.0-061000rc2" -BUILD_DATE="202406022333" - -DRIVER_TARBALL=ubuntu24.04_npu_drivers.tar.gz -REQUIRED_KERNEL_VERSION="${KERNEL_VERSION_FULL}-generic" -NPU_FIRMWARE="/lib/firmware/amdnpu/1502_00/npu.sbin" -KERNEL_HEADERS="linux-headers-${KERNEL_VERSION_FULL}_${KERNEL_VERSION_FULL}.${BUILD_DATE}_all.deb" -KERNEL_HEADERS_GENERIC="linux-headers-${KERNEL_VERSION_FULL}-generic_${KERNEL_VERSION_FULL}.${BUILD_DATE}_amd64.deb" -KERNEL_MODULES="linux-modules-${KERNEL_VERSION_FULL}-generic_${KERNEL_VERSION_FULL}.${BUILD_DATE}_amd64.deb" -KERNEL_IMAGE="linux-image-unsigned-${KERNEL_VERSION_FULL}-generic_${KERNEL_VERSION_FULL}.${BUILD_DATE}_amd64.deb" - MLIR_FILE="https://www.xilinx.com/bin/public/openDownload?filename=pynqMLIR_AIE_py312_v0.9.tar.gz" RIALLTO_FILE="https://www.xilinx.com/bin/public/openDownload?filename=Riallto-v1.1.zip" @@ -24,7 +12,6 @@ RIALLTO_FILE="https://www.xilinx.com/bin/public/openDownload?filename=Riallto-v1 ############# CHECKS ################################## # Check to ensure key URLs are accessible URLS=( -"https://kernel.ubuntu.com/mainline/v$KERNEL_VERSION/amd64/" $MLIR_FILE $RIALLTO_FILE "https://github.com/amd/xdna-driver.git" @@ -50,10 +37,10 @@ for URL in "${URLS[@]}"; do fi done -# Check that we are on Ubuntu24.04 +# Check that we are on Ubuntu24.04.2 distro_info=$(lsb_release -d) -if [[ $distro_info != *"Ubuntu 24.04"* ]]; then - echo "Riallto is only currently supported on Ubuntu 24.04" +if [[ $distro_info != *"Ubuntu 24.04.2"* ]]; then + echo "Riallto is only currently supported on Ubuntu 24.04.2" exit 1 fi @@ -93,49 +80,6 @@ echo "Found a License file associated with MAC address $MAC" ######### Kernel and NPU driver check / install ########### # Check to see if the kernel version and NPU driver is already installed build_xrt=0 -kernel_version=$(uname -r) - -if [[ "$kernel_version" == "$REQUIRED_KERNEL_VERSION" ]]; then - echo "Kernel version is okay, is NPU available?" -else - echo "To install Riallto requires upgrading your kernel to ${REQUIRED_KERNEL_VERSION}" - echo "WARNING: This can be quite disruptive to your system configuration." - echo "After upgrading you will have to restart your machine and rerun this script" - while true; do - read -p "Are you happy to continue? [Y/N] " answer - case $answer in - [Yy]* ) echo "You chose yes, attempting to update kernel"; break;; - [Nn]* ) echo "Exiting"; exit 1;; - * ) echo "Please chose Y or N.";; - esac - done - - # First check to make sure that secure boot is disabled. - if mokutil --sb-state | grep -q "enabled"; then - echo "Secure boot is currently enabled." - echo "To install Riallto on Linux currently requires a" - echo "non-mainline kernel version ${REQUIRED_KERNEL_VERSION}." - echo "If you would like to continue with the installation " - echo "please disable secure boot in your bios settings and rerun this script." - exit 1 - fi - - _kbump_dir=$(mktemp -d) - - wget -P ${_kbump_dir} https://kernel.ubuntu.com/mainline/v$KERNEL_VERSION/amd64/$KERNEL_HEADERS_GENERIC - wget -P ${_kbump_dir} https://kernel.ubuntu.com/mainline/v$KERNEL_VERSION/amd64/$KERNEL_HEADERS - wget -P ${_kbump_dir} https://kernel.ubuntu.com/mainline/v$KERNEL_VERSION/amd64/$KERNEL_IMAGE - wget -P ${_kbump_dir} https://kernel.ubuntu.com/mainline/v$KERNEL_VERSION/amd64/$KERNEL_MODULES - - pushd $_kbump_dir/ - sudo dpkg -i $KERNEL_HEADERS - sudo dpkg -i $KERNEL_HEADERS_GENERIC - sudo dpkg -i $KERNEL_MODULES - sudo dpkg -i $KERNEL_IMAGE - popd - echo -e "\033[31mPlease now restart your machine and rerun the script.\033[0m" - exit 1 -fi if [ -f "./xdna-driver-builder/${DRIVER_TARBALL}" ]; then echo "NPU driver is available, just setting up Riallto" @@ -145,8 +89,7 @@ else fi if [ $build_xrt -eq 1 ]; then - # Building the NPU driver version and installing it - + # Building the NPU driver if [ ! -f "./xdna-driver-builder/${DRIVER_TARBALL}" ]; then echo "xdna-driver-builder/${DRIVER_TARBALL} is missing, building it from scratch" pushd xdna-driver-builder @@ -158,12 +101,12 @@ if [ $build_xrt -eq 1 ]; then fi -# Build the NPU drivers (xdna-driver) +# Install the NPU drivers in the host (xdna-driver) if [ ! -f "${NPU_FIRMWARE}" ]; then npu_install_tmp_dir=$(mktemp -d) tar -xzvf "./xdna-driver-builder/${DRIVER_TARBALL}" -C "${npu_install_tmp_dir}" pushd $npu_install_tmp_dir/root/debs - sudo -E dpkg -i xrt_*-amd64-xrt.deb || true + sudo -E dpkg -i xrt_*-amd64-npu.deb || true sudo -E dpkg -i xrt_plugin*-amdxdna.deb || true sudo apt -y --fix-broken install popd From 678476348b857a4d53dc5aca2378c57c16d501e2 Mon Sep 17 00:00:00 2001 From: Mario Ruiz Date: Wed, 12 Mar 2025 13:00:52 +0000 Subject: [PATCH 10/40] Add tarball name --- scripts/linux/setup_riallto_linux.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/linux/setup_riallto_linux.sh b/scripts/linux/setup_riallto_linux.sh index abf55f1..ad5684f 100755 --- a/scripts/linux/setup_riallto_linux.sh +++ b/scripts/linux/setup_riallto_linux.sh @@ -7,7 +7,7 @@ set -e MLIR_FILE="https://www.xilinx.com/bin/public/openDownload?filename=pynqMLIR_AIE_py312_v0.9.tar.gz" RIALLTO_FILE="https://www.xilinx.com/bin/public/openDownload?filename=Riallto-v1.1.zip" - +DRIVER_TARBALL=ubuntu24.04_npu_drivers.tar.gz ############# CHECKS ################################## # Check to ensure key URLs are accessible From 93ef621b49ae10ebb9d9a30bfb171009c9687d1e Mon Sep 17 00:00:00 2001 From: Mario Ruiz Date: Wed, 12 Mar 2025 13:05:47 +0000 Subject: [PATCH 11/40] Fix ENV --- scripts/linux/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/linux/Dockerfile b/scripts/linux/Dockerfile index ce83644..206dfdb 100644 --- a/scripts/linux/Dockerfile +++ b/scripts/linux/Dockerfile @@ -5,7 +5,7 @@ FROM npubase:latest ARG BUILD_TEMPDIR ARG LIC_MAC=00:00:00:00:00:00 -ENV LIC_MAC=${LIC_MAC} +ENV LIC_MAC ${LIC_MAC} ARG USER_ID ARG GROUP_ID @@ -91,7 +91,7 @@ RUN source ~/.bashrc && python3 -m pip install notebook #Cleanup a bit RUN rm -rf /home/riallto/*.tar.gz -ENV SHELL=/bin/bash +ENV SHELL /bin/bash CMD ["/bin/bash", "-l", "-c", "jupyterhub-singleuser", "--allow-root"] From 0eb37392ccc2ce49290f8bdd7907f1dddc03c981 Mon Sep 17 00:00:00 2001 From: Mario Ruiz Date: Wed, 12 Mar 2025 13:08:00 +0000 Subject: [PATCH 12/40] Bring NPU firmware back --- scripts/linux/setup_riallto_linux.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/linux/setup_riallto_linux.sh b/scripts/linux/setup_riallto_linux.sh index ad5684f..423fa45 100755 --- a/scripts/linux/setup_riallto_linux.sh +++ b/scripts/linux/setup_riallto_linux.sh @@ -5,9 +5,11 @@ set -e +DRIVER_TARBALL=ubuntu24.04_npu_drivers.tar.gz +NPU_FIRMWARE="/lib/firmware/amdnpu/1502_00/npu.sbin" + MLIR_FILE="https://www.xilinx.com/bin/public/openDownload?filename=pynqMLIR_AIE_py312_v0.9.tar.gz" RIALLTO_FILE="https://www.xilinx.com/bin/public/openDownload?filename=Riallto-v1.1.zip" -DRIVER_TARBALL=ubuntu24.04_npu_drivers.tar.gz ############# CHECKS ################################## # Check to ensure key URLs are accessible From abd8c480180e69f73672c0839890d14b4556938b Mon Sep 17 00:00:00 2001 From: Mario Ruiz Date: Wed, 12 Mar 2025 13:20:56 +0000 Subject: [PATCH 13/40] Copy more files --- scripts/linux/xdna-driver-builder/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/linux/xdna-driver-builder/Dockerfile b/scripts/linux/xdna-driver-builder/Dockerfile index f768b20..28d0392 100644 --- a/scripts/linux/xdna-driver-builder/Dockerfile +++ b/scripts/linux/xdna-driver-builder/Dockerfile @@ -37,5 +37,5 @@ RUN cd /root/xdna-driver/xrt/build && ./build.sh -npu -opt # Make a copy of the deb files RUN mkdir /root/debs -RUN cp /root/xdna-driver/xrt/build/Release/xrt_*-amd64-npu.deb /root/debs/ -RUN cp /root/xdna-driver/build/Release/xrt_plugin*.deb /root/debs/ +RUN cp /root/xdna-driver/xrt/build/Release/*.deb /root/debs/ +RUN cp /root/xdna-driver/build/Release/*.deb /root/debs/ From 19e1527607fbce196b2130c310cec33b099694af Mon Sep 17 00:00:00 2001 From: Mario Ruiz Date: Wed, 12 Mar 2025 13:52:20 +0000 Subject: [PATCH 14/40] Add more packages --- scripts/linux/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/linux/Dockerfile b/scripts/linux/Dockerfile index 206dfdb..396c0b3 100644 --- a/scripts/linux/Dockerfile +++ b/scripts/linux/Dockerfile @@ -14,7 +14,7 @@ ARG GROUP_NAME SHELL ["/bin/bash", "-c"] RUN apt-get update -RUN apt-get install -y sudo adduser perl +RUN apt-get install -y sudo adduser perl ocl-icd-libopencl1 RUN deluser --remove-home $(getent passwd | awk -F: -v uid="$USER_ID" '$3 == uid {print $1}') || echo "Ignoring error, as uid:${USER_ID} does not exist" RUN groupadd -g ${GROUP_ID} ${GROUP_NAME} || echo "Ignoring error, as ${GROUP_NAME} already exists" From 3f866aa109bc6c18943948634efaf6a224e839e0 Mon Sep 17 00:00:00 2001 From: Mario Ruiz Date: Wed, 12 Mar 2025 13:52:42 +0000 Subject: [PATCH 15/40] Trying to fix installation --- scripts/linux/setup_riallto_linux.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/linux/setup_riallto_linux.sh b/scripts/linux/setup_riallto_linux.sh index 423fa45..3fbe0fe 100755 --- a/scripts/linux/setup_riallto_linux.sh +++ b/scripts/linux/setup_riallto_linux.sh @@ -108,9 +108,11 @@ if [ ! -f "${NPU_FIRMWARE}" ]; then npu_install_tmp_dir=$(mktemp -d) tar -xzvf "./xdna-driver-builder/${DRIVER_TARBALL}" -C "${npu_install_tmp_dir}" pushd $npu_install_tmp_dir/root/debs + sudo apt -y --fix-broken install + sudo apt install -y ocl-icd-libopencl1 dkms + sudo -E dpkg -i xrt_*-amd64-base.deb sudo -E dpkg -i xrt_*-amd64-npu.deb || true sudo -E dpkg -i xrt_plugin*-amdxdna.deb || true - sudo apt -y --fix-broken install popd fi ######################################################### From 1cef0ae2b265905be840cab49669c5f16cf2dbcf Mon Sep 17 00:00:00 2001 From: Mario Ruiz Date: Wed, 12 Mar 2025 13:53:08 +0000 Subject: [PATCH 16/40] Trying to install xrt on image --- scripts/linux/xdna-driver-builder/Dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/linux/xdna-driver-builder/Dockerfile b/scripts/linux/xdna-driver-builder/Dockerfile index 28d0392..4c50e77 100644 --- a/scripts/linux/xdna-driver-builder/Dockerfile +++ b/scripts/linux/xdna-driver-builder/Dockerfile @@ -9,8 +9,8 @@ RUN apt-get update RUN apt-get install -y --install-recommends linux-generic-hwe-24.04 RUN apt-get install -y linux-headers-$(uname -r) RUN apt-get install -y vim git flex bison make libelf1t64 -RUN apt-get install -y dpkg-dev libelf-dev zstd -RUN apt-get install -y bc debhelper rsync kmod cpio libssl-dev:native +RUN apt-get install -y dpkg-dev libelf-dev zstd ocl-icd-libopencl1 +RUN apt-get install -y bc debhelper rsync kmod cpio libssl-dev:native dkms RUN git config --global http.postBuffer 157286400 @@ -32,8 +32,9 @@ RUN cd /root/xdna-driver/build && ./build.sh -package RUN cd /root/xdna-driver/xrt/build && ./build.sh -npu -opt ## Install xdna-driver -#RUN -E dpkg -i /root/xdna-driver/xrt/build/Release/xrt_*-amd64-npu.deb -#RUN -E dpkg -i /root/xdna-driver/build/Release/xrt_plugin*-amdxdna.deb +RUN apt-get -y --fix-broken install +RUN -E dpkg -i /root/xdna-driver/xrt/build/Release/xrt_*-amd64-npu.deb +RUN -E dpkg -i /root/xdna-driver/build/Release/xrt_plugin*-amdxdna.deb # Make a copy of the deb files RUN mkdir /root/debs From 3e1e844a80b4317067a92903a4372a0d9cef4177 Mon Sep 17 00:00:00 2001 From: Mario Ruiz Date: Wed, 12 Mar 2025 15:12:18 +0000 Subject: [PATCH 17/40] Trying to install base --- scripts/linux/xdna-driver-builder/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/linux/xdna-driver-builder/Dockerfile b/scripts/linux/xdna-driver-builder/Dockerfile index 4c50e77..00eacbc 100644 --- a/scripts/linux/xdna-driver-builder/Dockerfile +++ b/scripts/linux/xdna-driver-builder/Dockerfile @@ -33,6 +33,7 @@ RUN cd /root/xdna-driver/xrt/build && ./build.sh -npu -opt ## Install xdna-driver RUN apt-get -y --fix-broken install +RUN -E dpkg -i /root/xdna-driver/xrt/build/Release/xrt_*-amd64-base.deb RUN -E dpkg -i /root/xdna-driver/xrt/build/Release/xrt_*-amd64-npu.deb RUN -E dpkg -i /root/xdna-driver/build/Release/xrt_plugin*-amdxdna.deb From e6c3af2ae36ef5dc5d50a30bd93c71b2afb915da Mon Sep 17 00:00:00 2001 From: Mario Ruiz Date: Wed, 12 Mar 2025 15:18:52 +0000 Subject: [PATCH 18/40] Other way of installing --- scripts/linux/xdna-driver-builder/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/linux/xdna-driver-builder/Dockerfile b/scripts/linux/xdna-driver-builder/Dockerfile index 00eacbc..a0fb5c1 100644 --- a/scripts/linux/xdna-driver-builder/Dockerfile +++ b/scripts/linux/xdna-driver-builder/Dockerfile @@ -33,9 +33,9 @@ RUN cd /root/xdna-driver/xrt/build && ./build.sh -npu -opt ## Install xdna-driver RUN apt-get -y --fix-broken install -RUN -E dpkg -i /root/xdna-driver/xrt/build/Release/xrt_*-amd64-base.deb -RUN -E dpkg -i /root/xdna-driver/xrt/build/Release/xrt_*-amd64-npu.deb -RUN -E dpkg -i /root/xdna-driver/build/Release/xrt_plugin*-amdxdna.deb +RUN dpkg -i /root/xdna-driver/xrt/build/Release/xrt_*-amd64-base.deb +RUN dpkg -i /root/xdna-driver/xrt/build/Release/xrt_*-amd64-npu.deb +RUN dpkg -i /root/xdna-driver/build/Release/xrt_plugin*-amdxdna.deb # Make a copy of the deb files RUN mkdir /root/debs From 61dff55e2b859d1f78ac8c3bf3178134260766de Mon Sep 17 00:00:00 2001 From: Mario Ruiz Date: Wed, 12 Mar 2025 15:24:13 +0000 Subject: [PATCH 19/40] Install driver --- scripts/linux/Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/linux/Dockerfile b/scripts/linux/Dockerfile index 396c0b3..5187dc6 100644 --- a/scripts/linux/Dockerfile +++ b/scripts/linux/Dockerfile @@ -1,7 +1,7 @@ # Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved. # SPDX-License-Identifier: MIT -FROM npubase:latest +FROM ubuntu:24.04 ARG BUILD_TEMPDIR ARG LIC_MAC=00:00:00:00:00:00 @@ -39,7 +39,7 @@ ENV LC_ALL en_US.UTF-8 RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC sudo -E apt-get install -y tzdata RUN git clone https://github.com/amd/xdna-driver.git --recursive -RUN cd xdna-driver/ && git checkout f60608b +RUN cd xdna-driver/ && git checkout 1e1c63f RUN cd xdna-driver/ && git submodule update --recursive RUN sudo chmod +x /home/riallto/xdna-driver/xrt/src/runtime_src/tools/scripts/xrtdeps.sh RUN sudo /home/riallto/xdna-driver/xrt/src/runtime_src/tools/scripts/xrtdeps.sh -docker @@ -49,6 +49,7 @@ COPY $BUILD_TEMPDIR/root/debs npu_ubuntu_debs RUN sudo apt-get install -y dkms udev python3 RUN sudo apt-get install -y python3-pip ocl-icd-opencl-dev uuid-dev libopencv-dev python3-opencv +RUN sudo -E dpkg -i npu_ubuntu_debs/xrt_*-amd64-base.deb RUN sudo -E dpkg -i npu_ubuntu_debs/xrt_*-amd64-npu.deb RUN sudo -E dpkg -i npu_ubuntu_debs/xrt_plugin*-amdxdna.deb From 704e54060ba7f32238298fb9eee9064940247a66 Mon Sep 17 00:00:00 2001 From: Mario Ruiz Date: Wed, 12 Mar 2025 15:37:17 +0000 Subject: [PATCH 20/40] More updates --- scripts/linux/Dockerfile | 1 - scripts/linux/setup_riallto_linux.sh | 2 +- scripts/linux/xdna-driver-builder/Dockerfile | 6 ------ scripts/linux/xdna-driver-builder/build.sh | 1 + 4 files changed, 2 insertions(+), 8 deletions(-) diff --git a/scripts/linux/Dockerfile b/scripts/linux/Dockerfile index 5187dc6..a6c4b05 100644 --- a/scripts/linux/Dockerfile +++ b/scripts/linux/Dockerfile @@ -95,4 +95,3 @@ RUN rm -rf /home/riallto/*.tar.gz ENV SHELL /bin/bash CMD ["/bin/bash", "-l", "-c", "jupyterhub-singleuser", "--allow-root"] - diff --git a/scripts/linux/setup_riallto_linux.sh b/scripts/linux/setup_riallto_linux.sh index 3fbe0fe..98494e2 100755 --- a/scripts/linux/setup_riallto_linux.sh +++ b/scripts/linux/setup_riallto_linux.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved. # SPDX-License-Identifier: MIT set -e diff --git a/scripts/linux/xdna-driver-builder/Dockerfile b/scripts/linux/xdna-driver-builder/Dockerfile index a0fb5c1..d32810d 100644 --- a/scripts/linux/xdna-driver-builder/Dockerfile +++ b/scripts/linux/xdna-driver-builder/Dockerfile @@ -31,12 +31,6 @@ RUN cd /root/xdna-driver/build && ./build.sh -package RUN cd /root/xdna-driver/xrt/build && ./build.sh -npu -opt -## Install xdna-driver -RUN apt-get -y --fix-broken install -RUN dpkg -i /root/xdna-driver/xrt/build/Release/xrt_*-amd64-base.deb -RUN dpkg -i /root/xdna-driver/xrt/build/Release/xrt_*-amd64-npu.deb -RUN dpkg -i /root/xdna-driver/build/Release/xrt_plugin*-amdxdna.deb - # Make a copy of the deb files RUN mkdir /root/debs RUN cp /root/xdna-driver/xrt/build/Release/*.deb /root/debs/ diff --git a/scripts/linux/xdna-driver-builder/build.sh b/scripts/linux/xdna-driver-builder/build.sh index b9fbfb1..e60ee2a 100755 --- a/scripts/linux/xdna-driver-builder/build.sh +++ b/scripts/linux/xdna-driver-builder/build.sh @@ -23,3 +23,4 @@ docker exec npubase_build_container bash -c "tar -zcvf driver.tar.gz /root/debs ## cleanup docker kill npubase_build_container || true +docker image rm --force npubase:latest \ No newline at end of file From 36f692a66c5628613923d85189edd216b3ef5248 Mon Sep 17 00:00:00 2001 From: Mario Ruiz Date: Wed, 12 Mar 2025 16:13:30 +0000 Subject: [PATCH 21/40] Update instructions --- scripts/linux/README.md | 44 +++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/scripts/linux/README.md b/scripts/linux/README.md index c481a3a..633b84a 100644 --- a/scripts/linux/README.md +++ b/scripts/linux/README.md @@ -1,55 +1,51 @@ -# Riallto Ubuntu 24.04 setup +# Riallto Ubuntu 24.04.2 setup -Currently there is support for bringing up Riallto on Ubuntu 24.04 with docker. +Currently there is support for bringing up Riallto on Ubuntu 24.04.2 with docker. To use Riallto on Linux requires the use of the [xdna-driver](https://github.com/amd/xdna-driver) which is installed as part of the setup. -This driver requires version 6.10+ of the Linux kernel, these scripts will upgrade a standard Ubuntu 24.04 installation to this kernel version. __Using this kernel version will require disabling secure boot on your device.__ +This driver requires version 6.10+ of the Linux kernel, we ask you to first upgrade to Ubuntu 24.04.2 from a Ubuntu 24.04 installation to install a 6.11 kernel. __Using this kernel version will require disabling secure boot on your device.__ ## Install steps On an NPU enabled laptop running Ubuntu 24.04. -1. __Setup Docker.__ +1. **Upgrade to Ubuntu 24.04.2** -You can follow the steps [here](https://docs.docker.com/engine/install/ubuntu/). + ```sh + sudo apt update + sudo apt install --install-recommends linux-generic-hwe-24.04 + sudo reboot + ``` + +2. **Setup Docker** + + You can follow the steps [here](https://docs.docker.com/engine/install/ubuntu/). -2. __Add your user to the docker user group and then relogin.__ +3. **Add your user to the docker user group and then relogin** ```sh sudo usermod -aG docker $USER ; exit ``` -3. __Obtain a license file for Riallto.__ +4. **Obtain a license file for Riallto** Please follow the [guide here](https://riallto.ai/prerequisites-aie-license.html#prerequisites-aie-license) to get the license. -4. __Disable secure boot from your BIOS settings.__ +5. **Disable secure boot from your BIOS settings** For now we are using an unsigned kernel version requiring that secure boot is disabled before it can be used. To disable secure boot there is a [guide](https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/disabling-secure-boot?view=windows-11) from Microsoft here, but often the steps depend on your hardware manufacturer. -5. __Clone the `Riallto` repository and then navigate to the installation script.__ +6. **Clone the `Riallto` repository and then navigate to the installation script** ```sh - git clone https://github.com/AMDResearch/Riallto.git -b v1.1 + git clone https://github.com/AMDResearch/Riallto.git -b v1.1.1 cd Riallto/scripts/linux/ ``` ```{note} - We recommend using the tag v1.1 to get the verified version of Riallto. Install from `main` to get the latest drivers and code, however, this is not thoroughly verified. + We recommend using the tag v1.1.1 to get the verified version of Riallto. Install from `main` to get the latest drivers and code, however, this is not thoroughly verified. ``` -6. __Upgrade Linux Kernel.__ - - ```sh - ./setup_riallto_linux.sh - ``` - - This command will check the kernel version and if the `xdna-driver` has been installed. If the Linux kernel is not `6.10` or the NPU device drivers are missing, it will build them within a docker and install them on the host machine. This takes about 10 minutes to run and after completing successfully the user will be asked to restart. - -7. __Reboot the machine.__ - - This will finish upgrading the Linux kernel to `6.10`. - -8. __Install Riallto by creating its Docker container.__ +7. **Install Riallto by creating its Docker container** ```sh ./setup_riallto_linux.sh From d61e18c9fa70f2053b65d1e394bd99c19b57915b Mon Sep 17 00:00:00 2001 From: Mario Ruiz Date: Wed, 12 Mar 2025 17:37:28 +0000 Subject: [PATCH 22/40] Try something different --- scripts/linux/xdna-driver-builder/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/linux/xdna-driver-builder/Dockerfile b/scripts/linux/xdna-driver-builder/Dockerfile index d32810d..c96bcc1 100644 --- a/scripts/linux/xdna-driver-builder/Dockerfile +++ b/scripts/linux/xdna-driver-builder/Dockerfile @@ -29,7 +29,7 @@ RUN /root/xdna-driver/xrt/src/runtime_src/tools/scripts/xrtdeps.sh -docker RUN cd /root/xdna-driver/build && ./build.sh -release RUN cd /root/xdna-driver/build && ./build.sh -package -RUN cd /root/xdna-driver/xrt/build && ./build.sh -npu -opt +RUN cd /root/xdna-driver/xrt/build && ./build.sh -noert # Make a copy of the deb files RUN mkdir /root/debs From cce4e10ad17b0e0af0c396a18b62a78594874e6b Mon Sep 17 00:00:00 2001 From: Mario Ruiz Date: Wed, 12 Mar 2025 17:55:17 +0000 Subject: [PATCH 23/40] Update path --- scripts/linux/setup_riallto_linux.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/linux/setup_riallto_linux.sh b/scripts/linux/setup_riallto_linux.sh index 98494e2..da0f2d2 100755 --- a/scripts/linux/setup_riallto_linux.sh +++ b/scripts/linux/setup_riallto_linux.sh @@ -134,14 +134,14 @@ GROUP_ID=`id -g $USER_NAME` GROUP_NAME=`id -g -n $USER_NAME` ## Checks to make sure that all the required tarballs and license are in the directory -if [ ! -f "./pynqMLIR-AIE.tar.gz" ]; then +if [ ! -f "./build_tmp/pynqMLIR-AIE.tar.gz" ]; then echo "Error! pynqMLIR-AIE.tar.gz is missing, downloading from opendownloads..." wget -O $build_tmp/pynqMLIR-AIE.tar.gz $MLIR_FILE else cp pynqMLIR-AIE.tar.gz $build_tmp fi -if [ ! -f "./xilinx_tools.tar.gz" ]; then +if [ ! -f "./build_tmp/xilinx_tools.tar.gz" ]; then echo "xilinx_tools.tar.gz is missing, downloading it from opendownloads..." wget -O $build_tmp/riallto_installer.zip $RIALLTO_FILE pushd $build_tmp From c7e3b25fd9abbf63ebcd524d8881f2cfa6528f33 Mon Sep 17 00:00:00 2001 From: Mario Ruiz Date: Wed, 12 Mar 2025 17:55:31 +0000 Subject: [PATCH 24/40] Upgrade distribution --- scripts/linux/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/linux/Dockerfile b/scripts/linux/Dockerfile index a6c4b05..6a56902 100644 --- a/scripts/linux/Dockerfile +++ b/scripts/linux/Dockerfile @@ -14,6 +14,7 @@ ARG GROUP_NAME SHELL ["/bin/bash", "-c"] RUN apt-get update +RUN apt-get install -y --install-recommends linux-generic-hwe-24.04 RUN apt-get install -y sudo adduser perl ocl-icd-libopencl1 RUN deluser --remove-home $(getent passwd | awk -F: -v uid="$USER_ID" '$3 == uid {print $1}') || echo "Ignoring error, as uid:${USER_ID} does not exist" From caa11d035e8294cb1db2c3f273c8a7a2c011c688 Mon Sep 17 00:00:00 2001 From: Mario Ruiz Date: Wed, 12 Mar 2025 18:01:49 +0000 Subject: [PATCH 25/40] Update install --- scripts/linux/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/linux/Dockerfile b/scripts/linux/Dockerfile index 6a56902..e01e84f 100644 --- a/scripts/linux/Dockerfile +++ b/scripts/linux/Dockerfile @@ -50,8 +50,8 @@ COPY $BUILD_TEMPDIR/root/debs npu_ubuntu_debs RUN sudo apt-get install -y dkms udev python3 RUN sudo apt-get install -y python3-pip ocl-icd-opencl-dev uuid-dev libopencv-dev python3-opencv -RUN sudo -E dpkg -i npu_ubuntu_debs/xrt_*-amd64-base.deb -RUN sudo -E dpkg -i npu_ubuntu_debs/xrt_*-amd64-npu.deb +#RUN sudo -E dpkg -i npu_ubuntu_debs/xrt_*-amd64-base.deb +RUN sudo -E dpkg -i npu_ubuntu_debs/xrt_*-amd64-xrt.deb RUN sudo -E dpkg -i npu_ubuntu_debs/xrt_plugin*-amdxdna.deb RUN git clone https://github.com/AMDResearch/Riallto --depth=1 From c414c5adc58d3439baee8c16be5463cf07c655f1 Mon Sep 17 00:00:00 2001 From: Mario Ruiz Date: Wed, 12 Mar 2025 18:03:48 +0000 Subject: [PATCH 26/40] Build just npu --- scripts/linux/Dockerfile | 2 +- scripts/linux/setup_riallto_linux.sh | 2 +- scripts/linux/xdna-driver-builder/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/linux/Dockerfile b/scripts/linux/Dockerfile index e01e84f..6127483 100644 --- a/scripts/linux/Dockerfile +++ b/scripts/linux/Dockerfile @@ -50,7 +50,7 @@ COPY $BUILD_TEMPDIR/root/debs npu_ubuntu_debs RUN sudo apt-get install -y dkms udev python3 RUN sudo apt-get install -y python3-pip ocl-icd-opencl-dev uuid-dev libopencv-dev python3-opencv -#RUN sudo -E dpkg -i npu_ubuntu_debs/xrt_*-amd64-base.deb +RUN sudo -E dpkg -i npu_ubuntu_debs/xrt_*-amd64-base.deb RUN sudo -E dpkg -i npu_ubuntu_debs/xrt_*-amd64-xrt.deb RUN sudo -E dpkg -i npu_ubuntu_debs/xrt_plugin*-amdxdna.deb diff --git a/scripts/linux/setup_riallto_linux.sh b/scripts/linux/setup_riallto_linux.sh index da0f2d2..a5a8fb9 100755 --- a/scripts/linux/setup_riallto_linux.sh +++ b/scripts/linux/setup_riallto_linux.sh @@ -111,7 +111,7 @@ if [ ! -f "${NPU_FIRMWARE}" ]; then sudo apt -y --fix-broken install sudo apt install -y ocl-icd-libopencl1 dkms sudo -E dpkg -i xrt_*-amd64-base.deb - sudo -E dpkg -i xrt_*-amd64-npu.deb || true + sudo -E dpkg -i xrt_*-amd64-xrt.deb || true sudo -E dpkg -i xrt_plugin*-amdxdna.deb || true popd fi diff --git a/scripts/linux/xdna-driver-builder/Dockerfile b/scripts/linux/xdna-driver-builder/Dockerfile index c96bcc1..d32810d 100644 --- a/scripts/linux/xdna-driver-builder/Dockerfile +++ b/scripts/linux/xdna-driver-builder/Dockerfile @@ -29,7 +29,7 @@ RUN /root/xdna-driver/xrt/src/runtime_src/tools/scripts/xrtdeps.sh -docker RUN cd /root/xdna-driver/build && ./build.sh -release RUN cd /root/xdna-driver/build && ./build.sh -package -RUN cd /root/xdna-driver/xrt/build && ./build.sh -noert +RUN cd /root/xdna-driver/xrt/build && ./build.sh -npu -opt # Make a copy of the deb files RUN mkdir /root/debs From cff0e980141beffcb86983c96f50b50a27162ad9 Mon Sep 17 00:00:00 2001 From: Mario Ruiz Date: Wed, 12 Mar 2025 18:08:30 +0000 Subject: [PATCH 27/40] Fix installer --- scripts/linux/Dockerfile | 2 +- scripts/linux/setup_riallto_linux.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/linux/Dockerfile b/scripts/linux/Dockerfile index 6127483..6a56902 100644 --- a/scripts/linux/Dockerfile +++ b/scripts/linux/Dockerfile @@ -51,7 +51,7 @@ RUN sudo apt-get install -y dkms udev python3 RUN sudo apt-get install -y python3-pip ocl-icd-opencl-dev uuid-dev libopencv-dev python3-opencv RUN sudo -E dpkg -i npu_ubuntu_debs/xrt_*-amd64-base.deb -RUN sudo -E dpkg -i npu_ubuntu_debs/xrt_*-amd64-xrt.deb +RUN sudo -E dpkg -i npu_ubuntu_debs/xrt_*-amd64-npu.deb RUN sudo -E dpkg -i npu_ubuntu_debs/xrt_plugin*-amdxdna.deb RUN git clone https://github.com/AMDResearch/Riallto --depth=1 diff --git a/scripts/linux/setup_riallto_linux.sh b/scripts/linux/setup_riallto_linux.sh index a5a8fb9..da0f2d2 100755 --- a/scripts/linux/setup_riallto_linux.sh +++ b/scripts/linux/setup_riallto_linux.sh @@ -111,7 +111,7 @@ if [ ! -f "${NPU_FIRMWARE}" ]; then sudo apt -y --fix-broken install sudo apt install -y ocl-icd-libopencl1 dkms sudo -E dpkg -i xrt_*-amd64-base.deb - sudo -E dpkg -i xrt_*-amd64-xrt.deb || true + sudo -E dpkg -i xrt_*-amd64-npu.deb || true sudo -E dpkg -i xrt_plugin*-amdxdna.deb || true popd fi From ee63082e6542285662e7c3ad9103aef1fb6a3ed0 Mon Sep 17 00:00:00 2001 From: Mario Ruiz Date: Wed, 12 Mar 2025 18:25:24 +0000 Subject: [PATCH 28/40] Temporary remove --- scripts/linux/setup_riallto_linux.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/linux/setup_riallto_linux.sh b/scripts/linux/setup_riallto_linux.sh index da0f2d2..f5f9cc0 100755 --- a/scripts/linux/setup_riallto_linux.sh +++ b/scripts/linux/setup_riallto_linux.sh @@ -153,14 +153,14 @@ else cp xilinx_tools.tar.gz $build_tmp fi -while true; do - read -p "Do you agree to the terms in ./eula.txt and wish to proceed [y/n]? " answer - case $answer in - [Yy]* ) echo "Terms accepted"; break;; - [Nn]* ) echo "Exiting"; exit 1;; - * ) echo "Please chose Y or N.";; - esac -done +# while true; do +# read -p "Do you agree to the terms in ./eula.txt and wish to proceed [y/n]? " answer +# case $answer in +# [Yy]* ) echo "Terms accepted"; break;; +# [Nn]* ) echo "Exiting"; exit 1;; +# * ) echo "Please chose Y or N.";; +# esac +# done cp $LIC_FILE $build_tmp/Xilinx.lic From 9e3ec1ef731c0ab6315f3d0ff185e8d88c1fd660 Mon Sep 17 00:00:00 2001 From: Mario Ruiz Date: Wed, 12 Mar 2025 18:30:43 +0000 Subject: [PATCH 29/40] Align with MLIR --- scripts/linux/Dockerfile | 2 +- scripts/linux/xdna-driver-builder/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/linux/Dockerfile b/scripts/linux/Dockerfile index 6a56902..33573b5 100644 --- a/scripts/linux/Dockerfile +++ b/scripts/linux/Dockerfile @@ -40,7 +40,7 @@ ENV LC_ALL en_US.UTF-8 RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC sudo -E apt-get install -y tzdata RUN git clone https://github.com/amd/xdna-driver.git --recursive -RUN cd xdna-driver/ && git checkout 1e1c63f +RUN cd xdna-driver/ && git checkout 7c1d273ef9946848a9f236f1216cfda10d9465cb RUN cd xdna-driver/ && git submodule update --recursive RUN sudo chmod +x /home/riallto/xdna-driver/xrt/src/runtime_src/tools/scripts/xrtdeps.sh RUN sudo /home/riallto/xdna-driver/xrt/src/runtime_src/tools/scripts/xrtdeps.sh -docker diff --git a/scripts/linux/xdna-driver-builder/Dockerfile b/scripts/linux/xdna-driver-builder/Dockerfile index d32810d..424dad9 100644 --- a/scripts/linux/xdna-driver-builder/Dockerfile +++ b/scripts/linux/xdna-driver-builder/Dockerfile @@ -18,7 +18,7 @@ RUN git config --global http.postBuffer 157286400 RUN git config --global url."https://github.com/".insteadOf "git@github.com:" RUN cd /root && git clone https://github.com/amd/xdna-driver.git --recursive -RUN cd /root/xdna-driver && git checkout 1e1c63f +RUN cd /root/xdna-driver && git checkout 7c1d273ef9946848a9f236f1216cfda10d9465cb RUN cd /root/xdna-driver && git submodule update --recursive RUN apt-get install -y cmake jq pkg-config wget libdrm-dev From b8c80c505ad7a41175e4aa99c4e34d0285557630 Mon Sep 17 00:00:00 2001 From: Mario Ruiz Date: Wed, 12 Mar 2025 18:38:23 +0000 Subject: [PATCH 30/40] Remove base --- scripts/linux/Dockerfile | 2 +- scripts/linux/setup_riallto_linux.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/linux/Dockerfile b/scripts/linux/Dockerfile index 33573b5..4a5af5f 100644 --- a/scripts/linux/Dockerfile +++ b/scripts/linux/Dockerfile @@ -50,7 +50,7 @@ COPY $BUILD_TEMPDIR/root/debs npu_ubuntu_debs RUN sudo apt-get install -y dkms udev python3 RUN sudo apt-get install -y python3-pip ocl-icd-opencl-dev uuid-dev libopencv-dev python3-opencv -RUN sudo -E dpkg -i npu_ubuntu_debs/xrt_*-amd64-base.deb +#RUN sudo -E dpkg -i npu_ubuntu_debs/xrt_*-amd64-base.deb RUN sudo -E dpkg -i npu_ubuntu_debs/xrt_*-amd64-npu.deb RUN sudo -E dpkg -i npu_ubuntu_debs/xrt_plugin*-amdxdna.deb diff --git a/scripts/linux/setup_riallto_linux.sh b/scripts/linux/setup_riallto_linux.sh index f5f9cc0..d5f2163 100755 --- a/scripts/linux/setup_riallto_linux.sh +++ b/scripts/linux/setup_riallto_linux.sh @@ -110,7 +110,7 @@ if [ ! -f "${NPU_FIRMWARE}" ]; then pushd $npu_install_tmp_dir/root/debs sudo apt -y --fix-broken install sudo apt install -y ocl-icd-libopencl1 dkms - sudo -E dpkg -i xrt_*-amd64-base.deb + #sudo -E dpkg -i xrt_*-amd64-base.deb sudo -E dpkg -i xrt_*-amd64-npu.deb || true sudo -E dpkg -i xrt_plugin*-amdxdna.deb || true popd From 62f89c74de6d88af6927d3d3fd3bcada43e7327c Mon Sep 17 00:00:00 2001 From: Mario Ruiz Date: Wed, 12 Mar 2025 18:47:01 +0000 Subject: [PATCH 31/40] Bring agreement back --- scripts/linux/setup_riallto_linux.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/linux/setup_riallto_linux.sh b/scripts/linux/setup_riallto_linux.sh index d5f2163..3f87ce2 100755 --- a/scripts/linux/setup_riallto_linux.sh +++ b/scripts/linux/setup_riallto_linux.sh @@ -153,14 +153,14 @@ else cp xilinx_tools.tar.gz $build_tmp fi -# while true; do -# read -p "Do you agree to the terms in ./eula.txt and wish to proceed [y/n]? " answer -# case $answer in -# [Yy]* ) echo "Terms accepted"; break;; -# [Nn]* ) echo "Exiting"; exit 1;; -# * ) echo "Please chose Y or N.";; -# esac -# done +while true; do + read -p "Do you agree to the terms in ./eula.txt and wish to proceed [y/n]? " answer + case $answer in + [Yy]* ) echo "Terms accepted"; break;; + [Nn]* ) echo "Exiting"; exit 1;; + * ) echo "Please chose Y or N.";; + esac +done cp $LIC_FILE $build_tmp/Xilinx.lic From 0a4176f6375fa658e436f1bbb0fbb6223ef1e09a Mon Sep 17 00:00:00 2001 From: Mario Ruiz Date: Wed, 12 Mar 2025 18:50:48 +0000 Subject: [PATCH 32/40] Remove unused lines --- scripts/linux/Dockerfile | 1 - scripts/linux/setup_riallto_linux.sh | 1 - 2 files changed, 2 deletions(-) diff --git a/scripts/linux/Dockerfile b/scripts/linux/Dockerfile index 4a5af5f..4bc03c0 100644 --- a/scripts/linux/Dockerfile +++ b/scripts/linux/Dockerfile @@ -50,7 +50,6 @@ COPY $BUILD_TEMPDIR/root/debs npu_ubuntu_debs RUN sudo apt-get install -y dkms udev python3 RUN sudo apt-get install -y python3-pip ocl-icd-opencl-dev uuid-dev libopencv-dev python3-opencv -#RUN sudo -E dpkg -i npu_ubuntu_debs/xrt_*-amd64-base.deb RUN sudo -E dpkg -i npu_ubuntu_debs/xrt_*-amd64-npu.deb RUN sudo -E dpkg -i npu_ubuntu_debs/xrt_plugin*-amdxdna.deb diff --git a/scripts/linux/setup_riallto_linux.sh b/scripts/linux/setup_riallto_linux.sh index 3f87ce2..d72e791 100755 --- a/scripts/linux/setup_riallto_linux.sh +++ b/scripts/linux/setup_riallto_linux.sh @@ -110,7 +110,6 @@ if [ ! -f "${NPU_FIRMWARE}" ]; then pushd $npu_install_tmp_dir/root/debs sudo apt -y --fix-broken install sudo apt install -y ocl-icd-libopencl1 dkms - #sudo -E dpkg -i xrt_*-amd64-base.deb sudo -E dpkg -i xrt_*-amd64-npu.deb || true sudo -E dpkg -i xrt_plugin*-amdxdna.deb || true popd From 7ad02b03388d13572fb1803b43e93fb1c7f554d1 Mon Sep 17 00:00:00 2001 From: Mario Ruiz Date: Fri, 28 Mar 2025 15:16:06 +0000 Subject: [PATCH 33/40] Check that secure boot is disabled --- scripts/linux/README.md | 2 ++ scripts/linux/setup_riallto_linux.sh | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/scripts/linux/README.md b/scripts/linux/README.md index 633b84a..9689b3d 100644 --- a/scripts/linux/README.md +++ b/scripts/linux/README.md @@ -106,6 +106,8 @@ This means that secure boot has not been disabled from the machine and it cannot ### If the Docker container does not start with `launch_jupyter.sh` or `run_pytest.sh` because of the `/dev/accel/accel0` does not exist +First of all, confirm that secure boot is disabled on the BIOS. + Check `dmesg` ```sh diff --git a/scripts/linux/setup_riallto_linux.sh b/scripts/linux/setup_riallto_linux.sh index d72e791..22f4ee9 100755 --- a/scripts/linux/setup_riallto_linux.sh +++ b/scripts/linux/setup_riallto_linux.sh @@ -83,6 +83,16 @@ echo "Found a License file associated with MAC address $MAC" # Check to see if the kernel version and NPU driver is already installed build_xrt=0 + +# First check to make sure that secure boot is disabled. +if mokutil --sb-state | grep -q "enabled"; then + echo "Secure boot is currently enabled." + echo "To install Riallto on Linux currently requires to compile the XDNA driver." + echo "If you would like to continue with the installation " + echo "please disable secure boot in your BIOS settings and rerun this script." + exit 1 +fi + if [ -f "./xdna-driver-builder/${DRIVER_TARBALL}" ]; then echo "NPU driver is available, just setting up Riallto" build_xrt=0; From 6f42eb5a11db3c05d3c7555f0c77f8d097eba7f4 Mon Sep 17 00:00:00 2001 From: Mario Ruiz Date: Mon, 7 Apr 2025 12:02:59 +0100 Subject: [PATCH 34/40] Align with MLIR-AIE commit --- scripts/linux/Dockerfile | 5 +++-- scripts/linux/setup_riallto_linux.sh | 4 +++- scripts/linux/xdna-driver-builder/Dockerfile | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/linux/Dockerfile b/scripts/linux/Dockerfile index 4bc03c0..4f02bdd 100644 --- a/scripts/linux/Dockerfile +++ b/scripts/linux/Dockerfile @@ -40,7 +40,7 @@ ENV LC_ALL en_US.UTF-8 RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC sudo -E apt-get install -y tzdata RUN git clone https://github.com/amd/xdna-driver.git --recursive -RUN cd xdna-driver/ && git checkout 7c1d273ef9946848a9f236f1216cfda10d9465cb +RUN cd xdna-driver/ && git checkout deceb066418f2d53fe172a595f59413a731ccee8 RUN cd xdna-driver/ && git submodule update --recursive RUN sudo chmod +x /home/riallto/xdna-driver/xrt/src/runtime_src/tools/scripts/xrtdeps.sh RUN sudo /home/riallto/xdna-driver/xrt/src/runtime_src/tools/scripts/xrtdeps.sh -docker @@ -50,7 +50,8 @@ COPY $BUILD_TEMPDIR/root/debs npu_ubuntu_debs RUN sudo apt-get install -y dkms udev python3 RUN sudo apt-get install -y python3-pip ocl-icd-opencl-dev uuid-dev libopencv-dev python3-opencv -RUN sudo -E dpkg -i npu_ubuntu_debs/xrt_*-amd64-npu.deb +RUN sudo -E dpkg -i npu_ubuntu_debs/xrt_*-amd64-base.deb +RUN sudo -E dpkg -i npu_ubuntu_debs/xrt_*-amd64-base-dev.deb RUN sudo -E dpkg -i npu_ubuntu_debs/xrt_plugin*-amdxdna.deb RUN git clone https://github.com/AMDResearch/Riallto --depth=1 diff --git a/scripts/linux/setup_riallto_linux.sh b/scripts/linux/setup_riallto_linux.sh index 22f4ee9..7b5e47e 100755 --- a/scripts/linux/setup_riallto_linux.sh +++ b/scripts/linux/setup_riallto_linux.sh @@ -118,9 +118,11 @@ if [ ! -f "${NPU_FIRMWARE}" ]; then npu_install_tmp_dir=$(mktemp -d) tar -xzvf "./xdna-driver-builder/${DRIVER_TARBALL}" -C "${npu_install_tmp_dir}" pushd $npu_install_tmp_dir/root/debs + sudo remove -y xrt* sudo apt -y --fix-broken install sudo apt install -y ocl-icd-libopencl1 dkms - sudo -E dpkg -i xrt_*-amd64-npu.deb || true + sudo -E dpkg -i xrt_*-amd64-base.deb || true + sudo -E dpkg -i xrt_*-amd64-base-dev.deb || true sudo -E dpkg -i xrt_plugin*-amdxdna.deb || true popd fi diff --git a/scripts/linux/xdna-driver-builder/Dockerfile b/scripts/linux/xdna-driver-builder/Dockerfile index 424dad9..d2d8d4e 100644 --- a/scripts/linux/xdna-driver-builder/Dockerfile +++ b/scripts/linux/xdna-driver-builder/Dockerfile @@ -18,7 +18,7 @@ RUN git config --global http.postBuffer 157286400 RUN git config --global url."https://github.com/".insteadOf "git@github.com:" RUN cd /root && git clone https://github.com/amd/xdna-driver.git --recursive -RUN cd /root/xdna-driver && git checkout 7c1d273ef9946848a9f236f1216cfda10d9465cb +RUN cd /root/xdna-driver && git checkout deceb066418f2d53fe172a595f59413a731ccee8 RUN cd /root/xdna-driver && git submodule update --recursive RUN apt-get install -y cmake jq pkg-config wget libdrm-dev From bd8b23a8a820d929784950b4cb13af22cf748d38 Mon Sep 17 00:00:00 2001 From: Mario Ruiz Date: Mon, 7 Apr 2025 12:26:38 +0100 Subject: [PATCH 35/40] Fix remove part --- scripts/linux/setup_riallto_linux.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/linux/setup_riallto_linux.sh b/scripts/linux/setup_riallto_linux.sh index 7b5e47e..266b68b 100755 --- a/scripts/linux/setup_riallto_linux.sh +++ b/scripts/linux/setup_riallto_linux.sh @@ -118,7 +118,8 @@ if [ ! -f "${NPU_FIRMWARE}" ]; then npu_install_tmp_dir=$(mktemp -d) tar -xzvf "./xdna-driver-builder/${DRIVER_TARBALL}" -C "${npu_install_tmp_dir}" pushd $npu_install_tmp_dir/root/debs - sudo remove -y xrt* + packages=$(dpkg -l | awk '/^ii/ && $2 ~ /^xrt/ { print $2 }') + sudo apt remove -y $packages sudo apt -y --fix-broken install sudo apt install -y ocl-icd-libopencl1 dkms sudo -E dpkg -i xrt_*-amd64-base.deb || true From 6dfad47707096f410b26ba182a2b56b021e264db Mon Sep 17 00:00:00 2001 From: Mario Ruiz Date: Mon, 7 Apr 2025 13:07:35 +0100 Subject: [PATCH 36/40] Revert commit --- scripts/linux/Dockerfile | 5 ++--- scripts/linux/setup_riallto_linux.sh | 3 +-- scripts/linux/xdna-driver-builder/Dockerfile | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/scripts/linux/Dockerfile b/scripts/linux/Dockerfile index 4f02bdd..4bc03c0 100644 --- a/scripts/linux/Dockerfile +++ b/scripts/linux/Dockerfile @@ -40,7 +40,7 @@ ENV LC_ALL en_US.UTF-8 RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC sudo -E apt-get install -y tzdata RUN git clone https://github.com/amd/xdna-driver.git --recursive -RUN cd xdna-driver/ && git checkout deceb066418f2d53fe172a595f59413a731ccee8 +RUN cd xdna-driver/ && git checkout 7c1d273ef9946848a9f236f1216cfda10d9465cb RUN cd xdna-driver/ && git submodule update --recursive RUN sudo chmod +x /home/riallto/xdna-driver/xrt/src/runtime_src/tools/scripts/xrtdeps.sh RUN sudo /home/riallto/xdna-driver/xrt/src/runtime_src/tools/scripts/xrtdeps.sh -docker @@ -50,8 +50,7 @@ COPY $BUILD_TEMPDIR/root/debs npu_ubuntu_debs RUN sudo apt-get install -y dkms udev python3 RUN sudo apt-get install -y python3-pip ocl-icd-opencl-dev uuid-dev libopencv-dev python3-opencv -RUN sudo -E dpkg -i npu_ubuntu_debs/xrt_*-amd64-base.deb -RUN sudo -E dpkg -i npu_ubuntu_debs/xrt_*-amd64-base-dev.deb +RUN sudo -E dpkg -i npu_ubuntu_debs/xrt_*-amd64-npu.deb RUN sudo -E dpkg -i npu_ubuntu_debs/xrt_plugin*-amdxdna.deb RUN git clone https://github.com/AMDResearch/Riallto --depth=1 diff --git a/scripts/linux/setup_riallto_linux.sh b/scripts/linux/setup_riallto_linux.sh index 266b68b..76fd590 100755 --- a/scripts/linux/setup_riallto_linux.sh +++ b/scripts/linux/setup_riallto_linux.sh @@ -122,8 +122,7 @@ if [ ! -f "${NPU_FIRMWARE}" ]; then sudo apt remove -y $packages sudo apt -y --fix-broken install sudo apt install -y ocl-icd-libopencl1 dkms - sudo -E dpkg -i xrt_*-amd64-base.deb || true - sudo -E dpkg -i xrt_*-amd64-base-dev.deb || true + sudo -E dpkg -i xrt_*-amd64-npu.deb || true sudo -E dpkg -i xrt_plugin*-amdxdna.deb || true popd fi diff --git a/scripts/linux/xdna-driver-builder/Dockerfile b/scripts/linux/xdna-driver-builder/Dockerfile index d2d8d4e..424dad9 100644 --- a/scripts/linux/xdna-driver-builder/Dockerfile +++ b/scripts/linux/xdna-driver-builder/Dockerfile @@ -18,7 +18,7 @@ RUN git config --global http.postBuffer 157286400 RUN git config --global url."https://github.com/".insteadOf "git@github.com:" RUN cd /root && git clone https://github.com/amd/xdna-driver.git --recursive -RUN cd /root/xdna-driver && git checkout deceb066418f2d53fe172a595f59413a731ccee8 +RUN cd /root/xdna-driver && git checkout 7c1d273ef9946848a9f236f1216cfda10d9465cb RUN cd /root/xdna-driver && git submodule update --recursive RUN apt-get install -y cmake jq pkg-config wget libdrm-dev From 441764adc71a870c1ba3191ec57f1d54536de5cf Mon Sep 17 00:00:00 2001 From: Mario Ruiz Date: Mon, 7 Apr 2025 13:24:53 +0100 Subject: [PATCH 37/40] Move to latest xdna-driver --- scripts/linux/Dockerfile | 5 +++-- scripts/linux/setup_riallto_linux.sh | 3 ++- scripts/linux/xdna-driver-builder/Dockerfile | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/linux/Dockerfile b/scripts/linux/Dockerfile index 4bc03c0..cfa5feb 100644 --- a/scripts/linux/Dockerfile +++ b/scripts/linux/Dockerfile @@ -40,7 +40,7 @@ ENV LC_ALL en_US.UTF-8 RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC sudo -E apt-get install -y tzdata RUN git clone https://github.com/amd/xdna-driver.git --recursive -RUN cd xdna-driver/ && git checkout 7c1d273ef9946848a9f236f1216cfda10d9465cb +RUN cd xdna-driver/ && git checkout 176d6ec7a5b65767d02a4bae477962456ac8c3f4 RUN cd xdna-driver/ && git submodule update --recursive RUN sudo chmod +x /home/riallto/xdna-driver/xrt/src/runtime_src/tools/scripts/xrtdeps.sh RUN sudo /home/riallto/xdna-driver/xrt/src/runtime_src/tools/scripts/xrtdeps.sh -docker @@ -50,7 +50,8 @@ COPY $BUILD_TEMPDIR/root/debs npu_ubuntu_debs RUN sudo apt-get install -y dkms udev python3 RUN sudo apt-get install -y python3-pip ocl-icd-opencl-dev uuid-dev libopencv-dev python3-opencv -RUN sudo -E dpkg -i npu_ubuntu_debs/xrt_*-amd64-npu.deb +RUN sudo -E dpkg -i npu_ubuntu_debs/xrt_*-amd64-base.deb +RUN sudo -E dpkg -i npu_ubuntu_debs/xrt_*-amd64-base-dev.deb RUN sudo -E dpkg -i npu_ubuntu_debs/xrt_plugin*-amdxdna.deb RUN git clone https://github.com/AMDResearch/Riallto --depth=1 diff --git a/scripts/linux/setup_riallto_linux.sh b/scripts/linux/setup_riallto_linux.sh index 76fd590..266b68b 100755 --- a/scripts/linux/setup_riallto_linux.sh +++ b/scripts/linux/setup_riallto_linux.sh @@ -122,7 +122,8 @@ if [ ! -f "${NPU_FIRMWARE}" ]; then sudo apt remove -y $packages sudo apt -y --fix-broken install sudo apt install -y ocl-icd-libopencl1 dkms - sudo -E dpkg -i xrt_*-amd64-npu.deb || true + sudo -E dpkg -i xrt_*-amd64-base.deb || true + sudo -E dpkg -i xrt_*-amd64-base-dev.deb || true sudo -E dpkg -i xrt_plugin*-amdxdna.deb || true popd fi diff --git a/scripts/linux/xdna-driver-builder/Dockerfile b/scripts/linux/xdna-driver-builder/Dockerfile index 424dad9..7d1c277 100644 --- a/scripts/linux/xdna-driver-builder/Dockerfile +++ b/scripts/linux/xdna-driver-builder/Dockerfile @@ -18,7 +18,7 @@ RUN git config --global http.postBuffer 157286400 RUN git config --global url."https://github.com/".insteadOf "git@github.com:" RUN cd /root && git clone https://github.com/amd/xdna-driver.git --recursive -RUN cd /root/xdna-driver && git checkout 7c1d273ef9946848a9f236f1216cfda10d9465cb +RUN cd /root/xdna-driver && git checkout 176d6ec7a5b65767d02a4bae477962456ac8c3f4 RUN cd /root/xdna-driver && git submodule update --recursive RUN apt-get install -y cmake jq pkg-config wget libdrm-dev From 62a39467c215ceafd194e2ddf3008344497c86c4 Mon Sep 17 00:00:00 2001 From: Mario Ruiz Date: Mon, 7 Apr 2025 17:22:42 +0100 Subject: [PATCH 38/40] Add ulimit to overcome memory issue --- scripts/linux/create_container.sh | 3 ++- scripts/linux/launch_jupyter.sh | 3 ++- scripts/linux/run_pytest.sh | 3 ++- scripts/linux/xdna-driver-builder/Dockerfile | 3 +++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/scripts/linux/create_container.sh b/scripts/linux/create_container.sh index 9443899..fade79c 100755 --- a/scripts/linux/create_container.sh +++ b/scripts/linux/create_container.sh @@ -1,12 +1,13 @@ #!/bin/bash # -# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved. # SPDX-License-Identifier: MIT docker run -dit --rm --name riallto_docker \ --cap-add=NET_ADMIN \ -v $(pwd):/workspace \ --device=/dev/accel/accel0:/dev/accel/accel0 \ + --ulimit memlock=-1:-1 \ -w /workspace \ riallto:latest \ /bin/bash diff --git a/scripts/linux/launch_jupyter.sh b/scripts/linux/launch_jupyter.sh index 6f43fec..6ddd013 100755 --- a/scripts/linux/launch_jupyter.sh +++ b/scripts/linux/launch_jupyter.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved. # SPDX-License-Identifier: MIT # Check input args @@ -25,6 +25,7 @@ docker container wait riallto_jupyter > /dev/null 2>&1 || true webcams=$(ls /dev/video*) cmd="docker run -dit --rm --name riallto_jupyter" cmd+=" --cap-add=NET_ADMIN --device=/dev/accel/accel0:/dev/accel/accel0" +cmd+= " --ulimit memlock=-1:-1 " cmd+=" -p 8888:8888 " cmd+=" -v $ABS_DIR:/notebooks " for cam in $webcams; do diff --git a/scripts/linux/run_pytest.sh b/scripts/linux/run_pytest.sh index 5beff02..9e2c297 100755 --- a/scripts/linux/run_pytest.sh +++ b/scripts/linux/run_pytest.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved. # SPDX-License-Identifier: MIT docker container stop riallto_pytest || true @@ -10,6 +10,7 @@ docker run -dit --rm --name riallto_pytest \ --cap-add=NET_ADMIN \ -v $(pwd):/workspace \ --device=/dev/accel/accel0:/dev/accel/accel0 \ + --ulimit memlock=-1:-1 \ -w /workspace \ riallto:latest \ /bin/bash diff --git a/scripts/linux/xdna-driver-builder/Dockerfile b/scripts/linux/xdna-driver-builder/Dockerfile index 7d1c277..d050795 100644 --- a/scripts/linux/xdna-driver-builder/Dockerfile +++ b/scripts/linux/xdna-driver-builder/Dockerfile @@ -24,11 +24,14 @@ RUN cd /root/xdna-driver && git submodule update --recursive RUN apt-get install -y cmake jq pkg-config wget libdrm-dev RUN apt-get install -y python3-pip ocl-icd-opencl-dev +# Install XRT dependencies RUN /root/xdna-driver/xrt/src/runtime_src/tools/scripts/xrtdeps.sh -docker +# Build XDNA Driver RUN cd /root/xdna-driver/build && ./build.sh -release RUN cd /root/xdna-driver/build && ./build.sh -package +# Build XRT RUN cd /root/xdna-driver/xrt/build && ./build.sh -npu -opt # Make a copy of the deb files From 75c557e1393210c1078e58b8e3613e4517592de9 Mon Sep 17 00:00:00 2001 From: Mario Ruiz Date: Wed, 9 Apr 2025 11:07:43 +0100 Subject: [PATCH 39/40] Update commit --- scripts/linux/xdna-driver-builder/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/linux/xdna-driver-builder/Dockerfile b/scripts/linux/xdna-driver-builder/Dockerfile index d050795..9838dee 100644 --- a/scripts/linux/xdna-driver-builder/Dockerfile +++ b/scripts/linux/xdna-driver-builder/Dockerfile @@ -4,6 +4,7 @@ FROM ubuntu:24.04 ARG DEBIAN_FRONTEND=noninteractive +ENV XDNADRIVERCOMMITID 9a9045284620afdfa2682cde7dae133e25dcc335 RUN apt-get update RUN apt-get install -y --install-recommends linux-generic-hwe-24.04 @@ -18,7 +19,7 @@ RUN git config --global http.postBuffer 157286400 RUN git config --global url."https://github.com/".insteadOf "git@github.com:" RUN cd /root && git clone https://github.com/amd/xdna-driver.git --recursive -RUN cd /root/xdna-driver && git checkout 176d6ec7a5b65767d02a4bae477962456ac8c3f4 +RUN cd /root/xdna-driver && git checkout $XDNADRIVERCOMMITID RUN cd /root/xdna-driver && git submodule update --recursive RUN apt-get install -y cmake jq pkg-config wget libdrm-dev From 809d92a0e9d20b7ca73de84e2e559271b9736d9c Mon Sep 17 00:00:00 2001 From: Mario Ruiz Date: Thu, 10 Apr 2025 15:16:29 +0100 Subject: [PATCH 40/40] Fix extra space --- scripts/linux/launch_jupyter.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/linux/launch_jupyter.sh b/scripts/linux/launch_jupyter.sh index 6ddd013..b4b3c8b 100755 --- a/scripts/linux/launch_jupyter.sh +++ b/scripts/linux/launch_jupyter.sh @@ -25,7 +25,7 @@ docker container wait riallto_jupyter > /dev/null 2>&1 || true webcams=$(ls /dev/video*) cmd="docker run -dit --rm --name riallto_jupyter" cmd+=" --cap-add=NET_ADMIN --device=/dev/accel/accel0:/dev/accel/accel0" -cmd+= " --ulimit memlock=-1:-1 " +cmd+=" --ulimit memlock=-1:-1 " cmd+=" -p 8888:8888 " cmd+=" -v $ABS_DIR:/notebooks " for cam in $webcams; do