Intel® oneAPI Data Parallel C++
Support for Intel® oneAPI DPC++ Compiler, Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and GDB*
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.

Why can't run code on GPGPU?

nnain1
New Contributor I
693 Views

I am testing the code on different devices. I tested on CPU, IntelGPU, GPGPU.

Can't run the code on GPGPU. May I know what is the problem?

My test code is as follows.
 

int main() {
  std::array<int, SIZE> myArray;
  for (int i = 0; i<SIZE; ++i)
    myArray = i;

  printf("Value at start:  myArray[42] is %d.\n",myArray[42]);
  {
    cl::sycl::queue myQ( gpu_selector{} ); /* use defaults today; parameters possible - future topic */
    std::cout << "Selected device: " << myQ.get_device().get_info<info::device::name>() << "\n";
    std::cout << "-> Device vendor: " << myQ.get_device().get_info<info::device::vendor>() << "\n";
    cl::sycl::range<1> mySize{SIZE};

    cl::sycl::buffer<int, 1> bufferA(myArray.data(), mySize);

    myQ.submit([&](cl::sycl::handler &myHandle) {
      auto deviceAccessorA =
        bufferA.get_access<cl::sycl::access::mode::read_write>(myHandle);
      myHandle.parallel_for<class uniqueID>(mySize,[=](cl::sycl::id<1> index) {
	  deviceAccessorA[index] *= 2;
      });
    });
  }
  printf("Value at finish: myArray[42] is %d.\n",myArray[42]);
}

The running outputs are as follows for different devices.

Value at start:  myArray[42] is 42.
Selected device: Quadro P4000
-> Device vendor: NVIDIA Corporation
Value at finish: myArray[42] is 42.
coie@coie-HP-Z440-Workstation:~/Data/coie/Softwares/oneAPI/dpc++/module01$ make all
dpcpp -O3 -std=c++14 -g -fsycl-unnamed-lambda    doubler.cpp   -o doubler
coie@coie-HP-Z440-Workstation:~/Data/coie/Softwares/oneAPI/dpc++/module01$ ./doubler
Value at start:  myArray[42] is 42.
Selected device: Intel(R) Xeon(R) CPU E5-1620 v4 @ 3.50GHz
-> Device vendor: Intel(R) Corporation
Value at finish: myArray[42] is 84.
coie@coie-HP-Z440-Workstation:~/Data/coie/Softwares/oneAPI/dpc++/module01$ make all
dpcpp -O3 -std=c++14 -g -fsycl-unnamed-lambda    doubler.cpp   -o doubler
coie@coie-HP-Z440-Workstation:~/Data/coie/Softwares/oneAPI/dpc++/module01$ ./doubler
Value at start:  myArray[42] is 42.
Selected device: Intel(R) FPGA Emulation Device
-> Device vendor: Intel(R) Corporation
Value at finish: myArray[42] is 84.

 

0 Kudos
1 Solution
Gergana_S_Intel
Employee
693 Views

CodePlay has announced they're working on an open source module that allows you to run oneAPI/Data Parallel C++ codes on NVIDIA GPUs. From the announcement:

Software developers will be able to use this implementation with Intel's® oneAPI framework to target Nvidia GPUs using any SYCL code, without any porting or special tricks required.

Here is the full news brief. Targeting early 2020, it seems like. If interested, I recommend you subscribe to their news announcements. I'll also try to post here once I have more details.

~Gergana

View solution in original post

7 Replies
Dmitry_Savin
New Contributor I
693 Views

As you can see in the neighbor topic (842261), Nvidia GPUs are not supported yet.

nnain1
New Contributor I
693 Views

Thank you

AbhishekD_Intel
Moderator
693 Views

Hi,

You are trying to run the code on NVIDIA GPU which is not supported at this stage, so after running the queue it's giving the result produced on the host. DPC++ code generates SPIRV IR which is not compatible with Nvidia GPUs. On the other hand for NVIDIA GPU we need PTX as an intermediate file.

Let us know if this resolves your Issue.

-Abhishek

Connor__Dominic
Beginner
693 Views

Currently OneAPi does not support nVidia GPU, does anyone know when it might appear ?

Gergana_S_Intel
Employee
694 Views

CodePlay has announced they're working on an open source module that allows you to run oneAPI/Data Parallel C++ codes on NVIDIA GPUs. From the announcement:

Software developers will be able to use this implementation with Intel's® oneAPI framework to target Nvidia GPUs using any SYCL code, without any porting or special tricks required.

Here is the full news brief. Targeting early 2020, it seems like. If interested, I recommend you subscribe to their news announcements. I'll also try to post here once I have more details.

~Gergana

nnain1
New Contributor I
693 Views

Thank you. Good suggestion.

Dmitry_Savin
New Contributor I
693 Views
Hi Nyan, If you are still interested, Codeplay has released the forementioned module. Read further https://www.codeplay.com/portal/02-03-20-codeplay-contribution-to-dpcpp-brings-sycl-support-for-nvid... Dima
Reply