Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CUDA only support #275

Open
byronfa opened this issue Aug 15, 2019 · 4 comments
Open

CUDA only support #275

byronfa opened this issue Aug 15, 2019 · 4 comments

Comments

@byronfa
Copy link

byronfa commented Aug 15, 2019

I was tinkering with VexCL on an NVidia jetson nano, which only supports cuda. It appears if CL isn't available at all, the project files have issues? (Even if I install OpenCL headers, the lack of a library still causes a failure). Any hints?

-- Looking for CL/cl_platform.h
-- Looking for CL/cl_platform.h - not found
CMake Warning at CMakeLists.txt:180 (message):
The JIT interface requires OpenCL headers to be available.You can download
them from https://github.com/KhronosGroup/OpenCL-HeadersSet
OpenCL_INCLUDE_DIR to the location of the headers.For now, disabling the
JIT target.

CMake Error at CMakeLists.txt:244 (add_library):
add_library cannot create ALIAS target "VexCL::Backend" because target
"OpenCL" does not already exist.

@ddemidov
Copy link
Owner

Can you try to configure the project with cmake .. -DVEXCL_BACKEND=CUDA? The default value is 'OpenCL', set here:

set(VEXCL_BACKEND "OpenCL" CACHE STRING "Select VexCL backend (OpenCL/CUDA/Compute/JIT/All)")

I agree the choice of the default should be more intelligent and check if the backend is available first.

@ddemidov
Copy link
Owner

588fab6 should help.

@byronfa
Copy link
Author

byronfa commented Aug 27, 2019

That got me past the install issues.. I was poking around the examples recently and I get the following:
/usr/bin/ld: cannot find -lVexCL::Backend

What exactly is VexCL::Backend trying to pick up?

Thanks!

@ddemidov
Copy link
Owner

VexCL::Backend is a cmake alias for one of VexCL::OpenCL, VexCL::CUDA, VexCL::Compute, or VexCL::JIT:

vexcl/CMakeLists.txt

Lines 250 to 258 in 4a99b23

if("${VEXCL_BACKEND}" STREQUAL "OpenCL")
add_library(VexCL::Backend ALIAS OpenCL)
elseif("${VEXCL_BACKEND}" STREQUAL "Compute")
add_library(VexCL::Backend ALIAS Compute)
elseif("${VEXCL_BACKEND}" STREQUAL "CUDA")
add_library(VexCL::Backend ALIAS CUDA)
elseif("${VEXCL_BACKEND}" STREQUAL "JIT")
add_library(VexCL::Backend ALIAS JIT)
endif()

Each of these is an interface cmake target that brings all appropriate includes and libraries. The error you get means that the linker actually tries to link against VexCL::Backend, which most probably means that you did something wrong while poking around. Does git diff show any modified CMakeLists.txt files? If not, I would recommend removing the build directory (or create another one), and reconfigure the examples from scratch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants