[Openmp-dev] GPU offloading with clang

Talita Perciano via Openmp-dev openmp-dev at lists.llvm.org
Tue Jul 2 13:38:27 PDT 2019


Hi Doru,

Thanks for your reply. I think I figured out the problem. But now I'm
having another issue:

nvlink fatal   : Could not open input file
'/usr/common/software/opencv/3.1.0/gnu/lib/libopencv_imgcodecs.so.3.1.cubin'
clang-9: error: nvlink command failed with exit code 1 (use -v to see
invocation)
CMakeFiles/MPI_PMRF.dir/build.make:257: recipe for target 'MPI_PMRF' failed

Talita


On Tue, Jul 2, 2019 at 11:35 AM Gheorghe-Teod Bercea <
Gheorghe-Teod.Bercea at ibm.com> wrote:

> Hi Talita,
>
> You may be linking against the wrong OpenMP library.
>
> Have you built the OpenMP runtime library? If you have you then also need
> to set up your environment to pick it up instead of some other default
> option. To be sure you use the library you intend you can use the -I and -L
> compiler flags to pass the location of the omp.h header file and the
> libomp.so runtime library you intend to use.
>
> Thanks,
>
> --Doru
>
>
>
>
>
> From:        Talita Perciano via Openmp-dev <openmp-dev at lists.llvm.org>
> To:        openmp-dev at lists.llvm.org
> Date:        07/02/2019 02:25 PM
> Subject:        [EXTERNAL] [Openmp-dev] GPU offloading with clang
> Sent by:        "Openmp-dev" <openmp-dev-bounces at lists.llvm.org>
> ------------------------------
>
>
>
> Hi,
>
> I'm trying to use openmp offloading to gpu, and I'm getting linking errors
> during compilation:
>
> [  7%] Linking CXX executable MPI_PMRF
> /usr/bin/ld:
> CMakeFiles/MPI_PMRF.dir-------/cfuncs-pmrf.c.o:(.rodata..omp_offloading.device_images[.omp_offloading.descriptor_reg.nvptx64-nvidia-cuda]+0x10):
> undefined reference to `.omp_offloading.entries_begin'
> /usr/bin/ld:
> CMakeFiles/MPI_PMRF.dir-------/cfuncs-pmrf.c.o:(.rodata..omp_offloading.device_images[.omp_offloading.descriptor_reg.nvptx64-nvidia-cuda]+0x18):
> undefined reference to `.omp_offloading.entries_end'
> /usr/bin/ld:
> CMakeFiles/MPI_PMRF.dir/-------/cfuncs-pmrf.c.o:(.rodata..omp_offloading.descriptor[.omp_offloading.descriptor_reg.nvptx64-nvidia-cuda]+0x10):
> undefined reference to `.omp_offloading.entries_begin'
> /usr/bin/ld:
> CMakeFiles/MPI_PMRF.dir/-------/cfuncs-pmrf.c.o:(.rodata..omp_offloading.descriptor[.omp_offloading.descriptor_reg.nvptx64-nvidia-cuda]+0x18):
> undefined reference to `.omp_offloading.entries_end'
> /usr/bin/ld: link errors found, deleting executable `MPI_PMRF'
> clang-9: error: linker command failed with exit code 1 (use -v to see
> invocation)
> CMakeFiles/MPI_PMRF.dir/build.make:265: recipe for target 'MPI_PMRF' failed
> make[2]: *** [MPI_PMRF] Error 1
> CMakeFiles/Makefile2:72: recipe for target 'CMakeFiles/MPI_PMRF.dir/all'
> failed
> make[1]: *** [CMakeFiles/MPI_PMRF.dir/all] Error 2
> Makefile:83:recipe for target 'all' failed
> make: *** [all] Error 2
>
> I actually can compile the code just fine without the #pragma omp target.
>
> Some additional info:
>
> - I'm compiling the code with *-fopenmp
> -fopenmp-targets=nvptx64-nvidia-cuda*
>
> - *clang version 9.0.0* (*https://github.com/clang-ykt/clang*
> <https://github.com/clang-ykt/clang>e50a43ae7e2fe6e6ff515cedb2a8ae658120e32f)
> (*https://github.com/clang-ykt/llvm* <https://github.com/clang-ykt/llvm>
> 3cd66813b063ab08a389470f1bc53e18fbe595b2)
>
> - *cuda info:*
>
>
> +-----------------------------------------------------------------------------+
> | NVIDIA-SMI 418.67       Driver Version: 418.67       CUDA Version: 10.1
>     |
>
> |-------------------------------+----------------------+----------------------+
> | GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr.
> ECC |
> | Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute
> M. |
>
> |===============================+======================+======================|
> |   0  Tesla V100-SXM2...  On   | 00000000:3E:00.0 Off |
>  0 |
> | N/A   30C    P0    38W / 300W |      0MiB / 16130MiB |      0%
>  Default |
>
> +-------------------------------+----------------------+----------------------+
>
> - Linux kernel: *4.4.176-96-default*
>
> Any thoughts?
>
> Thanks!
> Talita
> _______________________________________________
> Openmp-dev mailing list
> Openmp-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev
>
>
>
>

-- 
Dr. Talita Perciano
Research Scientist - CRD, Lawrence Berkeley National Laboratory
Data Analytics & Visualization Group
Computational Biosciences Group
Center for Advanced Mathematics for Energy Research Applications
One Cyclotron Road
Berkeley, CA 94720
059-3034B  M/S 59R3103
Work: (510) 486-5060
tperciano at lbl.gov
http://tperciano.wixsite.com/home
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20190702/8d96ac9d/attachment.html>


More information about the Openmp-dev mailing list