From 244689a2f348a338786f97c7a09af85c614339a9 Mon Sep 17 00:00:00 2001 From: Evgeny Mankov Date: Sat, 1 Feb 2020 18:47:46 +0300 Subject: [PATCH] [HIPIFY][doc] CUDA 10.2 is now supported by LLVM 10.0.0-rc1 --- hipamd/hipify-clang/README.md | 60 +++++++++++++++++++++++++---------- 1 file changed, 44 insertions(+), 16 deletions(-) diff --git a/hipamd/hipify-clang/README.md b/hipamd/hipify-clang/README.md index 45cd6657e1..bc29af9772 100644 --- a/hipamd/hipify-clang/README.md +++ b/hipamd/hipify-clang/README.md @@ -42,9 +42,10 @@ After applying all the matchers, the output HIP source is produced. `hipify-clang` requires: -1. [**LLVM+CLANG**](http://releases.llvm.org) of at least version [3.8.0](http://releases.llvm.org/download.html#3.8.0); the latest stable and recommended release: [**9.0.1**](http://releases.llvm.org/download.html#9.0.1). +1. [**LLVM+CLANG**](http://releases.llvm.org) of at least version [3.8.0](http://releases.llvm.org/download.html#3.8.0); the latest stable and recommended release: [**9.0.1**](http://releases.llvm.org/download.html#9.0.1), the latest release candidate: [10.0.0-rc1](https://github.com/llvm/llvm-project/releases/tag/llvmorg-10.0.0-rc1). 2. [**CUDA**](https://developer.nvidia.com/cuda-downloads) of at least version [7.0](https://developer.nvidia.com/cuda-toolkit-70), the latest supported version is [**10.1 Update 2**](https://developer.nvidia.com/cuda-10.1-download-archive-base). +To use the latest CUDA version [10.2](https://developer.nvidia.com/cuda-downloads) please use the latest LLVM release candidate: [10.0.0-rc1](https://github.com/llvm/llvm-project/releases/tag/llvmorg-10.0.0-rc1). | **LLVM release version** | **CUDA latest supported version** | **Windows** | **Linux** | |:----------------------------------------------------------:|:------------------------------------------------------------------------:|:-----------:|:---------:| @@ -66,6 +67,7 @@ After applying all the matchers, the output HIP source is produced. | [8.0.1](http://releases.llvm.org/download.html#8.0.1) | [10.0](https://developer.nvidia.com/cuda-10.0-download-archive) | -
not working due to
the clang's bug [38811](https://bugs.llvm.org/show_bug.cgi?id=38811)
+
[patch](patches/patch_for_clang_8.0.1_bug_38811.zip)*
| + | | [9.0.0](http://releases.llvm.org/download.html#9.0.0) | [10.1](https://developer.nvidia.com/cuda-10.1-download-archive-base) | + | + | | [**9.0.1**](http://releases.llvm.org/download.html#9.0.1) | [**10.1**](https://developer.nvidia.com/cuda-10.1-download-archive-base) | +
**LATEST STABLE RELEASE** | +
**LATEST STABLE RELEASE** | +| [10.0.0-rc1](https://github.com/llvm/llvm-project/releases/tag/llvmorg-10.0.0-rc1) | [10.2](https://developer.nvidia.com/cuda-downloads) | + | + | `*` Download the patch and unpack it into your LLVM distributive directory; a few header files will be overwritten; rebuilding of LLVM is not needed. @@ -111,7 +113,8 @@ cmake \ make -j install ``` -On Windows, the following option should be specified for `cmake` at first place: `-G "Visual Studio 16 2019 Win64"`; the generated `hipify-clang.sln` should be built by `Visual Studio 15 2017` instead of `make.` +On Windows, the following option should be specified for `cmake` at first place: `-G "Visual Studio 16 2019 Win64"`; the generated `hipify-clang.sln` should be built by `Visual Studio 16 2019` instead of `make.` +Please, see [hipify-clang: Windows](#windows) for the supported tools for building. Debug build type `-DCMAKE_BUILD_TYPE=Debug` is also supported and tested; `LLVM+CLANG` should be built in `Debug` mode as well. 64-bit build mode (`-Thost=x64` on Windows) is also supported; `LLVM+CLANG` should be built in 64-bit mode as well. @@ -122,18 +125,14 @@ The binary can then be found at `./dist/bin/hipify-clang`. `hipify-clang` has unit tests using LLVM [`lit`](https://llvm.org/docs/CommandGuide/lit.html)/[`FileCheck`](https://llvm.org/docs/CommandGuide/FileCheck.html). -**LLVM+CLANG should be built from sources, pre-built binaries are not exhaustive for testing.** +LLVM+CLANG should be built from sources, pre-built binaries are not exhaustive for testing. + +**LLVM 9.0.1 or older:** -To run it: 1. download [`LLVM`](http://releases.llvm.org/9.0.1/llvm-9.0.1.src.tar.xz)+[`CLANG`](http://releases.llvm.org/9.0.1/cfe-9.0.1.src.tar.xz) sources; -2. build [`LLVM+CLANG`](http://llvm.org/docs/CMake.html): - ```shell - cd llvm - mkdir build dist - cd build - ``` +2. build [`LLVM+CLANG`](http://releases.llvm.org/9.0.0/docs/CMake.html): - - **Linux**: + **Linux**: ```shell cmake \ -DCMAKE_INSTALL_PREFIX=../dist \ @@ -143,8 +142,7 @@ To run it: ../llvm make -j install ``` - - - **Windows**: + **Windows**: ```shell cmake \ -G "Visual Studio 16 2019" \ @@ -156,9 +154,40 @@ To run it: -Thost=x64 \ ../llvm ``` -                 Run `Visual Studio 16 2019`, open the generated `LLVM.sln`, build all, build project `INSTALL`. +**LLVM 10.0.0 or newer:** + +1. download [`LLVM project`](https://github.com/llvm/llvm-project/archive/llvmorg-10.0.0-rc1.tar.gz) sources; +2. build [`LLVM project`](http://llvm.org/docs/CMake.html): + + **Linux**: + ```shell + cmake \ + -DCMAKE_INSTALL_PREFIX=../dist \ + -DLLVM_SOURCE_DIR=../llvm-project \ + -DLLVM_TARGETS_TO_BUILD="X86;NVPTX" \ + -DLLVM_ENABLE_PROJECTS="clang" \ + -DCMAKE_BUILD_TYPE=Release \ + ../llvm-project/llvm + make -j install + ``` + **Windows**: + ```shell + cmake \ + -G "Visual Studio 16 2019" \ + -A x64 \ + -DCMAKE_INSTALL_PREFIX=../dist \ + -DLLVM_SOURCE_DIR=../llvm-project \ + -DLLVM_TARGETS_TO_BUILD="NVPTX" \ + -DLLVM_ENABLE_PROJECTS="clang" \ + -DCMAKE_BUILD_TYPE=Release \ + -Thost=x64 \ + ../llvm-project/llvm + ``` +                Run `Visual Studio 16 2019`, open the generated `LLVM.sln`, build all, build project `INSTALL`. + + 3. Ensure [`CUDA`](https://developer.nvidia.com/cuda-toolkit-archive) of minimum version 7.0 is installed. @@ -384,7 +413,7 @@ LLVM 7.0.0 - 9.0.1, CUDA 7.5 - 10.1 Update 2, cudnn 7.0.5.15 - 7.6.5.32 Build system requirements for the latest configuration LLVM 9.0.1/CUDA 10.1 Update 2: -Python 3.6.0 - 3.8.1, cmake 3.5.1 - 3.16.3, Visual Studio 2017 (15.5.2) - 2019 (16.4.3). +Python 3.6.0 - 3.8.1, cmake 3.5.1 - 3.16.3, Visual Studio 2017 (15.5.2) - 2019 (16.4.4). Here is an example of building `hipify-clang` with testing support on `Windows 10` by `Visual Studio 16 2019`: @@ -481,4 +510,3 @@ The information contained herein is for informational purposes only, and is subj AMD, the AMD Arrow logo, and combinations thereof are trademarks of Advanced Micro Devices, Inc. Other product names used in this publication are for identification purposes only and may be trademarks of their respective companies. Copyright (c) 2014-2020 Advanced Micro Devices, Inc. All rights reserved. -