Change-Id: Ia624d86915c4c96da0ac0242f767135f30ff73c6
Αυτή η υποβολή περιλαμβάνεται σε:
Maneesh Gupta
2016-07-25 14:53:15 +05:30
γονέας 71d51170ef
υποβολή 90a3e4e1da
7 αρχεία άλλαξαν με 106 προσθήκες και 115 διαγραφές
+13 -53
Προβολή Αρχείου
@@ -1,18 +1,17 @@
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Installation**
## Table of Contents
- [Installing pre-built packages:](#installing-pre-built-packages)
- [Prerequisites](#prerequisites)
- [AMD (hcc)](#amd-hcc)
- [NVIDIA (nvcc)](#nvidia-nvcc)
- [Verify your installation](#verify-your-installation)
<!-- toc -->
- [Installing pre-built packages](#installing-pre-built-packages)
* [Prerequisites](#prerequisites)
* [AMD-hcc](#amd-hcc)
* [NVIDIA-nvcc](#nvidia-nvcc)
* [Verify your installation](#verify-your-installation)
- [Building HIP from source](#building-hip-from-source)
- [HCC Options](#hcc-options)
- [Using HIP with the AMD Native-GCN compiler.](#using-hip-with-the-amd-native-gcn-compiler)
- [Compiling CodeXL markers for HIP Functions](#compiling-codexl-markers-for-hip-functions)
* [HCC Options](#hcc-options)
+ [Using HIP with the AMD Native-GCN compiler.](#using-hip-with-the-amd-native-gcn-compiler)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<!-- tocstop -->
# Installing pre-built packages
@@ -62,7 +61,7 @@ HIP source code is available and the project can be built from source on the HCC
2. Download HIP source code (from the [GitHub repot](https://github.com/GPUOpen-ProfessionalCompute-Tools/HIP).)
3. Build and install HIP (This is the simple version assuming default paths ; see below for additional options.)
```
cd HIP-privatestaging
cd HIP
mkdir build
cd build
cmake ..
@@ -78,7 +77,7 @@ make install
Here's a richer command-line that overrides the default paths:
```shell
cd HIP-privatestaging
cd HIP
mkdir build
cd build
cmake -DHSA_PATH=/path/to/hsa -DHCC_HOME=/path/to/hcc -DCMAKE_INSTALL_PREFIX=/where/to/install/hip -DCMAKE_BUILD_TYPE=Release ..
@@ -105,42 +104,3 @@ Alternatively, this sections describes how to build it from source:
export HCC_HOME=/path/to/native/hcc
```
### Compiling CodeXL markers for HIP Functions
HIP can generate markers at function begin/end which are displayed on the CodeXL timeline view. To do this, you need to install CodeXL, tell HIP
where the CodeXL install directory lives, and enable HIP to generate the markers:
1. Install CodeXL
See [CodeXL Download](http://developer.amd.com/tools-and-sdks/opencl-zone/codexl/?webSyncID=9d9c2cb9-3d73-5e65-268a-c7b06428e5e0&sessionGUID=29beacd0-d654-ddc6-a3e2-b9e6c0b0cc77) for the installation file.
Also this [blog](http://gpuopen.com/getting-up-to-speed-with-the-codexl-gpu-profiler-and-radeon-open-compute/) provides more information and tips for using CodeXL. In addition to installing the CodeXL profiling
and visualization tools, CodeXL also comes with an SDK that allow applications to add markers to the timeline viewer. We'll be linking HIP against this library.
2. Set CODEXL_PATH
```shell
# set to your code-xl installation location:
export CODEXL_PATH=/opt/AMD/CodeXL
```
3. Enable in source code.
In src/hip_hcc.cpp, enable the define
```c
#define COMPILE_TRACE_MARKER 1
```
Then recompile the target application, run with profiler enabled to generate ATP file or trace log.
```shell
# Use profiler to generate timeline view:
$CODEXL_PATH/CodeXLGpuProfiler -A -o ./myHipApp
...
Session output path: /home/me/HIP-privatestaging/tests/b1/mytrace.atp
```
You can also print the HIP function strings to stderr using HIP_TRACE_API environment variable. This can be useful for tracing application flow. Also can be combined with the more detailed debug information provided
by the HIP_DB switch. For example:
```shell
# Trace to stderr showing begin/end of each function (with arguments) + intermediate debug trace during the execution of each function.
HIP_TRACE_API=1 HIP_DB=0x2 ./myHipApp
```
Note this trace mode uses colors. "less -r" can handle raw control characters and will display the debug output in proper colors.