Giter Club home page Giter Club logo

Comments (4)

hjabird avatar hjabird commented on June 3, 2024 1

Those linker errors suggest you're trying to use the LAPACK interface. However, building with the cuBLAS backend doesn't enable this - that is the BLAS interface only.

I think (for I've never used it!) that you need to additionally enable the cuSOLVER backend to avoid these linking issues. You can do this by setting -DENABLE_CUSOLVER_BACKEND=ON.

from onemkl.

hjabird avatar hjabird commented on June 3, 2024

Hi vidyalathabadde! Do you want to build the unit tests? If not, set -DBUILD_FUNCTIONAL_TESTS=OFF.

Additionally, I cound that setting True and False didn't work. Try something similar to the following:

cmake ../oneMKL/ -GNinja -DCMAKE_CXX_COMPILER=icpx -DCMAKE_C_COMPILER=icx -DENABLE_CUBLAS_BACKEND=ON -DENABLE_MKLCPU_BACKEND=OFF -DENABLE_MKLGPU_BACKEND=O
FF -DBUILD_FUNCTIONAL_TESTS=OFF

(albeit with clang++ and clang, and whatever path you'd prefer.)

from onemkl.

vidyalathabadde avatar vidyalathabadde commented on June 3, 2024

Hi @hjabird,

Thank you so much for your reply. Yeah with the above command, I'm able to build the oneMKL for cuda BE.
But when I'm trying to link it with my code during compilation it gives the undefined references error.

/usr/bin/ld: /tmp/simpleCUBLAS_LU-9dfaa3.o: in function `oneapi::mkl::lapack::getrf_batch(sycl::_V1::queue&, long*, long*, double**, long*, long**, long, long*, double*, long, std::vector<sycl::_V1::event, std::allocator<sycl::_V1::event> > const&)':
simpleCUBLAS_LU-f4c50e.cpp:(.text+0x280f): undefined reference to `oneapi::mkl::lapack::detail::getrf_batch(oneapi::mkl::device, sycl::_V1::queue&, long*, long*, double**, long*, long**, long, long*, double*, long, std::vector<sycl::_V1::event, std::allocator<sycl::_V1::event> > const&)'
/usr/bin/ld: /tmp/simpleCUBLAS_LU-9dfaa3.o: in function `_ZN6oneapi3mkl6lapack27getrf_batch_scratchpad_sizeIdTnPNS1_8internal9enable_ifIXsr5is_fpIT_EE5valueEvE4typeELPv0EEElRN4sycl3_V15queueEPlSE_SE_lSE_':
simpleCUBLAS_LU-f4c50e.cpp:(.text._ZN6oneapi3mkl6lapack27getrf_batch_scratchpad_sizeIdTnPNS1_8internal9enable_ifIXsr5is_fpIT_EE5valueEvE4typeELPv0EEElRN4sycl3_V15queueEPlSE_SE_lSE_[_ZN6oneapi3mkl6lapack27getrf_batch_scratchpad_sizeIdTnPNS1_8internal9enable_ifIXsr5is_fpIT_EE5valueEvE4typeELPv0EEElRN4sycl3_V15queueEPlSE_SE_lSE_]+0x4c): undefined reference to `_ZN6oneapi3mkl6lapack6detail27getrf_batch_scratchpad_sizeIdTnPNS1_8internal9enable_ifIXsr5is_fpIT_EE5valueEvE4typeELPv0EEElNS0_6deviceERN4sycl3_V15queueEPlSG_SG_lSG_'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)

command used:

clang++ -fsycl -fsycl-targets=nvptx64-nvidia-cuda *.cpp -I../../../Common/ -I ../../../include/ -I oneMKL/build/oneMKL_installation/include/ -L oneMKL/build/oneMKL_installation/lib/ -lonemkl_blas_cublas -lonemkl

Could you please help me out with this issue?

Thanks,
Vidya.

from onemkl.

vidyalathabadde avatar vidyalathabadde commented on June 3, 2024

Thanks a lot for your assistance @hjabird. It works. I'm able to compile and run the code successfully now.

from onemkl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.