Intel® oneAPI Data Parallel C++
Support for Intel® oneAPI DPC++ Compiler, Intel® oneAPI DPC++ Library, Intel ICX Compiler , Intel® DPC++ Compatibility Tool, and GDB*
584 Discussions

Running DPC++ on NVIDIA GPU via OpenCL instead of CUDA

sirgienko
Employee
4,274 Views

Well, as I know, technically it should be possible, because you can run OpenCL on GPU and SYCL based on OpenCL. But the problem is, that look likes DPC++ always try to use CUDA, then see NVIDIA GPU (I have sucessufly reproduce the problem on two machines with different NVIDIA GPUs: GTX 650 and GTX 1080).
For example, there is this test project (see attachments). The code uses gpu_selector and system (linux) have
Then I have run the builded executable

./main


I have this message

pi_die: CUDA support was not enabled at compilation time
terminate called without an active exception
Aborted (core dumped)


Is I know, is situation like that, when there two possible way to use device (opencl or cuda, for example) can be used SYCL_BE environment variable.
But even I have run executable like this

SYCL_BE=PI_OPENCL ./main


I still have the message about missing CUDA support

pi_die: CUDA support was not enabled at compilation time
terminate called without an active exception
Aborted (core dumped)

Am I doing something wrong?

Additional info
OS: Ubuntu 18.04.4 LTS
DPCPP compiler version: Intel(R) oneAPI DPC++ Compiler 2021.1-beta07 (2020.5.0.0604)
CPU: Intel, but without integrated GPU

Labels (1)
0 Kudos
1 Solution
rodcpl
Beginner
4,161 Views

The error you are seeing in the original post is because the DPC++ compiler is not built with the Nvidia GPU support by default. You currently need to build this yourself. The instructions are here:

https://github.com/intel/llvm/blob/sycl/sycl/doc/GetStartedGuide.md#build-dpc-toolchain-with-support-for-nvidia-cuda

The response from Abhishek is not totally accurate either, the Nvidia support is now available in the main Intel LLVM branch.

You might also be interested in this blog post about the work (I work at Codeplay)

https://www.codeplay.com/portal/news/2020/02/03/codeplay-contribution-to-dpcpp-brings-sycl-support-for-nvidia-gpus.html

This doesn't use OpenCL to run your SYCL code on the GPU but instead uses PTX instructions via native CUDA calls.

You can't use the OpenCL implementation for Nvidia with SYCL because it does not support SPIR/SPIR-V intermediate instructions.

I hope that helps.

View solution in original post

0 Kudos
4 Replies
AbhishekD_Intel
Moderator
4,240 Views

Hi,

 

We appreciate your findings. But currently, Intel OneAPI does not support NVIDIA GPUs.

However, you can try the DPC++ branch of the LLVM compiler project which is CodePlay's contribution to DPC++ which has support for NVIDIA GPUs. This will enable you to target NVIDIA GPUs using the SYCL code.

 

 

Warm Regards,

Abhishek

 

 

0 Kudos
sirgienko
Employee
4,232 Views

Hi, Abhishek

Well, you have add link in your message on "Build DPC++ toolchain with support for NVIDIA CUDA", but, if I am not mistaken, the topic is about running SYCL via CUDA on NVIDIA GPU. My question about how I can use OpenCL, which supported on NVIDIA GPU too and actually totally workable and even don't use CUDA runtime.

Best regards,

Nikita

0 Kudos
rodcpl
Beginner
4,162 Views

The error you are seeing in the original post is because the DPC++ compiler is not built with the Nvidia GPU support by default. You currently need to build this yourself. The instructions are here:

https://github.com/intel/llvm/blob/sycl/sycl/doc/GetStartedGuide.md#build-dpc-toolchain-with-support-for-nvidia-cuda

The response from Abhishek is not totally accurate either, the Nvidia support is now available in the main Intel LLVM branch.

You might also be interested in this blog post about the work (I work at Codeplay)

https://www.codeplay.com/portal/news/2020/02/03/codeplay-contribution-to-dpcpp-brings-sycl-support-for-nvidia-gpus.html

This doesn't use OpenCL to run your SYCL code on the GPU but instead uses PTX instructions via native CUDA calls.

You can't use the OpenCL implementation for Nvidia with SYCL because it does not support SPIR/SPIR-V intermediate instructions.

I hope that helps.

0 Kudos
AbhishekD_Intel
Moderator
4,184 Views

Hi,

Pardon us for the delay, we are referring your problem to the concerned team. They will get back to you.



Warm Regards,

Abhishek


0 Kudos
Reply