Skip to content

Commit 8864dea

Browse files
bryanloz-xilinxGang YuanBryan Lozano
authored andcommitted
New Alveo Setup Scripts (#196)
* WIP * setup script for u50/u50lv/u280 platform * Rename shell installer scripts * Add U200, U250, clean * Reload drivers out of paranoia * Update scripts to install xclbins * install xrm after the shells * add 3 second sleepwq * Buf fixes for RHEL * Update install_u50_xclbins.sh * Update install_u50lv_xclbins.sh * Update install_u200_xclbins.sh * Update install_u250_xclbins.sh * Update install_u280_xclbins.sh Co-authored-by: Gang Yuan <[email protected]> Co-authored-by: Bryan Lozano <[email protected]>
1 parent ab7703e commit 8864dea

13 files changed

+690
-0
lines changed

setup/alveo/install.sh

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
#!/usr/bin/env bash
2+
# Copyright 2020 Xilinx Inc.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
# Don't exit on error, do your best
17+
set +e
18+
19+
# Detect OS Distribution
20+
arch=$(uname -m)
21+
kernel=$(uname -r)
22+
if [ -n "$(command -v lsb_release)" ]; then
23+
distroname=$(lsb_release -s -d)
24+
elif [ -f "/etc/os-release" ]; then
25+
distroname=$(grep PRETTY_NAME /etc/os-release | sed 's/PRETTY_NAME=//g' | tr -d '="')
26+
elif [ -f "/etc/debian_version" ]; then
27+
distroname="Debian $(cat /etc/debian_version)"
28+
elif [ -f "/etc/redhat-release" ]; then
29+
distroname=$(cat /etc/redhat-release)
30+
else
31+
distroname="$(uname -s) $(uname -r)"
32+
fi
33+
34+
##############################
35+
# Setup Install for CentOS and Red Hat
36+
##############################
37+
if [[ $distroname == *"CentOS"* ]]; then
38+
sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
39+
elif [[ $distroname == *"Red Hat"* ]]; then
40+
sudo yum-config-manager --enable rhel-7-server-optional-rpms
41+
sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
42+
fi
43+
44+
SCRIPTS=./scripts
45+
46+
source ${SCRIPTS}/install_xrt.sh
47+
48+
##############################
49+
# Install the required shells
50+
##############################
51+
# reload drivers for XRT (xocl, xclmgmt)
52+
sudo modprobe -r xocl
53+
sudo modprobe -r xclmgmt
54+
sudo modprobe xocl
55+
sudo modprobe xclmgmt
56+
57+
sleep 3
58+
59+
source /opt/xilinx/xrt/setup.sh
60+
61+
PLATFORMS="u50_ u50lv_ u200_ u250_ u280_"
62+
63+
for platform in ${PLATFORMS};
64+
do
65+
xbutil scan | grep ${platform}
66+
if [ $? -eq 0 ]; then
67+
echo "${platform} card detected, installing shell and xclbins"
68+
source ${SCRIPTS}/install_${platform}shell.sh
69+
source ${SCRIPTS}/install_${platform}xclbins.sh
70+
fi
71+
done
72+
73+
source ${SCRIPTS}/install_xrm.sh
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#!/usr/bin/env bash
2+
# Copyright 2020 Xilinx Inc.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
arch=$(uname -m)
17+
kernel=$(uname -r)
18+
if [ -n "$(command -v lsb_release)" ]; then
19+
distroname=$(lsb_release -s -d)
20+
elif [ -f "/etc/os-release" ]; then
21+
distroname=$(grep PRETTY_NAME /etc/os-release | sed 's/PRETTY_NAME=//g' | tr -d '="')
22+
elif [ -f "/etc/debian_version" ]; then
23+
distroname="Debian $(cat /etc/debian_version)"
24+
elif [ -f "/etc/redhat-release" ]; then
25+
distroname=$(cat /etc/redhat-release)
26+
else
27+
distroname="$(uname -s) $(uname -r)"
28+
fi
29+
30+
XSA_URL=""
31+
XSA_INSTALLER=""
32+
INSTALLER=""
33+
34+
##############################
35+
# Download DSA
36+
##############################
37+
if [[ $distroname == *"Ubuntu 16.04"* ]]; then
38+
XSA_URL="https://www.xilinx.com/bin/public/openDownload?filename=xilinx-u200-xdma-201830.2-2580015_16.04.deb"
39+
XSA_INSTALLER=/tmp/xsa.deb
40+
INSTALLER="apt"
41+
elif [[ $distroname == *"Ubuntu 18.04"* ]]; then
42+
XSA_URL="https://www.xilinx.com/bin/public/openDownload?filename=xilinx-u200-xdma-201830.2-2580015_18.04.deb"
43+
XSA_INSTALLER=/tmp/xsa.deb
44+
INSTALLER="apt"
45+
elif [[ $distroname == *"Ubuntu 20.04"* ]]; then
46+
XSA_URL="https://www.xilinx.com/bin/public/openDownload?filename=xilinx-u200-xdma-201830.2-2580015_20.04.deb" # Doesn't exist yet
47+
XSA_INSTALLER=/tmp/xsa.deb
48+
INSTALLER="apt"
49+
elif [[ $distroname == *"CentOS"* ]]; then
50+
XSA_URL="https://www.xilinx.com/bin/public/openDownload?filename=xilinx-u200-xdma-201830.2-2580015.x86_64.rpm"
51+
XSA_INSTALLER=/tmp/xsa.rpm
52+
INSTALLER="yum"
53+
elif [[ $distroname == *"Red Hat"* ]]; then
54+
XSA_URL="https://www.xilinx.com/bin/public/openDownload?filename=xilinx-u200-xdma-201830.2-2580015.x86_64.rpm"
55+
XSA_INSTALLER=/tmp/xsa.rpm
56+
INSTALLER="yum"
57+
else
58+
echo "Failed, couldn't detect os distribution"
59+
exit 1
60+
fi
61+
62+
wget $XSA_URL -O $XSA_INSTALLER && sudo ${INSTALLER} install $XSA_INSTALLER -y && rm $XSA_INSTALLER
63+
64+
##############################
65+
# Flash alveo
66+
##############################
67+
sudo /opt/xilinx/xrt/bin/xbmgmt flash --update --shell xilinx_u200_xdma_201830_2
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
# Copyright 2020 Xilinx Inc.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
# Note XDNNv3 aka DPUv1 is to be retired
17+
18+
XCLBIN_URL="https://www.xilinx.com/bin/public/openDownload?filename=xdnnv3_xclbins_1_3_0.tar.gz"
19+
XCLBIN_INSTALLER="/tmp/xclbins.tar.gz"
20+
INSTALLER=tar
21+
INSTALL_PATH=/
22+
23+
wget $XCLBIN_URL -O $XCLBIN_INSTALLER && sudo ${INSTALLER} -xzf $XCLBIN_INSTALLER --directory $INSTALL_PATH && rm $XCLBIN_INSTALLER
24+
25+
XCLBIN_URL="https://www.xilinx.com/bin/public/openDownload?filename=dpuv3int8_xclbins_1_3_0.tar.gz"
26+
XCLBIN_INSTALLER="/tmp/xclbins.tar.gz"
27+
INSTALLER=tar
28+
INSTALL_PATH=/
29+
30+
wget $XCLBIN_URL -O $XCLBIN_INSTALLER && sudo ${INSTALLER} -xzf $XCLBIN_INSTALLER --directory $INSTALL_PATH && rm $XCLBIN_INSTALLER
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#!/usr/bin/env bash
2+
# Copyright 2020 Xilinx Inc.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
arch=$(uname -m)
17+
kernel=$(uname -r)
18+
if [ -n "$(command -v lsb_release)" ]; then
19+
distroname=$(lsb_release -s -d)
20+
elif [ -f "/etc/os-release" ]; then
21+
distroname=$(grep PRETTY_NAME /etc/os-release | sed 's/PRETTY_NAME=//g' | tr -d '="')
22+
elif [ -f "/etc/debian_version" ]; then
23+
distroname="Debian $(cat /etc/debian_version)"
24+
elif [ -f "/etc/redhat-release" ]; then
25+
distroname=$(cat /etc/redhat-release)
26+
else
27+
distroname="$(uname -s) $(uname -r)"
28+
fi
29+
30+
XSA_URL=""
31+
XSA_INSTALLER=""
32+
INSTALLER=""
33+
34+
##############################
35+
# Download DSA
36+
##############################
37+
if [[ $distroname == *"Ubuntu 16.04"* ]]; then
38+
XSA_URL="https://www.xilinx.com/bin/public/openDownload?filename=xilinx-u250-xdma-201830.2-2580015_16.04.deb"
39+
XSA_INSTALLER=/tmp/xsa.deb
40+
INSTALLER="apt"
41+
elif [[ $distroname == *"Ubuntu 18.04"* ]]; then
42+
XSA_URL="https://www.xilinx.com/bin/public/openDownload?filename=xilinx-u250-xdma-201830.2-2580015_18.04.deb"
43+
XSA_INSTALLER=/tmp/xsa.deb
44+
INSTALLER="apt"
45+
elif [[ $distroname == *"Ubuntu 20.04"* ]]; then
46+
XSA_URL="https://www.xilinx.com/bin/public/openDownload?filename=xilinx-u250-xdma-201830.2-2580015_20.04.deb" # Doesn't exist yet
47+
XSA_INSTALLER=/tmp/xsa.deb
48+
INSTALLER="apt"
49+
elif [[ $distroname == *"CentOS"* ]]; then
50+
XSA_URL="https://www.xilinx.com/bin/public/openDownload?filename=xilinx-u250-xdma-201830.2-2580015.x86_64.rpm"
51+
XSA_INSTALLER=/tmp/xsa.rpm
52+
INSTALLER="yum"
53+
elif [[ $distroname == *"Red Hat"* ]]; then
54+
XSA_URL="https://www.xilinx.com/bin/public/openDownload?filename=xilinx-u250-xdma-201830.2-2580015.x86_64.rpm"
55+
XSA_INSTALLER=/tmp/xsa.rpm
56+
INSTALLER="yum"
57+
else
58+
echo "Failed, couldn't detect os distribution"
59+
exit 1
60+
fi
61+
62+
wget $XSA_URL -O $XSA_INSTALLER && sudo ${INSTALLER} install $XSA_INSTALLER -y && rm $XSA_INSTALLER
63+
64+
##############################
65+
# Flash alveo
66+
##############################
67+
sudo /opt/xilinx/xrt/bin/xbmgmt flash --update --shell xilinx_u250_xdma_201830_2
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
# Copyright 2020 Xilinx Inc.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
# Note XDNNv3 aka DPUv1 is to be retired
17+
18+
XCLBIN_URL="https://www.xilinx.com/bin/public/openDownload?filename=xdnnv3_xclbins_1_3_0.tar.gz"
19+
XCLBIN_INSTALLER="/tmp/xclbins.tar.gz"
20+
INSTALLER=tar
21+
INSTALL_PATH=/
22+
23+
wget $XCLBIN_URL -O $XCLBIN_INSTALLER && sudo ${INSTALLER} -xzf $XCLBIN_INSTALLER --directory $INSTALL_PATH && rm $XCLBIN_INSTALLER
24+
25+
XCLBIN_URL="https://www.xilinx.com/bin/public/openDownload?filename=dpuv3int8_xclbins_1_3_0.tar.gz"
26+
XCLBIN_INSTALLER="/tmp/xclbins.tar.gz"
27+
INSTALLER=tar
28+
INSTALL_PATH=/
29+
30+
wget $XCLBIN_URL -O $XCLBIN_INSTALLER && sudo ${INSTALLER} -xzf $XCLBIN_INSTALLER --directory $INSTALL_PATH && rm $XCLBIN_INSTALLER
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
#!/usr/bin/env bash
2+
# Copyright 2020 Xilinx Inc.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
arch=$(uname -m)
17+
kernel=$(uname -r)
18+
if [ -n "$(command -v lsb_release)" ]; then
19+
distroname=$(lsb_release -s -d)
20+
elif [ -f "/etc/os-release" ]; then
21+
distroname=$(grep PRETTY_NAME /etc/os-release | sed 's/PRETTY_NAME=//g' | tr -d '="')
22+
elif [ -f "/etc/debian_version" ]; then
23+
distroname="Debian $(cat /etc/debian_version)"
24+
elif [ -f "/etc/redhat-release" ]; then
25+
distroname=$(cat /etc/redhat-release)
26+
else
27+
distroname="$(uname -s) $(uname -r)"
28+
fi
29+
30+
31+
##############################
32+
# Download Gen3x4 Platform
33+
##############################
34+
if [[ $distroname == *"Ubuntu 16.04"* ]]; then
35+
echo "Ubuntu 16.04"
36+
DEPLOY_PLFM_URL="https://www.xilinx.com/bin/public/openDownload?filename=xilinx-u280-xdma-201920.3-2789161_16.04.deb"
37+
elif [[ $distroname == *"Ubuntu 18.04"* ]]; then
38+
echo "Ubuntu 18.04"
39+
DEPLOY_PLFM_URL="https://www.xilinx.com/bin/public/openDownload?filename=xilinx-u280-xdma-201920.3-2789161_18.04.deb"
40+
elif [[ $distroname == *"CentOS"* ]] || [[ $distroname == *"Red Hat"* ]]; then
41+
echo "CentOS/RHEL"
42+
DEPLOY_PLFM_URL="https://www.xilinx.com/bin/public/openDownload?filename=xilinx-u280-xdma-201920.3-2789161.x86_64.rpm"
43+
else
44+
echo "Failed, couldn't detect os distribution"
45+
exit 1
46+
fi
47+
48+
##############################
49+
# Install Gen3x4 Platform
50+
##############################
51+
mkdir ./temp
52+
cd ./temp
53+
if [[ $distroname == *"Ubuntu 16.04"* ]] || [[ $distroname == *"Ubuntu 18.04"* ]]; then
54+
wget $DEPLOY_PLFM_URL -O shell.deb
55+
sudo apt install ./shell.deb -y
56+
elif [[ $distroname == *"CentOS"* ]] || [[ $distroname == *"Red Hat"* ]]; then
57+
wget $DEPLOY_PLFM_URL -O shell.rpm
58+
sudo yum install ./shell.rpm -y
59+
else
60+
echo "Failed, couldn't detect os distribution"
61+
exit 1
62+
fi
63+
64+
cd ..
65+
rm -rf ./temp
66+
##############################
67+
# Flash alveo
68+
##############################
69+
sudo /opt/xilinx/xrt/bin/xbmgmt flash --update --shell xilinx_u280_xdma_201920_3
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
# Copyright 2020 Xilinx Inc.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
XCLBIN_URL="https://www.xilinx.com/bin/public/openDownload?filename=U280_xclbins_1_3_0.tar.gz"
17+
XCLBIN_INSTALLER="/tmp/xclbins.tar.gz"
18+
INSTALLER=tar
19+
INSTALL_PATH=/
20+
21+
wget $XCLBIN_URL -O $XCLBIN_INSTALLER && sudo ${INSTALLER} -xzf $XCLBIN_INSTALLER --directory $INSTALL_PATH && rm $XCLBIN_INSTALLER
22+
23+
XCLBIN_URL="https://www.xilinx.com/bin/public/openDownload?filename=U280-V3ME_xclbins_1_3_0.tar.gz"
24+
XCLBIN_INSTALLER="/tmp/xclbins.tar.gz"
25+
INSTALLER=tar
26+
INSTALL_PATH=/
27+
28+
wget $XCLBIN_URL -O $XCLBIN_INSTALLER && sudo ${INSTALLER} -xzf $XCLBIN_INSTALLER --directory $INSTALL_PATH && rm $XCLBIN_INSTALLER
29+
30+
echo "Alveo U280 XCLBINS have beein installed to /opt/xilinx/overlaybins/"
31+
echo "You may need to copy them or link them to /usr/lib/dpu.xclbin"

0 commit comments

Comments
 (0)