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

Include DPCT headers from system installation and remove the local copy #23

Merged
merged 1 commit into from Jul 11, 2023

Conversation

rafbiels
Copy link
Collaborator

  • Remove the outdated copy of DPCT headers in src_sycl/include
  • Add cmake find module for DPCT
  • Use the DPCT headers in src_sycl/CMakeLists.txt from the cmake module

The DPCT is part of the oneAPI base toolkit so if dpcpp/icpx is available, it is almost certain dpct is also installed. The find module looks in the most common oneAPI installation paths and standard system header locations. It works out of the box in the oneAPI environment (after sourcing the setvars.sh script). It is also possible to specify the location during cmake configuration using -Ddpct_LOCATION=/my/custom/location.

@rodburns
Copy link
Contributor

@joeatodd Can you please confirm you are happy with the approach?

@rodburns rodburns requested a review from joeatodd March 16, 2023 10:19
@irudkin
Copy link

irudkin commented Mar 21, 2023

Why did the project use its own local copy of some of the SDK files?

@irudkin
Copy link

irudkin commented Mar 21, 2023

Taking the zip of this version of the project and coping it over to Slurm to build in parallel with the 'main' version, I got the following error when building the nbody_dpcpp.sh: (using module cuda/11.7.1)

[ 93%] Building CXX object src_sycl/CMakeFiles/nbody_dpcpp.dir/shader.cpp.o
clang++: warning: CUDA version is newer than the latest supported version 11.5 [-Wunknown-cuda-version]
[100%] Linking CXX executable /home/illya/Dev/CodeplayExamples/cuda-to-sycl-nbody-dpct-includes/nbody_dpcpp
clang++: warning: linked binaries do not contain expected 'nvptx64-nvidia-cuda' target; found targets: 'spir64-unknown-unknown, nvptx64-nvidia-cuda-sm_86' [-Wsycl-target]
clang++: warning: CUDA version is newer than the latest supported version 11.5 [-Wunknown-cuda-version]
error: linking module flags 'nvvm-reflect-ftz': IDs have conflicting override values in '/tmp/clang++-e3eee6/libsycl-crt-0c2141.cubin' and 'llvm-link'
clang++: error: sycl-link command failed with exit code 1 (use -v to see invocation)
make[2]: *** [src_sycl/CMakeFiles/nbody_dpcpp.dir/build.make:200: /home/illya/Dev/CodeplayExamples/cuda-to-sycl-nbody-dpct-includes/nbody_dpcpp] Error 1
make[1]: *** [CMakeFiles/Makefile2:116: src_sycl/CMakeFiles/nbody_dpcpp.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

@rafbiels
Copy link
Collaborator Author

@irudkin
Copy link

irudkin commented Mar 22, 2023

Can I suggest, it would be good to have this linking issue with nvvm-reflect-ftz mentioned in the readme.md build section (mentioning the version of oneAPI/DPCPP) for others who may run into this problem.

@irudkin
Copy link

irudkin commented Mar 22, 2023

The cmake scripts use dpcpp the compiler. Should the project be changed to use the Intel icpx compiler and so remove any "dpcpp is being depreciated" warnings?

@rafbiels
Copy link
Collaborator Author

Hi @irudkin, these are good suggestions. Let's follow up in #25 as these issues are not related to the DPCT headers which are addressed in this PR.

@DuncanMcBain DuncanMcBain merged commit be19414 into codeplaysoftware:main Jul 11, 2023
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.

None yet

4 participants