[OpenVINO Scripts] Updated with RHEL8 (#4296)
* Updated install_NEO_OCL_driver.sh & install_openvino_dependencies.sh with rhel8 case * install_NEO_OCL_driver: Fixed conditional * script: Updated with actual revisions
This commit is contained in:
parent
f4c071f635
commit
ef147905f1
@ -27,6 +27,7 @@
|
||||
EXIT_FAILURE=1
|
||||
EXIT_WRONG_ARG=2
|
||||
CENTOS_MINOR=
|
||||
RHEL_VERSION=
|
||||
UBUNTU_VERSION=
|
||||
DISTRO=
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
@ -85,6 +86,29 @@ do
|
||||
esac
|
||||
done
|
||||
|
||||
_install_prerequisites_redhat()
|
||||
{
|
||||
# yum doesn't accept timeout in seconds as parameter
|
||||
echo
|
||||
echo "Note: if yum becomes non-responsive, try aborting the script and run:"
|
||||
echo " sudo -E $0"
|
||||
echo
|
||||
|
||||
CMDS=("yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm && yum install -y ocl-icd")
|
||||
|
||||
for cmd in "${CMDS[@]}"; do
|
||||
echo "$cmd"
|
||||
eval "$cmd"
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo "ERROR: failed to run $cmd" >&2
|
||||
echo "Problem (or disk space)?" >&2
|
||||
echo ". Verify that you have enough disk space, and run the script again." >&2
|
||||
exit $EXIT_FAILURE
|
||||
fi
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
_install_prerequisites_centos()
|
||||
{
|
||||
# yum doesn't accept timeout in seconds as parameter
|
||||
@ -140,11 +164,12 @@ _install_prerequisites_ubuntu()
|
||||
|
||||
install_prerequisites()
|
||||
{
|
||||
echo "Installing prerequisites..."
|
||||
if [[ $DISTRO == "centos" ]]; then
|
||||
echo "Installing prerequisites..."
|
||||
_install_prerequisites_centos
|
||||
elif [[ $DISTRO == "redhat" ]]; then
|
||||
_install_prerequisites_redhat
|
||||
elif [[ $DISTRO == "ubuntu" ]]; then
|
||||
echo "Installing prerequisites..."
|
||||
_install_prerequisites_ubuntu
|
||||
else
|
||||
echo Unknown OS
|
||||
@ -195,7 +220,7 @@ install_user_mode()
|
||||
{
|
||||
echo "Installing user mode driver..."
|
||||
|
||||
if [[ $DISTRO == "centos" ]]; then
|
||||
if [[ $DISTRO == "centos" || $DISTRO == "redhat" ]]; then
|
||||
_install_user_mode_centos
|
||||
else
|
||||
_install_user_mode_ubuntu
|
||||
@ -259,7 +284,7 @@ _uninstall_user_mode_ubuntu()
|
||||
|
||||
uninstall_user_mode()
|
||||
{
|
||||
if [[ $DISTRO == "centos" ]]; then
|
||||
if [[ $DISTRO == "centos" || $DISTRO == "redhat" ]]; then
|
||||
_uninstall_user_mode_centos
|
||||
else
|
||||
_uninstall_user_mode_ubuntu
|
||||
@ -268,7 +293,7 @@ uninstall_user_mode()
|
||||
|
||||
_is_package_installed()
|
||||
{
|
||||
if [[ $DISTRO == "centos" ]]; then
|
||||
if [[ $DISTRO == "centos" || $DISTRO == "redhat" ]]; then
|
||||
cmd="rpm -qa | grep $1"
|
||||
else
|
||||
cmd="dpkg-query -W -f='${binary:Package}\n' $pkg"
|
||||
@ -369,7 +394,7 @@ _verify_checksum_centos()
|
||||
|
||||
verify_checksum()
|
||||
{
|
||||
if [[ $DISTRO == "centos" ]]; then
|
||||
if [[ $DISTRO == "centos" || $DISTRO == "redhat" ]]; then
|
||||
_verify_checksum_centos
|
||||
else
|
||||
_verify_checksum_ubuntu
|
||||
@ -381,7 +406,7 @@ download_packages()
|
||||
mkdir -p "$SCRIPT_DIR/neo"
|
||||
cd "$SCRIPT_DIR/neo" || exit
|
||||
|
||||
if [[ $DISTRO == "centos" ]]; then
|
||||
if [[ $DISTRO == "centos" || $DISTRO == "redhat" ]]; then
|
||||
_download_packages_centos
|
||||
else
|
||||
_download_packages_ubuntu
|
||||
@ -453,6 +478,13 @@ _check_distro_version()
|
||||
echo "This script is supported only on CentOS 7 and above." >&2
|
||||
exit $EXIT_FAILURE
|
||||
fi
|
||||
elif [[ $DISTRO == redhat ]]; then
|
||||
RHEL_VERSION=$(grep -m1 'VERSION_ID' /etc/os-release | grep -Eo "8.[0-9]{1,2}")
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo "Warning: This runtime can be installed only on RHEL 8" >&2
|
||||
echo "Installation of Intel Compute Runtime interrupted"
|
||||
exit $EXIT_FAILURE
|
||||
fi
|
||||
elif [[ $DISTRO == ubuntu ]]; then
|
||||
UBUNTU_VERSION=$(grep -m1 'VERSION_ID' /etc/os-release | grep -Eo "[0-9]{2}.[0-9]{2}")
|
||||
if [[ $UBUNTU_VERSION != '18.04' && $UBUNTU_VERSION != '20.04' ]]; then
|
||||
@ -468,6 +500,8 @@ distro_init()
|
||||
{
|
||||
if [[ -f /etc/centos-release ]]; then
|
||||
DISTRO="centos"
|
||||
elif [[ -f /etc/redhat-release ]]; then
|
||||
DISTRO="redhat"
|
||||
elif [[ -f /etc/lsb-release ]]; then
|
||||
DISTRO="ubuntu"
|
||||
fi
|
||||
@ -514,7 +548,7 @@ check_specific_generation()
|
||||
check_current_driver()
|
||||
{
|
||||
echo "Checking current driver version..."
|
||||
if [[ $DISTRO == centos ]]; then
|
||||
if [[ $DISTRO == centos || $DISTRO == redhat ]]; then
|
||||
gfx_version=$(yum info intel-opencl | grep Version)
|
||||
elif [[ $DISTRO == ubuntu ]]; then
|
||||
gfx_version=$(apt show intel-opencl | grep Version)
|
||||
|
@ -94,7 +94,7 @@ fi
|
||||
if [ "$os" == "auto" ] ; then
|
||||
os=$( . /etc/os-release ; echo "${ID}${VERSION_ID}" )
|
||||
case $os in
|
||||
centos7|ubuntu18.04|ubuntu20.04) [ -z "$print" ] && echo "Detected OS: ${os}" ;;
|
||||
centos7|rhel8.2|ubuntu18.04|ubuntu20.04) [ -z "$print" ] && echo "Detected OS: ${os}" ;;
|
||||
*) echo "Unsupported OS: ${os:-detection failed}" >&2 ; exit 1 ;;
|
||||
esac
|
||||
fi
|
||||
@ -195,6 +195,22 @@ elif [ "$os" == "ubuntu20.04" ] ; then
|
||||
vainfo
|
||||
)
|
||||
|
||||
elif [ "$os" == "rhel8.2" ] ; then
|
||||
|
||||
pkgs_opencv_req=(gtk3)
|
||||
pkgs_python=(python3 python3-devel python3-setuptools python3-pip)
|
||||
pkgs_dev=(gcc gcc-c++ make glibc libstdc++ libgcc cmake curl)
|
||||
pkgs_myriad=()
|
||||
pkgs_installer=()
|
||||
pkgs_pot=()
|
||||
pkgs_opencv_opt=(
|
||||
gstreamer1
|
||||
gstreamer1-plugins-bad-free
|
||||
gstreamer1-plugins-good
|
||||
gstreamer1-plugins-ugly-free
|
||||
)
|
||||
pkgs_dlstreamer=()
|
||||
|
||||
elif [ "$os" == "centos7" ] ; then
|
||||
|
||||
# find -name *.so -exec objdump -p {} \; | grep NEEDED | sort -u | cut -c 23- | xargs -t -n1 yum -q whatprovides
|
||||
@ -357,7 +373,7 @@ if [ "$os" == "ubuntu18.04" ] || [ "$os" == "ubuntu20.04" ] ; then
|
||||
|
||||
apt-get update && apt-get install --no-install-recommends $iopt ${pkgs[@]}
|
||||
|
||||
elif [ "$os" == "centos7" ] ; then
|
||||
elif [ "$os" == "centos7" ] || [ "$os" == "rhel8.2" ] ; then
|
||||
|
||||
[ -z "$interactive" ] && iopt="--assumeyes"
|
||||
[ -n "$dry" ] && iopt="--downloadonly"
|
||||
|
Loading…
Reference in New Issue
Block a user