PlasmaPower / nano-vanity

A NANO vanity address generator (supports OpenCL)
BSD 2-Clause "Simplified" License
92 stars 31 forks source link

Compilation issue with modern AMD + optimization enabled #33

Open webmaster128 opened 5 years ago

webmaster128 commented 5 years ago

Current master at fc81a55f629200a6abd5233d45751dc677e16ee0 does not compile (as discussed in https://community.amd.com/thread/234809)

  1. Get a single-use Ubuntu 16.04 machine (no GPU required; 18.04 does not work due to kernel version compatibility of rocm-dkms)
  2. Login as root
apt update && apt upgrade -y && apt autoremove -y && apt install -y htop libnuma-dev && reboot
wget -qO - http://repo.radeon.com/rocm/apt/debian/rocm.gpg.key | sudo apt-key add -
echo 'deb [arch=amd64] http://repo.radeon.com/rocm/apt/debian/ xenial main' | sudo tee /etc/apt/sources.list.d/rocm.list
apt update && apt install -y rocm-dkms
git clone https://github.com/PlasmaPower/nano-vanity.git && cd nano-vanity
./merge-kernel.py > kernel.cl

/opt/rocm/opencl/bin/x86_64/clang -include/opt/rocm/opencl/include/opencl-c.h -cl-std=CL1.2 -c -O0 kernel.cl
# good: creates kernel.o

/opt/rocm/opencl/bin/x86_64/clang -include/opt/rocm/opencl/include/opencl-c.h -cl-std=CL1.2 -c kernel.cl
# bad: does not terminate

Maybe there is some error which clang does not report. However, since CPU is at 100 % as long as the compiler runs it is more likely to be an infinite loop in the optimization process.

This may or may not be an issue in this project's code.

webmaster128 commented 5 years ago

The kernel compiles fine using the CodeXL toolchain on Windows and was now reported as a ROCm compiler issue.