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

Add miopen install rpm script #26

Merged
merged 1 commit into from
Mar 10, 2023
Merged
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
37 changes: 37 additions & 0 deletions common/install_rocm_miopen_rpm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash

set -ex

# Create the tmp dir to extract into
EXTRACTDIR_ROOT=/extract_miopen_rpm
mkdir -p ${EXTRACTDIR_ROOT}
echo "Creating temporary directory for rpm download..."

# Fail if rpm source is not available
if ! wget -P ${EXTRACTDIR_ROOT} ${MIOPEN_RPM_SOURCE}; then
echo 'ERROR: Failed to download MIOpen package.'
exit 1
fi
echo "MIOpen package download complete..."

# Extract rpm in EXTRACT_DIR
cd ${EXTRACTDIR_ROOT}
miopen_rpm=$(ls *.rpm)
rpm2cpio ${miopen_rpm} | cpio -idmv

# Copy libMIOpen.so.1 over existing
source_file=$(ls opt/rocm-*/lib/libMIOpen.so.1.0*)
Copy link

@jithunnair-amd jithunnair-amd Mar 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May not be an immediate issue, but the hardcoding of the MIOpen .so version bugs me :)

dest_file=$(ls /opt/rocm-${ROCM_VERSION}*/lib/libMIOpen.so.1.0*)
if [ -e ${source_file} ] && [ -e ${dest_file} ]; then
echo "Source .so: ${source_file}"
echo "Dest .so: ${dest_file}"
cp $source_file $dest_file
else
echo 'ERROR: either the source or destination path for libMIOpen.so.1.0 does not exist'
exit 1
fi
echo "libMIOpen so file from RPM copied to existing MIOpen install..."

# Clean up extracted dir
rm -rf ${EXTRACTDIR_ROOT}
echo "Removed temporary directory..."