|
| 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 |
0 commit comments