Skip to content
This repository has been archived by the owner on Jan 26, 2024. It is now read-only.

Update environment variable from VDI_DIR to ROCclr_DIR #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
93 changes: 53 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,57 @@
ROCclr is a virtual device interface that compute runtimes interact with to different backends such as ROCr or PAL
This abstraction allows runtimes to work on Windows as well as on Linux without much effort.

To build:

Prerequisites

Install mesa-common-dev

Either build or install comgr & clang


git clone https://github.com/ROCm-Developer-Tools/ROCclr.git

export VDI_DIR="$(readlink -f ROCclr)"

git clone -b master-next https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime.git

export OPENCL_DIR="$(readlink -f ROCm-OpenCL-Runtime)"

cd ../ROCclr

mkdir -p build; cd build

cmake -DOPENCL_DIR="$OPENCL_DIR" -DCMAKE_INSTALL_PREFIX=/opt/rocm/vdi ..

make


For release build, add "-DCMAKE_BUILD_TYPE=Release" to the cmake command line. This make 10% difference in some benchmark test.
## Repository branches
The repository maintains several branches. The branches that are of importance are:

- master: This is the default branch.

## Building

### Prerequisites

- Install mesa-common-dev
- Either build or install comgr & clang

### Getting the source code

```bash
git clone https://github.com/ROCm-Developer-Tools/ROCclr.git
git clone -b master-next https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime.git
```

(Optional) Build the HIP runtime

git clone -b master-next https://github.com/ROCm-Developer-Tools/HIP.git

export HIP_DIR="$(readlink -f hip)"

cd "$HIP_DIR"

mkdir -p build; cd build

cmake -DHIP_COMPILER=clang -DHIP_PLATFORM=vdi -DVDI_DIR="$VDI_DIR" -DLIBVDI_STATIC_DIR="$VDI_DIR/build" ..

make
### Set the environment variables

```bash
export ROCclr_DIR="$(readlink -f ROCclr)"
export OPENCL_DIR="$(readlink -f ROCm-OpenCL-Runtime)"
```

### Build ROCclr
Here is command to build ROCclr:
```bash
cd "$ROCclr_DIR"
mkdir -p build; cd build
cmake -DOPENCL_DIR="$OPENCL_DIR" -DCMAKE_INSTALL_PREFIX=/opt/rocm/vdi ..
make
```

### Optional steps to build HIP runtime
Enter the directory where git cloned the ROCClr and OpenCL. Run the following commands:
```bash
git clone -b master-next https://github.com/ROCm-Developer-Tools/HIP.git
export HIP_DIR="$(readlink -f HIP)"
cd "$HIP_DIR"
mkdir -p build; cd build
cmake -DHIP_COMPILER=clang -DHIP_PLATFORM=vdi -DVDI_DIR="$ROCclr_DIR" -DLIBVDI_STATIC_DIR="$ROCclr_DIR/build" ..
make
```

In future, the cmake command to build HIP runtime will be simplied like this:

```bash
cmake -DHIP_COMPILER=clang -DHIP_PLATFORM=rocclr -DCMAKE_PREFIX_PATH="$ROCclr_DIR/build" ..
```

### Release build
For release build, add "-DCMAKE_BUILD_TYPE=Release" to the cmake command line. This make 10% difference in some benchmark test.