- In the install script, determine the build platform by querying [
hipconfig --platform
][4]- This is necessary, as the install script needs to know the build platform so it can to choose what dependencies to install.
hipconfig --platform
determines the platform by reading the contents of the .hipInfo file installed as part of the hip runtime.- If the platform is autodetected incorrectly, [it can be be set explicitly via an environment
variable][1], e.g.,
export HIP_PLATFORM=amd
orexport HIP_PLATFORM=nvidia
.
- In CMake,
find_package(hip REQUIRED)
will be used for both the AMD and NVIDIA platforms.- There will be no need for a different find_package call on each platform; the same call will be used for both platforms.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.16) | |
project(rocblas-init-benchmark) | |
find_package(rocblas REQUIRED) | |
add_executable(rbi main.c) | |
target_link_libraries(rbi PRIVATE roc::rocblas) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Build rocBLAS for ROCm 5.4.2 on Ubuntu 20.04 | |
set -exuo pipefail | |
apt-get -qq update | |
apt-get -qq upgrade | |
apt-get -qq install build-essential cmake wget | |
WORKSPACE=$HOME # where to download and build the sources |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
/opt/rocm/llvm/bin/clang++ --offload-arch=gfx906:xnack- -L/opt/rocm/hip/lib -lamdhip64 ex.hip |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
apt-get update -y | |
apt-get upgrade -y | |
apt-get install -y build-essential devscripts packaging-dev git vim | |
useradd -G sudo,video --shell /bin/bash --create-home cgmb | |
echo 'cgmb ALL=(ALL:ALL) NOPASSWD:ALL' >> /etc/sudoers | |
gbp clone https://salsa.debian.org/rocm-team/rocm-hipamd.git | |
cd rocm-hipamd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
apt install git build-essential cmake libgtest-dev \ | |
rocm-cmake rocminfo libamd-comgr-dev libhsakmt-dev \ | |
libhsa-runtime-dev file hipcc | |
git clone https://github.com/ROCmSoftwarePlatform/rocRAND.git | |
cd rocRAND | |
git checkout rocm-5.2.0 | |
# These environment variables are needed for now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Build ROCm 5.2.0 on Ubuntu 20.04 | |
set -exuo pipefail | |
apt-get -qq update | |
apt-get -qq upgrade | |
apt-get -qq install build-essential cmake wget | |
WORKSPACE=$HOME # where to download and build the sources |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install basic tools | |
sudo apt install build-essential devscripts packaging-dev git vim dos2unix | |
# setup workspace to build in | |
mkdir hip | |
cd hip | |
gbp clone https://salsa.debian.org/rocm-team/rocm-hipamd.git | |
cd rocm-hipamd | |
gbp export-orig |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <hip/hip_runtime.h> | |
/* | |
* Feature Test: Test if DPP is supported. Use DPP if supported; | |
* use fallback if not. | |
* | |
* Pros: Successful compilation by default. | |
* Maybe optimal performance by default? | |
* Cons: The compiler would have to provide some way to test if the | |
* necessary DPP functionality is supported. That might not exist yet. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ hipcc -c dpp-builtin.cpp --offload-arch=gfx906 | |
$ hipcc -c dpp-builtin.cpp --offload-arch=gfx1030 | |
error: Illegal instruction detected: Invalid dpp_ctrl value: broadcasts are not supported on GFX10+ | |
renamable $vgpr0 = V_MOV_B32_dpp undef $vgpr0(tied-def 0), killed $vgpr0, 323, 12, 15, 0, implicit $exec | |
1 error generated when compiling for gfx1030. |