forked from Xilinx/Vitis-AI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·76 lines (64 loc) · 2.25 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/usr/bin/env bash
# Copyright 2020 Xilinx Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Don't exit on error, do your best
set +e
# Detect OS Distribution
arch=$(uname -m)
kernel=$(uname -r)
if [ -n "$(command -v lsb_release)" ]; then
distroname=$(lsb_release -s -d)
elif [ -f "/etc/os-release" ]; then
distroname=$(grep PRETTY_NAME /etc/os-release | sed 's/PRETTY_NAME=//g' | tr -d '="')
elif [ -f "/etc/debian_version" ]; then
distroname="Debian $(cat /etc/debian_version)"
elif [ -f "/etc/redhat-release" ]; then
distroname=$(cat /etc/redhat-release)
else
distroname="$(uname -s) $(uname -r)"
fi
##############################
# Setup Install for CentOS and Red Hat
##############################
if [[ $distroname == *"CentOS"* ]]; then
sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
elif [[ $distroname == *"Red Hat"* ]]; then
sudo yum-config-manager --enable rhel-7-server-optional-rpms
sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
fi
SCRIPTS=./scripts
source ${SCRIPTS}/install_xrt.sh
##############################
# Install the required shells
##############################
# reload drivers for XRT (xocl, xclmgmt)
# This is sometimes helpful, sometimes troublesome
# For now it is being removed
#sudo modprobe -r xocl
#sudo modprobe -r xclmgmt
#sudo modprobe xocl
#sudo modprobe xclmgmt
sleep 3
source /opt/xilinx/xrt/setup.sh
PLATFORMS="u50_ u50lv_ u200_ u250_ u280_"
for platform in ${PLATFORMS};
do
xbutil scan | grep ${platform}
if [ $? -eq 0 ]; then
echo "${platform} card detected, installing shell and xclbins"
source ${SCRIPTS}/install_${platform}shell.sh
source ${SCRIPTS}/install_${platform}xclbins.sh
fi
done
source ${SCRIPTS}/install_xrm.sh