Skip to content

Commit 3d5ab76

Browse files
authored
SWDEV-398297 - HIP Documentation Updates for ROCm 5.6 (#3234)
Change-Id: Ic1fe8c4b7a98d86902a59676b1dc99c150650d30
1 parent 77831c9 commit 3d5ab76

File tree

4 files changed

+59
-38
lines changed

4 files changed

+59
-38
lines changed

docs/.sphinx/_toc.yml.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ subtrees:
55
- file: user_guide/programming_manual
66
- file: user_guide/hip_rtc
77
- file: user_guide/faq
8-
- file: user_guide/hip_porting_guide
8+
- file: user_guide/hip_porting_guide
99
- file: user_guide/hip_porting_driver_api
1010
- caption: How to Guides
1111
entries:

docs/developer_guide/build.md

Lines changed: 55 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@ HIP code can be developed either on AMD ROCm platform using HIP-Clang compiler,
66
Before build and run HIP, make sure drivers and pre-build packages are installed properly on the platform.
77

88
### AMD platform
9-
Install ROCm packages (see ROCm Installation Guide on AMD public documentation site (https://docs.amd.com/)) or install pre-built binary packages using the package manager,
9+
Install ROCm packages (see ROCm Installation Guide on AMD public documentation site (https://docs.amd.com/) or install pre-built binary packages using the package manager,
1010

1111
```shell
1212
sudo apt install mesa-common-dev
1313
sudo apt install clang
1414
sudo apt install comgr
1515
sudo apt-get -y install rocm-dkms
16+
sudo apt-get install -y libelf-dev
1617
```
1718

1819
### NVIDIA platform
@@ -22,14 +23,14 @@ Install Nvidia driver and pre-build packages (see HIP Installation Guide at http
2223
### Branch of repository
2324

2425
Before get HIP source code, set the expected branch of repository at the variable `ROCM_BRANCH`.
25-
For example, for ROCm5.0 release branch, set
26+
For example, for ROCm5.6 release branch, set
2627
```shell
27-
export ROCM_BRANCH=rocm-5.0.x
28+
export ROCM_BRANCH=rocm-5.6.x
2829
```
2930

30-
ROCm5.4 release branch, set
31+
ROCm5.6 release branch, set
3132
```shell
32-
export ROCM_BRANCH=rocm-5.4.x
33+
export ROCM_BRANCH=rocm-5.6.x
3334
```
3435
Similiar format for future branches.
3536

@@ -42,38 +43,47 @@ Similiar format for future branches.
4243
### Get HIP source code
4344

4445
```shell
45-
git clone -b "$ROCM_BRANCH" https://github.com/ROCm-Developer-Tools/hipamd.git
46+
git clone -b "$ROCM_BRANCH" https://github.com/ROCm-Developer-Tools/clr.git
4647
git clone -b "$ROCM_BRANCH" https://github.com/ROCm-Developer-Tools/hip.git
47-
git clone -b "$ROCM_BRANCH" https://github.com/ROCm-Developer-Tools/ROCclr.git
48-
git clone -b "$ROCM_BRANCH" https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime.git
48+
git clone -b "$ROCM_BRANCH" https://github.com/ROCm-Developer-Tools/HIPCC.git
4949
```
5050

5151
### Set the environment variables
5252

5353
```shell
54-
export HIPAMD_DIR="$(readlink -f hipamd)"
54+
export CLR_DIR="$(readlink -f clr)"
5555
export HIP_DIR="$(readlink -f hip)"
56+
export HIPCC_DIR="$(readlink -f hipcc)"
5657
```
5758

58-
ROCclr is defined on AMD platform that HIP use Radeon Open Compute Common Language Runtime (ROCclr), which is a virtual device interface that HIP runtimes interact with different backends.
59-
See https://github.com/ROCm-Developer-Tools/ROCclr
59+
Note, starting from ROCM 5.6 release, clr is a new repository including the previous ROCclr, HIPAMD and OpenCl repositories.
60+
ROCclr is defined on AMD platform that HIP uses Radeon Open Compute Common Language Runtime (ROCclr), which is a virtual device interface that HIP runtimes interact with different backends.
61+
HIPAMD provides implementation specifically for AMD platform.
62+
OpenCL provides headers that ROCclr runtime currently depends on.
6063

61-
HIPAMD repository provides implementation specifically for AMD platform.
62-
See https://github.com/ROCm-Developer-Tools/hipamd
64+
### Build the HIPCC runtime
65+
66+
```shell
67+
cd "$HIPCC_DIR"
68+
mkdir -p build; cd build
69+
cmake ..
70+
make -j4
71+
```
6372

6473
### Build HIP
6574

6675
```shell
67-
cd "$HIPAMD_DIR"
76+
cd "$CLR_DIR"
6877
mkdir -p build; cd build
69-
cmake -DHIP_COMMON_DIR=$HIP_DIR -DCMAKE_PREFIX_PATH="<ROCM_PATH>/" -DCMAKE_INSTALL_PREFIX=$PWD/install ..
78+
cmake -DHIP_COMMON_DIR=$HIP_DIR -DHIP_PLATFORM=amd -DCMAKE_PREFIX_PATH="/opt/rocm/" -DCMAKE_INSTALL_PREFIX=$PWD/install -DHIPCC_BIN_DIR=$HIPCC_DIR/build -DHIP_CATCH_TEST=0 -DCLR_BUILD_HIP=ON -DCLR_BUILD_OCL=OFF ..
79+
7080
make -j$(nproc)
7181
sudo make install
7282
```
73-
::::{note}
74-
If you don't specify `CMAKE_INSTALL_PREFIX`, hip runtime will be installed to `<ROCM_PATH>/hip`.
75-
By default, release version of AMDHIP is built.
76-
::::
83+
84+
Note, if `CMAKE_INSTALL_PREFIX` is not specified, hip runtime will be installed to `<ROCM_PATH>/hip`.
85+
By default, release version of HIP is built.
86+
7787

7888
### Default paths and environment variables
7989

@@ -120,9 +130,9 @@ Developers can build HIP directed tests right after build HIP commands,
120130
sudo make install
121131
make -j$(nproc) build_tests
122132
```
123-
By default, all HIP directed tests will be built and generated under the folder `$HIPAMD_DIR/build/`directed_tests.
133+
By default, all HIP directed tests will be built and generated under the folder `$CLR_DIR/build/hipamd`directed_tests.
124134
Take HIP directed device APIs tests, as an example, all available test applications will have executable files generated under,
125-
`$HIPAMD_DIR/build/directed_tests/runtimeApi/device`.
135+
`$CLR_DIR/build/hipamd/directed_tests/runtimeApi/device`.
126136

127137
Run all HIP directed_tests, use the command,
128138

@@ -138,7 +148,7 @@ Build and run a single directed test, use the follow command as an example,
138148

139149
```shell
140150
make directed_tests.texture.hipTexObjPitch
141-
cd $HIPAMD_DIR/build/directed_tests/texcture
151+
cd $CLR_DIR/build/hipamd/directed_tests/texcture
142152
./hipTexObjPitch
143153
```
144154
Please note, the integrated HIP directed tests, will be deprecated in future release.
@@ -156,20 +166,20 @@ git clone -b "$ROCM_BRANCH" https://github.com/ROCm-Developer-Tools/hip-tests.gi
156166
##### Build HIP tests from source
157167

158168
```shell
159-
export HIP_TESTS_DIR="$(readlink -f hip-tests)"
160-
cd "$HIP_TESTS_DIR"
169+
export HIPTESTS_DIR="$(readlink -f hip-tests)"
170+
cd "$HIPTESTS_DIR"
161171
mkdir -p build; cd build
162-
export HIP_PATH=$HIPAMD_DIR/build/install (or any path where HIP is installed, for example, /opt/rocm)
172+
export HIP_PATH=$CLR_DIR/build/install (or any path where HIP is installed, for example, /opt/rocm)
163173
cmake ../catch/ -DHIP_PLATFORM=amd
164174
make -j$(nproc) build_tests
165175
ctest # run tests
166176
```
167-
HIP catch tests are built under the folder $HIP_TESTS_DIR/build.
177+
HIP catch tests are built under the folder $HIPTESTS_DIR/build.
168178

169179
To run any single catch test, the following is an example,
170180

171181
```shell
172-
cd $HIP_TESTS_DIR/build/catch_tests/unit/texture
182+
cd $HIPTESTS_DIR/build/catch_tests/unit/texture
173183
./TextureTest
174184
```
175185

@@ -178,8 +188,8 @@ cd $HIP_TESTS_DIR/build/catch_tests/unit/texture
178188
HIP Catch2 supports build a standalone test, for example,
179189

180190
```shell
181-
cd "$HIP_TESTS_DIR"
182-
hipcc $HIP_TESTS_DIR/catch/unit/memory/hipPointerGetAttributes.cc -I ./catch/include ./catch/hipTestMain/standalone_main.cc -I ./catch/external/Catch2 -o hipPointerGetAttributes
191+
cd "$HIPTESTS_DIR"
192+
hipcc $HIPTESTS_DIR/catch/unit/memory/hipPointerGetAttributes.cc -I ./catch/include ./catch/hipTestMain/standalone_main.cc -I ./catch/external/Catch2 -o hipPointerGetAttributes
183193
./hipPointerGetAttributes
184194
...
185195

@@ -193,22 +203,33 @@ All tests passed
193203

194204
```shell
195205
git clone -b "$ROCM_BRANCH" https://github.com/ROCm-Developer-Tools/hip.git
196-
git clone -b "$ROCM_BRANCH" https://github.com/ROCm-Developer-Tools/hipamd.git
206+
git clone -b "$ROCM_BRANCH" https://github.com/ROCm-Developer-Tools/clr.git
207+
git clone -b "$ROCM_BRANCH" https://github.com/ROCm-Developer-Tools/HIPCC.git
197208
```
198209

199210
### Set the environment variables
200211

201212
```shell
202213
export HIP_DIR="$(readlink -f hip)"
203-
export HIPAMD_DIR="$(readlink -f hipamd)"
214+
export CLR_DIR="$(readlink -f hipamd)"
215+
export HIPCC_DIR="$(readlink -f hipcc)"
216+
```
217+
218+
### Build the HIPCC runtime
219+
220+
```shell
221+
cd "$HIPCC_DIR"
222+
mkdir -p build; cd build
223+
cmake ..
224+
make -j4
204225
```
205226

206227
### Build HIP
207228

208229
```shell
209-
cd "$HIPAMD_DIR"
230+
cd "$CLR_DIR"
210231
mkdir -p build; cd build
211-
cmake -DHIP_COMMON_DIR=$HIP_DIR -DHIP_PLATFORM=nvidia -DCMAKE_INSTALL_PREFIX=$PWD/install ..
232+
cmake -DHIP_COMMON_DIR=$HIP_DIR -DHIP_PLATFORM=nvidia -DCMAKE_INSTALL_PREFIX=$PWD/install -DHIPCC_BIN_DIR=$HIPCC_DIR/build -DHIP_CATCH_TEST=0 -DCLR_BUILD_HIP=ON -DCLR_BUILD_OCL=OFF ..
212233
make -j$(nproc)
213234
sudo make install
214235
```
@@ -218,5 +239,5 @@ Build HIP tests commands on NVIDIA platform are basically the same as AMD, excep
218239

219240
## Run HIP
220241

221-
Compile and run the [square sample](https://github.com/ROCm-Developer-Tools/HIP/tree/rocm-5.0.x/samples/0_Intro/square).
242+
Compile and run the [square sample](https://github.com/ROCm-Developer-Tools/hip-tests/tree/rocm-5.5.x/samples/0_Intro/square).
222243

docs/how_to_guides/debugging.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ So HIP runtime can wait for GPU idle before/after any GPU command depending on t
204204

205205
### Making Device visible
206206
For system with multiple devices, it's possible to make only certain device(s) visible to HIP via setting environment variable,
207-
HIP_VISIBLE_DEVICES, only devices whose index is present in the sequence are visible to HIP.
207+
HIP_VISIBLE_DEVICES(or CUDA_VISIBLE_DEVICES on Nvidia platform), only devices whose index is present in the sequence are visible to HIP.
208208

209209
For example,
210210
```console
@@ -244,7 +244,7 @@ The following is the summary of the most useful environment variables in HIP.
244244
| ---------------------------------------------------------------------------------------------------------------| ----------------- | --------- |
245245
| AMD_LOG_LEVEL <br><sub> Enable HIP log on different Level. </sub> | 0 | 0: Disable log. <br> 1: Enable log on error level. <br> 2: Enable log on warning and below levels. <br> 0x3: Enable log on information and below levels. <br> 0x4: Decode and display AQL packets. |
246246
| AMD_LOG_MASK <br><sub> Enable HIP log on different Level. </sub> | 0x7FFFFFFF | 0x1: Log API calls. <br> 0x02: Kernel and Copy Commands and Barriers. <br> 0x4: Synchronization and waiting for commands to finish. <br> 0x8: Enable log on information and below levels. <br> 0x20: Queue commands and queue contents. <br> 0x40:Signal creation, allocation, pool. <br> 0x80: Locks and thread-safety code. <br> 0x100: Copy debug. <br> 0x200: Detailed copy debug. <br> 0x400: Resource allocation, performance-impacting events. <br> 0x800: Initialization and shutdown. <br> 0x1000: Misc debug, not yet classified. <br> 0x2000: Show raw bytes of AQL packet. <br> 0x4000: Show code creation debug. <br> 0x8000: More detailed command info, including barrier commands. <br> 0x10000: Log message location. <br> 0xFFFFFFFF: Log always even mask flag is zero. |
247-
| HIP_VISIBLE_DEVICES <br><sub> Only devices whose index is present in the sequence are visible to HIP. </sub> | | 0,1,2: Depending on the number of devices on the system. |
247+
| HIP_VISIBLE_DEVICES(or CUDA_VISIBLE_DEVICES) <br><sub> Only devices whose index is present in the sequence are visible to HIP. </sub> | | 0,1,2: Depending on the number of devices on the system. |
248248
| GPU_DUMP_CODE_OBJECT <br><sub> Dump code object. </sub> | 0 | 0: Disable. <br> 1: Enable. |
249249
| AMD_SERIALIZE_KERNEL <br><sub> Serialize kernel enqueue. </sub> | 0 | 1: Wait for completion before enqueue. <br> 2: Wait for completion after enqueue. <br> 3: Both. |
250250
| AMD_SERIALIZE_COPY <br><sub> Serialize copies. </sub> | 0 | 1: Wait for completion before enqueue. <br> 2: Wait for completion after enqueue. <br> 3: Both. |

docs/user_guide/faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ If you have compiled the application yourself, make sure you have given the corr
226226
If you have a precompiled application/library (like rocblas, tensorflow etc) which gives you such error, there are one of two possibilities.
227227

228228
- The application/library does not ship code object bundles for *all* of your device(s): in this case you need to recompile the application/library yourself with correct `--offload-arch`.
229-
- The application/library does not ship code object bundles for *some* of your device(s), for example you have a system with an APU + GPU and the library does not ship code objects for your APU. For this you can set the environment variable `HIP_VISIBLE_DEVICES` to only enable GPUs for which code object is available. This will limit the GPUs visible to your application and allow it to run.
229+
- The application/library does not ship code object bundles for *some* of your device(s), for example you have a system with an APU + GPU and the library does not ship code objects for your APU. For this you can set the environment variable `HIP_VISIBLE_DEVICES` or `CUDA_VISIBLE_DEVICES` on NVdia platform, to only enable GPUs for which code object is available. This will limit the GPUs visible to your application and allow it to run.
230230

231231
## How to use per-thread default stream in HIP?
232232

0 commit comments

Comments
 (0)