Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Employee
391 Views

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

Jump to solution

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

Accepted Solutions
Highlighted
Beginner
283 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...

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-f...

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
Highlighted
Moderator
362 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
Highlighted
Employee
354 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
Highlighted
Moderator
306 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
Highlighted
Beginner
284 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...

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-f...

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