-
-
Save Hermann-SW/03c94d216cd4a01229bf266dc35a7404 to your computer and use it in GitHub Desktop.
"Radeon RX 480" rocm demo script to execute with "docker run" for "rocm/dev-ubuntu-18.04"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -x | |
apt-get update 2>&1 > /dev/null | |
apt-get install -y git 2>&1 > /dev/null | |
usermod -a -G video root | |
echo ROC_ENABLE_PRE_VEGA=1 >> /etc/environment | |
echo HSA_OVERRIDE_GFX_VERSION=8.0.3 >> /etc/environment | |
cat > /root/doit <<EOF | |
echo -e "\nNow executing /root/doit" | |
set -x | |
groups | |
/opt/rocm/bin/clinfo | grep "Number" | |
/opt/rocm/bin/clinfo | grep Board | |
git clone https://github.com/rsnemmen/OpenCL-examples > /dev/null | |
cd OpenCL-examples/add_numbers | |
sed -i "s#\(DDEBUG\)#\1 -I/opt/rocm/include#" Makefile | |
sed -i "s#\(lOpenCL\)#\1 -L/opt/rocm/lib#" Makefile | |
make 2>/dev/null | |
./add_numbers | |
EOF | |
# execute created /root/doit script | |
chmod 755 /root/doit | |
su - root ./doit | |
echo -e "\nEnter login shell for further work" | |
su -l - root |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sample execution: