mirror of
https://github.com/ROCm/ROCm-docker.git
synced 2026-05-05 07:36:12 +02:00
Merge pull request #5 from kknox/develop
Updating hcc-isa & hcc-hsails builds 👍
This commit is contained in:
commit
d263b2ebf6
@ -51,7 +51,7 @@ ENV PATH ${PATH}:${HCC_INSTALL_PATH}/bin
|
||||
# Build hcc, install to /usr/local
|
||||
RUN mkdir -p ${HCC_BUILD_PATH} && \
|
||||
cd ${HCC_BUILD_PATH} && \
|
||||
git clone --depth=1 --branch=~~branch~~ https://bitbucket.org/multicoreware/hcc.git ./ && \
|
||||
git clone --depth=1 --branch=~~branch~~ https://github.com/RadeonOpenCompute/hcc.git ./ && \
|
||||
mkdir -p build && \
|
||||
cd build && \
|
||||
cmake \
|
||||
@ -66,3 +66,5 @@ RUN mkdir -p ${HCC_BUILD_PATH} && \
|
||||
cd ~ && rm -rf ${HCC_BUILD_PATH} && \
|
||||
echo "${HCC_INSTALL_PATH}/lib" >> /etc/ld.so.conf.d/hcc.conf && \
|
||||
ldconfig
|
||||
|
||||
# VOLUME [${HCC_INSTALL_PATH}]
|
||||
|
||||
@ -42,7 +42,7 @@ RUN mkdir -p ~/bin && \
|
||||
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo && \
|
||||
chmod a+x ~/bin/repo
|
||||
|
||||
# Build hcc-lc, install to /usr/local
|
||||
# Build hcc-isa, install to /usr/local
|
||||
RUN mkdir -p ${HCC_BUILD_PATH} && \
|
||||
cd ${HCC_BUILD_PATH} && \
|
||||
~/bin/repo init -u https://github.com/RadeonOpenCompute/HCC-Native-GCN-ISA.git -b ~~branch~~ && \
|
||||
@ -50,19 +50,35 @@ RUN mkdir -p ${HCC_BUILD_PATH} && \
|
||||
cd llvm && \
|
||||
mkdir -p build && \
|
||||
cd build && \
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="AMDGPU;X86" .. && \
|
||||
make -j $(nproc) && \
|
||||
cmake \
|
||||
-DCMAKE_INSTALL_PREFIX=${HCC_INSTALL_PATH} \
|
||||
-DCMAKE_BUILD_TYPE=~~config~~ \
|
||||
-DLLVM_TARGETS_TO_BUILD="AMDGPU;X86" .. && \
|
||||
make -j $(nproc) install && \
|
||||
|
||||
cd ../../llvm-amdgpu-assembler-extra/ && \
|
||||
mkdir -p build && \
|
||||
cd build && \
|
||||
cmake \
|
||||
-DCMAKE_INSTALL_PREFIX=${HCC_INSTALL_PATH} \
|
||||
-DCMAKE_BUILD_TYPE=~~config~~ \
|
||||
-DLLVM_DIR="${HCC_BUILD_PATH}/llvm/build" .. && \
|
||||
make -j $(nproc) install && \
|
||||
|
||||
cd ../../hcc && \
|
||||
mkdir -p build && \
|
||||
cd build && \
|
||||
cmake \
|
||||
-DCMAKE_INSTALL_PREFIX=${HCC_INSTALL_PATH} \
|
||||
-DCMAKE_BUILD_TYPE=~~config~~ \
|
||||
-DHSA_LLVM_BIN_DIR=/usr/local/src/hcc-isa/llvm/build/bin \
|
||||
-DHSA_LLVM_BIN_DIR=${HCC_INSTALL_PATH}/bin \
|
||||
-DHSA_AMDGPU_GPU_TARGET=fiji \
|
||||
-DAMDPHDRS_DIR=${HCC_BUILD_PATH}/llvm-amdgpu-assembler-extra/build/amdphdrs/ \
|
||||
-DHSA_USE_AMDGPU_BACKEND=ON .. && \
|
||||
make -j $(nproc) world && \
|
||||
make install && \
|
||||
rm -rf ${HCC_BUILD_PATH} && \
|
||||
echo "${HCC_INSTALL_PATH}/lib" >> /etc/ld.so.conf.d/hcc-isa.conf && \
|
||||
ldconfig
|
||||
|
||||
# VOLUME [${HCC_INSTALL_PATH}]
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
# Copy this dockerfile into a new build context (directory) and modify to taste.
|
||||
|
||||
# After a new build context is created, build with
|
||||
# `docker build -f <project-name>-dockerfile -t <user-name>/<project-name> .`
|
||||
# `docker build -t <user-name>/<project-name> .`
|
||||
|
||||
# Run the container to start up a development environment. Optionally, map host
|
||||
# directories into the container with -v for development convenience, which is
|
||||
79
roc-setup.sh
79
roc-setup.sh
@ -3,6 +3,9 @@
|
||||
# Set reasonable defaults for dockerfile builds
|
||||
# Default: --master, --release
|
||||
|
||||
# #################################################
|
||||
# Initialization of command line parameters
|
||||
# #################################################
|
||||
# Build dockerfiles from more stable master branches; exclusive with --develop
|
||||
build_master=1
|
||||
|
||||
@ -15,16 +18,32 @@ build_release=1
|
||||
# Build debug binaries; this leaves build tree intact for greater debugging; exclusive with --release
|
||||
build_debug=
|
||||
|
||||
# Build debug binaries; this leaves build tree intact for greater debugging; exclusive with --release
|
||||
remove_images=
|
||||
|
||||
# Build debug binaries; this leaves build tree intact for greater debugging; exclusive with --release
|
||||
dry_run=
|
||||
|
||||
# #################################################
|
||||
# helper functions
|
||||
# #################################################
|
||||
function display_help()
|
||||
{
|
||||
echo "Building ROC docker images from templates"
|
||||
echo "Usage: ./roc-setup [--master | --develop] [--release | --debug]"
|
||||
echo "Default flags: --master --release"
|
||||
echo ""
|
||||
echo "--master) Build dockerfiles from stable master branches; exclusive with --develop"
|
||||
echo "--develop) Build dockerfiles from integration branches; exclusive with --master"
|
||||
echo "--release) Build release containers; minimizes size of docker images; exclusive with --debug"
|
||||
echo "--debug) Build debug containers; symbols generated and build tree intact for debugging; exclusive with --release"
|
||||
echo "--remove_images) Based on the other flags passed, remove the docker images instead of building them"
|
||||
echo "--dry_run) Print out what would happen with the script, without executing commands"
|
||||
}
|
||||
|
||||
# #################################################
|
||||
# Start of main
|
||||
# #################################################
|
||||
while :; do
|
||||
case $1 in
|
||||
--master)
|
||||
@ -43,6 +62,12 @@ while :; do
|
||||
build_release=
|
||||
build_debug=1
|
||||
;;
|
||||
--remove_images)
|
||||
remove_images=1
|
||||
;;
|
||||
--dry_run)
|
||||
dry_run=1
|
||||
;;
|
||||
-h|--help)
|
||||
display_help
|
||||
exit
|
||||
@ -100,22 +125,54 @@ rocr_docker_build="${rocr_docker_build} | sed s/~~config~~/${build_config}/g -"
|
||||
hcc_hsail_docker_build="${hcc_hsail_docker_build} | sed s/~~config~~/${build_config}/g -"
|
||||
hcc_isa_docker_build="${hcc_isa_docker_build} | sed s/~~config~~/${build_config}/g -"
|
||||
|
||||
# Uncomment below to debug individual dockerfile templates; generated dockerfile is printed to screen
|
||||
# Uncomment below to print dockerfiles with template substitutions; debugging
|
||||
#eval ${rock_docker_build}
|
||||
#eval ${roct_docker_build}
|
||||
#eval ${rocr_docker_build}
|
||||
#eval ${hcc_hsail_docker_build}
|
||||
#eval ${hcc_isa_docker_build}
|
||||
|
||||
rock_docker_build="${rock_docker_build} | docker build -t ${rock_name} -"
|
||||
roct_docker_build="${roct_docker_build} | docker build -t ${roct_name} -"
|
||||
rocr_docker_build="${rocr_docker_build} | docker build -t ${rocr_name} -"
|
||||
hcc_hsail_docker_build="${hcc_hsail_docker_build} | docker build -t ${hcc_hsail_name} -"
|
||||
hcc_isa_docker_build="${hcc_isa_docker_build} | docker build -t ${hcc_isa_name} -"
|
||||
# Build or remove docker images based on passed in option
|
||||
if [ -n "${remove_images}" ]; then
|
||||
rock_docker_build="docker rmi ${rock_name}"
|
||||
roct_docker_build="docker rmi ${roct_name}"
|
||||
rocr_docker_build="docker rmi ${rocr_name}"
|
||||
hcc_hsail_docker_build="docker rmi ${hcc_hsail_name}"
|
||||
hcc_isa_docker_build="docker rmi ${hcc_isa_name}"
|
||||
else
|
||||
rock_docker_build="${rock_docker_build} | docker build -t ${rock_name} -"
|
||||
roct_docker_build="${roct_docker_build} | docker build -t ${roct_name} -"
|
||||
rocr_docker_build="${rocr_docker_build} | docker build -t ${rocr_name} -"
|
||||
hcc_hsail_docker_build="${hcc_hsail_docker_build} | docker build -t ${hcc_hsail_name} -"
|
||||
hcc_isa_docker_build="${hcc_isa_docker_build} | docker build -t ${hcc_isa_name} -"
|
||||
fi
|
||||
|
||||
# These statements below generate the actual docker images
|
||||
eval ${rock_docker_build}
|
||||
eval ${roct_docker_build}
|
||||
eval ${rocr_docker_build}
|
||||
eval ${hcc_hsail_docker_build}
|
||||
eval ${hcc_isa_docker_build}
|
||||
if [ -n "${dry_run}" ]; then
|
||||
echo ${rock_docker_build}
|
||||
echo ${roct_docker_build}
|
||||
echo ${rocr_docker_build}
|
||||
echo ${hcc_hsail_docker_build}
|
||||
echo ${hcc_isa_docker_build}
|
||||
else
|
||||
echo "# #################################################"
|
||||
echo "# Building ROCK container"
|
||||
echo "# #################################################"
|
||||
eval ${rock_docker_build}
|
||||
echo "# #################################################"
|
||||
echo "# Building ROCT container"
|
||||
echo "# #################################################"
|
||||
eval ${roct_docker_build}
|
||||
echo "# #################################################"
|
||||
echo "# Building ROCR container"
|
||||
echo "# #################################################"
|
||||
eval ${rocr_docker_build}
|
||||
echo "# #################################################"
|
||||
echo "# Building HCC-HSAIL container"
|
||||
echo "# #################################################"
|
||||
eval ${hcc_hsail_docker_build}
|
||||
echo "# #################################################"
|
||||
echo "# Building HCC-ISA container"
|
||||
echo "# #################################################"
|
||||
eval ${hcc_isa_docker_build}
|
||||
fi
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user