Skip to content

Conversation

@sarnex
Copy link
Contributor

@sarnex sarnex commented Feb 5, 2025

Add autodetection of the CUDA SDK using CMake's builtin find_package.

I didn't remove the LIT params or handling in lit.py as to not break anyone who may want to use a custom install.

Confirmed working here as Adapters/cuda_queue_priority.cpp passed.

Signed-off-by: Sarnie, Nick <nick.sarnie@intel.com>
@sarnex sarnex changed the title [SYCL][E2E] Improve CUDA SDK detection [SYCL][E2E] Add CUDA SDK autodetection Feb 5, 2025
@sarnex sarnex marked this pull request as ready for review February 5, 2025 21:54
@sarnex sarnex requested review from a team as code owners February 5, 2025 21:54
find_package(CUDAToolkit)

if(CUDAToolkit_FOUND)
set(CUDA_LIBS_DIR "${CUDAToolkit_LIBRARY_DIR}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what overrides what if both this and explicit params are present?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typically, explicit command line arguments override defaults.

What error do we get if CMake can't find CUDA toolkit and user hasn't set the paths via cmd options? Does it make sense to add diagnostics to CMake files or LIT infrastructure already provides good diagnostics?

Copy link
Contributor Author

@sarnex sarnex Feb 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

previously and still with this pr we get no error, we just dont enable the cuda_dev_kit feature.

the command line lit params will override the default

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this code override CMake CUDA_INCLUDE/CUDA_LIBS_DIR variables passed via command line?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah i didnt consider anyone using cmake command line, ill fix it to not do the autodetection if theyre set

@sarnex sarnex merged commit 96bb3f4 into intel:sycl Feb 6, 2025
15 checks passed
sarnex added a commit that referenced this pull request Feb 7, 2025
Follow-up from #16896

Signed-off-by: Sarnie, Nick <nick.sarnie@intel.com>
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

Successfully merging this pull request may close these issues.

3 participants