[Openmp-dev] nvlink reported undefined reference

Jon Chesterfield via Openmp-dev openmp-dev at lists.llvm.org
Tue Nov 5 06:13:02 PST 2019


Hey,

Clean build here. CMake dependency tracking is unreliable.

Ad hoc testing based on the email thread. I don't have a working cuda/nvptx
baseline so in tree tests don't tell me much. I hacked my host clang
install until it could handle the cuda in deviceRTL and left it at that.

I've just sent a message to the list asking for "known working" toolchain
combinations in the hope of moving to a better testing baseline. Or I
guess, currently, a known-working-before-support.cu.

Regards,

Jon



On Tue, 5 Nov 2019, 13:15 Alexey Bataev, <a.bataev at hotmail.com> wrote:

> Jon, try to manually remove old .bc files generated for NVPTX runtime
> library. You may use the old ones, sometimes they are not rebuilt
> automatically. Also, what tests are you trying to investigate? For me, the
> tests from check-libomptarget-nvptx are failed.
>
> Best regards,
> Alexey Bataev
>
> 5 нояб. 2019 г., в 08:06, Jon Chesterfield via Openmp-dev <
> openmp-dev at lists.llvm.org> написал(а):
>
> 
> Message: 2
> Date: Tue, 5 Nov 2019 02:54:05 +0000
> From: "Doerfert, Johannes via Openmp-dev" <openmp-dev at lists.llvm.org>
> To: Shilei Tian <tianshilei1992 at gmail.com>
> Subject: Re: [Openmp-dev] nvlink reported undefined reference when
>         building OpenMP offloading program
>
>
> I think Jon (CCed) is aware and working on it:
>
> https://reviews.llvm.org/rG764c8420e4b8fc1libomptarget1a9fa94d00f4ee617aa754cb2
> <https://reviews.llvm.org/rG764c8420e4b8fc11a9fa94d00f4ee617aa754cb2>
>
> On 11/04, Shilei Tian via Openmp-dev wrote:
> > Hi,
> >
> > I was trying to build an OpenMP offloading program. nvlink always
> reported following error:
> >
> > nvlink error   : Undefined reference to '_Z25GetLogicalThreadIdInBlockb'
> in '/tmp/main-02fcf5.cubin'
>
> Hi Shilei,
>
> Thanks for the comprehensive report. I am indeed looking into this.
>
> That you're building for X86 means the problem isn't isolated to POWER8,
> which means I can stop looking at cross compilation. I'll update the
> discussion. Thanks!
>
> OpenMP still works for me. My nvptx build is a bit precarious though
> because trunk conflicts with libstdc++, so the corresponding invocation is:
>
> ~/llvm-install/bin/clang --cuda-gpu-arch=sm_50 -fopenmp
> -fopenmp-targets=nvptx64 test.cu  -nocudainc -L~/llvm-install/lib
> LD_LIBRARY_PATH=~/llvm-build/lib ./a.out
>
> Looking at symbols in the cuda runtime libraries suggests all is well, at
> least on my machine.
>
> I believe replacing INLINE with DEVICE in
> openmp/libomptarget/deviceRTL/nvptx/src/support.cu will unblock people. I
> don't want to propose that as a patch until I can reproduce locally.
>
> Alternatively, using clang instead of nvcc would probably resolve this.
> -DCUDA_HOST_COMPILER=`which clang`
>
> Regards,
>
> Jon
> _______________________________________________
> Openmp-dev mailing list
> Openmp-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20191105/c8034e2a/attachment-0001.html>


More information about the Openmp-dev mailing list