UniHD-CEG/cuda-flux

How load llvm module?

m-hafez opened this issue · 2 comments

Hello
I just want to know how load llvm module ?

Loading /opt/cuda-flux/module/cuda_flux
  ERROR: /opt/cuda-flux/module/cuda_flux cannot be loaded due to missing prereq.
    HINT: the following module must be loaded first: llvm/11.0

llvm and cuda-flux were built without any error in the same way was described in Readme.md and all environment variables exported.
My ubuntu bashrc file:

export CC=/home/mhy/DEVELOP/llvm-project/build/bin/clang
export CXX=/home/mhy/DEVELOP/llvm-project/build/bin/clang++
export C_INCLUDE_PATH=/usr/local/cuda/include:/home/mhy/DEVELOP/llvm-project/build/include
export CPLUS_INCLUDE_PATH=/usr/local/cuda/include:/home/mhy/DEVELOP/llvm-project/build/include
export CUDA_PATH=/usr/local/cuda
export LIBRARY_PATH=/usr/local/cuda/lib64:/home/mhy/DEVELOP/llvm-project/build/lib
export LLVM_DIR=/home/mhy/DEVELOP/llvm-project/build/lib/cmake/llvm 
             
export PATH=/usr/local/cuda/bin:/home/mhy/DEVELOP/llvm-project/build/bin:/opt/cuda-flux/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:/home/mhy/DEVELOP/llvm-project/build/lib

If i compiling cuda program without loading modules,
mhy@ubuntu:~/DEVELOP/cuda-flux/test$ clang_cf++ --cuda-gpu-arch=sm_35 -std=c++11 -lcudart saxpy.cu -o saxpy
Then get this error:

+ clang++ -Xclang -load -Xclang /opt/cuda-flux/lib/libcuda_flux_pass.so -finline-functions --cuda-gpu-arch=sm_35 -std=c++11 -lcudart saxpy.cu -o saxpy
error: unable to load plugin '/opt/cuda-flux/lib/libcuda_flux_pass.so': '/opt/cuda-flux/lib/libcuda_flux_pass.so: undefined symbol: _ZN4llvm24DisableABIBreakingChecksE'

llvm-config --version output: 11.1.0

Hi Mohammad,

if you have no environment module for llvm you can edit the module file of cuda flux to remove the dependency to a llvm module. It will still work if your environment is setup correctly. Did you install llvm in in your build directory? Its not in the readme but you should install llvm somewhere. (e.g. /opt/llvm-11.1 or ~/opt/llvm-11.1). I am also not entirely sure if this is a Ubuntu or a problem that comes with llvm 11.1 (i am still using 11.0). So it could be worth a try to use a slightly older llvm version.

Best Regards
Lorenz

Yes i used instructions in readme for build llvm but i not installed it with cmake --build . --target install ,for this reason it not installed in /opt/llvm-11.1. also i cloned llvm source using git clone --branch release/11.x https://github.com/llvm/llvm-project.git, this command cloned llvm-11.1 .
however i downloaded llvm-11.0 source and built it and also installed it in /opt/llvm-11.0 and commented out dependency to llvm and cuda in module file of cuda-flux.
now cuda-flux working perfectly.
Thank you so much.