Skip to content

Instantly share code, notes, and snippets.

@ZhijieWang
Last active August 30, 2018 22:15
Show Gist options
  • Save ZhijieWang/ad9b763a02fbf3e9674aea156b1bcce6 to your computer and use it in GitHub Desktop.
Save ZhijieWang/ad9b763a02fbf3e9674aea156b1bcce6 to your computer and use it in GitHub Desktop.
Instructions and Supplementary documentation for ROCM and CUDA porting activities

Follow Instructions on ROCM homepage to get ROCM packages, DKMS and drivers.

Current release 1.8 as the time of writing, only works on Kernel 4.13 (per my experience). Ubuntu 18.04 can use tools like ukuu to drop kernel to lower version and select older kernel at GRUB boot menu.

Once ROCM is installed, add below to shell profile

export PATH="$PATH:<ROCM DIRECTORY>/bin"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:<ROCM DIRECTORY>/hip/include"

Default <ROCM DIRECTORY> is /opt/rocm/

You need to clone HIP_CLANG repository from ROCM team https://github.com/ROCm-Developer-Tools/HIP/tree/master/hipify-clang And replace the content in ROCM default install (which does not include hipify-clang).

Below packages are needed for a fresh install Ubuntu 18.04:

cmake, llvm-6, clang-6, clang-6.0-dev, zlib1g-dev.

/opt/rocm/bin/hipconfig --full will give you a lot of helpful config variables

If you have AMD GPU already installed and try to install NVIDIA Graphics card (cuda, driver and etc), please use CUDA run file instatllation method. When using the runfile, make sure to say "NO" to NVIDIA OpenGL installation, as it conflicts with AMD driver's OpenGL code (libgl.so, if i recall). You can have both NVIDIA and AMD gpu installed, toolkit installed. But I have not been able to figure out a way to make Linux display manager works with this DUAL Vendor setup. People have documented a working solution on Ubuntu 16.04, but not on 18.04. Ubuntu 16.04 solution -- https://gist.github.com/ZhijieWang/60cf77a1a6c7edae3c24ee1d140fd968

If you are porting a project with CUDA compilation target, you need to have "-I/usr/local/cuda/include/" in either make file or add to LD_LIBRARY_PATH to make NVCC work, sometimes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment