Migrating to SYCL
One-stop forum for getting assistance migrating your existing code to SYCL
46 Discussions

CUDA to SYCL Migration guide and help

Developper
Beginner
2,153 Views

Hi

I am using Intel XEON Bronze CPU 3106 integrated with NVIDIA Quadro P 1000 . 

We want to migrate CUDA code to SYCL to get performance details.

We have installed all prerequisites. please help to share some guides, resources to execute this process.

Regards

Vijay 

0 Kudos
1 Solution
NoorjahanSk_Intel
Moderator
1,880 Views

Hi,


We haven't heard back from you. Could you please provide an update on your issue?


Thanks & Regards,

Noorjahan.


View solution in original post

0 Kudos
7 Replies
NoorjahanSk_Intel
Moderator
2,119 Views

Hi,


Thanks for posting in Intel Communities.

The Intel DPC++ Compatibility Tool (DPCT) is a tool that helps convert existing CUDA code into Data Parallel C++ (DPC++), which is based on the SYCL standard for heterogeneous computing. It's part of the Intel oneAPI Base Toolkit. 


Please refer to below links for more details on usage of Intel Intel DPC++ Compatibility Tool


https://www.intel.com/content/www/us/en/developer/tools/oneapi/dpc-compatibility-tool.html#gs.1mohbe

https://www.intel.com/content/www/us/en/docs/dpcpp-compatibility-tool/developer-guide-reference/2024-0/migrate-a-project.html

https://www.intel.com/content/www/us/en/docs/dpcpp-compatibility-tool/get-started-guide/2024-0/overview.html

https://www.intel.com/content/www/us/en/developer/articles/technical/intel-dpcpp-compatibility-tool-best-practices.html


While DPCT automates much of the conversion process, it may still require some manual adjustments. The tool generates warnings with specific IDs (e.g., "DPCT10XX") to highlight areas where manual intervention is needed.


Please refer to below link for more details.

https://www.intel.com/content/www/us/en/docs/dpcpp-compatibility-tool/developer-guide-reference/2024-0/diagnostics-reference.html


Hope this helps to understand the migration process from CUDA to SYCL.


Thanks & Regards,

Noorjahan.


0 Kudos
Developper
Beginner
2,038 Views

Hi 

Thank for sharing this information. 

We checked the working of the programs on GPU systems, only the CPU code execution is happening, but throwing an error related to its working on GPU. We tried a lot by resolving the errors, but the code is not working. Please find the screenshot of errors. Please help to resolve this. 

Developper_0-1701951784569.png

 

0 Kudos
NoorjahanSk_Intel
Moderator
1,976 Views

Hi,

 

Based on the information in the screenshot you shared, it appears that you are attempting to run a dpc++ program on an NVIDIA GPU.

 

To target the NVIDIA GPU explicitly, you need to instruct the compiler to generate code for the specified device targets using the -fsycl-target flag.

Please refer to below link for more details on -fsycl-target on Intel devices.

https://www.intel.com/content/www/us/en/docs/dpcpp-cpp-compiler/developer-guide-reference/2024-0/fsycl-targets.html

 

We have tested this on our end with the NVIDIA plugin and did not encounter any issues

Steps we have followed:

 

>>icpx -fsycl -fsycl-targets=nvptx64-nvidia-cuda vector-add-buffers.cpp
>>/a.out
Running on device: Tesla P100-PCIE-12GB
Vector size: 10000
[0]: 0 + 0 = 0
[1]: 1 + 1 = 2
[2]: 2 + 2 = 4
...
[9999]: 9999 + 9999 = 19998
Vector add successfully completed on device.

 

 

We used icpx compiler with -fsycl flag, as dpcpp is deprecated and will be removed in future releases of oneAPI.

Please try above command to target NVIDIA gpu, if you still face any issues please provide us with sample reproducer and a complete error log.

 

Thanks & Regards,

Noorjahan.

 

0 Kudos
NoorjahanSk_Intel
Moderator
1,881 Views

Hi,


We haven't heard back from you. Could you please provide an update on your issue?


Thanks & Regards,

Noorjahan.


0 Kudos
Developper
Beginner
1,875 Views

Thank you. We will update for any queries. 

0 Kudos
NoorjahanSk_Intel
Moderator
1,858 Views

Hi,


Could you please let us know whether your issue got resolved? If yes, please confirm whether we can close this thread from our end


Thanks & Regards,

Noorjahan.


0 Kudos
NoorjahanSk_Intel
Moderator
1,783 Views

Hi,


We are closing this thread assuming your issue has been resolved. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.


Thanks & Regards,

Noorjahan.


0 Kudos
Reply