From 98491cd75903f736b7955264039aaaf67157df64 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Thu, 31 May 2018 23:55:42 -0400 Subject: [PATCH] Update INSTALL.md --- INSTALL.md | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index eb219e19f7..ad6749bd0f 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -5,6 +5,7 @@ - [Installing pre-built packages](#installing-pre-built-packages) * [Prerequisites](#prerequisites) * [AMD-hcc](#amd-hcc) + * [AMD-clang](#amd-clang) * [NVIDIA-nvcc](#nvidia-nvcc) * [Verify your installation](#verify-your-installation) - [Building HIP from source](#building-hip-from-source) @@ -18,7 +19,7 @@ HIP can be easily installed using pre-built binary packages using the package manager for your platform. ## Prerequisites -HIP code can be developed either on AMD ROCm platform using hcc compiler, or a CUDA platform with nvcc installed: +HIP code can be developed either on AMD ROCm platform using hcc or clang compiler, or a CUDA platform with nvcc installed: ## AMD-hcc @@ -31,6 +32,38 @@ HIP code can be developed either on AMD ROCm platform using hcc compiler, or a C * By default HIP is installed into /opt/rocm/hip (can be overridden by setting HIP_PATH environment variable). * Optionally, consider adding /opt/rocm/bin to your PATH to make it easier to use the tools. +## AMD-clang + +* Using clang to compile HIP program for AMD GPU is under development. Users need to build LLVM, clang, lld, ROCm device library, and HIP from source. + +* Install the [rocm](http://gpuopen.com/getting-started-with-boltzmann-components-platforms-installation/) packages. ROCm will install some of the necessary components, including the kernel driver, HSA runtime, etc. + +* Build LLVM/clang/lld by using the following repository and branch and following the general LLVM/clang build procedure: + + * LLVM: https://github.com/RadeonOpenCompute/llvm.git amd-common branch + * clang: https://github.com/RadeonOpenCompute/clang checkout amd-hip-upstream branch, then merge with amd-common branch to match LLVM/lld + * lld: https://github.com/RadeonOpenCompute/lld amd-common branch + +* Build Rocm device library + + * Checkout https://github.com/RadeonOpenCompute/ROCm-Device-Libs.git amd-hip branch and build it with clang built from the last step. + +* Build HIP + + * Checkout https://github.com/ROCm-Developer-Tools/HIP.git hip-clang branch and build it with HCC installed with ROCm packages. + +* Environment variables to let hipcc to use clang to compile HIP program + + By default hipcc uses hcc to compile HIP program for AMD GPU. To let hipcc to use clang to compile HIP program, the following environment variables must be set: + + * HIP_CLANG_PATH - Path to clang + * DEVICE_LIB_PATH - Path to the device library + +* Default paths and environment variables: + + * By default HIP looks for HSA in /opt/rocm/hsa (can be overridden by setting HSA_PATH environment variable) + * By default HIP is installed into /opt/rocm/hip (can be overridden by setting HIP_PATH environment variable). + * Optionally, consider adding /opt/rocm/bin to your PATH to make it easier to use the tools. ## NVIDIA-nvcc * Configure the additional package server as described [here](http://gpuopen.com/getting-started-with-boltzmann-components-platforms-installation/).