Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backend - CPU Deps support #1053

Merged
merged 2 commits into from
Mar 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 14 additions & 15 deletions MIVisionX-setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
__author__ = "Kiriti Nagesh Gowda"
__copyright__ = "Copyright 2018 - 2023, AMD ROCm MIVisionX"
__license__ = "MIT"
__version__ = "2.4.1"
__version__ = "2.4.2"
__maintainer__ = "Kiriti Nagesh Gowda"
__email__ = "mivisionx.support@amd.com"
__status__ = "Shipping"
Expand Down Expand Up @@ -116,7 +116,7 @@
exit()

# check ROCm installation
if os.path.exists(ROCM_PATH):
if os.path.exists(ROCM_PATH) and backend != 'CPU':
print("\nROCm Installation Found -- "+ROCM_PATH+"\n")
os.system('echo ROCm Info -- && '+ROCM_PATH+'/bin/rocminfo')
else:
Expand All @@ -125,11 +125,10 @@
print(
"WARNING: Set ROCm Path with \"--rocm_path\" option for full installation [Default:/opt/rocm]\n")
print("WARNING: Limited dependencies will be installed\n")
backend = 'CPU'
else:
print("\nCPU Only Install\n")
ffmpegInstall = 'OFF'
print("\nSTATUS: CPU Backend Install\n")
neuralNetInstall = 'OFF'
rocalInstall = 'OFF'
inferenceInstall = 'OFF'

# get platfrom info
Expand Down Expand Up @@ -207,7 +206,7 @@
os.system('(cd '+deps_dir+'/build/OpenCV; sudo ' +
linuxFlag+' make install -j8)')

if neuralNetInstall == 'ON' and backend != 'CPU':
if neuralNetInstall == 'ON':
os.system('sudo -v')
if backend == 'OCL':
if "Ubuntu" in platfromInfo:
Expand All @@ -228,21 +227,21 @@
os.system('sudo '+linuxFlag+' '+linuxSystemInstall +
' '+linuxSystemInstall_check+' install -y rocblas-devel miopen-hip-devel migraphx-devel')

if (rocalInstall == 'ON' or neuralNetInstall == 'ON') and backend != 'CPU':
if (rocalInstall == 'ON' or neuralNetInstall == 'ON'):
# ProtoBuf
if os.path.exists(deps_dir+'/protobuf-'+ProtoBufVersion):
os.system('sudo -v')
os.system('(cd '+deps_dir+'/protobuf-'+ProtoBufVersion +
'; sudo '+linuxFlag+' make install -j8)')

if rocalInstall == 'ON' and backend != 'CPU':
if rocalInstall == 'ON':
# RPP
if os.path.exists(deps_dir+'/rpp/build-'+backend):
os.system('sudo -v')
os.system('(cd '+deps_dir+'/rpp/build-'+backend+'; sudo ' +
linuxFlag+' make install -j8)')

if ffmpegInstall == 'ON' and backend != 'CPU':
if ffmpegInstall == 'ON':
# FFMPEG
if os.path.exists(deps_dir+'/FFmpeg-n4.4.2'):
os.system('sudo -v')
Expand All @@ -266,16 +265,16 @@
os.system(
'(cd '+deps_dir+'; wget https://github.com/opencv/opencv/archive/'+opencvVersion+'.zip )')
os.system('(cd '+deps_dir+'; unzip '+opencvVersion+'.zip )')
if (rocalInstall == 'ON' or neuralNetInstall == 'ON') and backend != 'CPU':
if (rocalInstall == 'ON' or neuralNetInstall == 'ON'):
os.system(
'(cd '+deps_dir+'; wget https://github.com/protocolbuffers/protobuf/archive/v'+ProtoBufVersion+'.zip )')
os.system('(cd '+deps_dir+'; unzip v'+ProtoBufVersion+'.zip )')
if ffmpegInstall == 'ON' and backend != 'CPU':
if ffmpegInstall == 'ON':
os.system(
'(cd '+deps_dir+'; wget https://github.com/FFmpeg/FFmpeg/archive/refs/tags/n4.4.2.zip && unzip n4.4.2.zip )')

# Install
if (rocalInstall == 'ON' or neuralNetInstall == 'ON') and backend != 'CPU':
if (rocalInstall == 'ON' or neuralNetInstall == 'ON'):
# package dependencies
os.system('sudo -v')
if "centos" in platfromInfo or "redhat" in platfromInfo:
Expand Down Expand Up @@ -329,7 +328,7 @@
os.system('(cd '+deps_dir+'/protobuf-'+ProtoBufVersion +
'; sudo '+linuxFlag+' ldconfig )')

if neuralNetInstall == 'ON' and backend != 'CPU':
if neuralNetInstall == 'ON':
# Remove Previous Install - MIOpen
os.system('sudo -v')
if os.path.exists(ROCM_PATH+'/miopen'):
Expand Down Expand Up @@ -431,7 +430,7 @@
os.system('sudo -v')
os.system('(cd '+deps_dir+'/build/OpenCV; sudo '+linuxFlag+' ldconfig )')

if rocalInstall == 'ON' and backend != 'CPU':
if rocalInstall == 'ON':
# Install RPP
if "Ubuntu" in platfromInfo:
# Install Packages for rocAL
Expand Down Expand Up @@ -486,7 +485,7 @@
os.system('pip install numpy==1.21')

# Install ffmpeg
if ffmpegInstall == 'ON' and backend != 'CPU':
if ffmpegInstall == 'ON':
if "Ubuntu" in platfromInfo:
os.system('sudo -v')
os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check +
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -440,16 +440,16 @@ Review all notable [changes](CHANGELOG.md#changelog) with the latest release
+ CentOS - `7` / `8`
+ RedHat - `8` / `9`
+ SLES - `15-SP3`
* ROCm: rocm-core - `5.4.0.50400-72`
* miopen-hip - `2.19.0.50400-72`
* ROCm: rocm-core - `5.5.0.50500-21`
* miopen-hip - `2.19.0.50500-21`
* miopen-opencl - `2.18.0.50300-63`
* migraphx - `2.4.0.50400-72`
* migraphx - `2.5.0.50500-21`
* Protobuf - [V3.12.4](https://github.com/protocolbuffers/protobuf/releases/tag/v3.12.4)
* OpenCV - [4.6.0](https://github.com/opencv/opencv/releases/tag/4.6.0)
* RPP - [0.99](https://github.com/GPUOpen-ProfessionalCompute-Libraries/rpp/releases/tag/0.99)
* FFMPEG - [n4.4.2](https://github.com/FFmpeg/FFmpeg/releases/tag/n4.4.2)
* Dependencies for all the above packages
* MIVisionX Setup Script - `V2.4.0`
* MIVisionX Setup Script - `V2.4.2`

### Known issues

Expand Down