Intel® oneAPI DPC++/C++ Compiler
Talk to fellow users of Intel® oneAPI DPC++/C++ Compiler and companion tools like Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and Intel® Distribution for GDB*
601 Discussions

intel OneAPI No device of requested type available

pokechan
Beginner
2,182 Views

Hello i am making a game engine and implementing the gpu, on my device i have windows 11 and an intel iris XE graphics. however when i execute my code (link below) i get this error:

No device of requested type available. Please check https://software.intel.com/content/www/us/en/develop/articles/intel-oneapi-dpcpp-system-requirements.html -1 (PI_ERROR_DEVICE_NOT_FOUND)

i found nothing on the internet that could help me fix this error. i appreciate your help!

like to the code: (intel.cpp) intel.cpp - Pastebin.com

(intel.h) intel.h - Pastebin.com

the other code is on this github : Pokecraft-exe/Leviathor-Game-Engine (github.com)

0 Kudos
11 Replies
SeshaP_Intel
Moderator
2,102 Views

Hi,

 

Thank you for posting in Intel Communities.

 

We encountered some errors while running the below command:

icx /fsycl intel.cpp /EHsc /I "./Leviathor-Game-Engine-master" /I "./SDL-release-2.28.4/include"

 

Please find the below screenshot.

SeshaP_Intel_0-1698875619397.png

 

Could you please share the exact command you used and the steps you followed?

Additionally, could you please share the output screenshot by running the following command on your Intel oneAPI command prompt?

sycl-ls

 

Thanks and Regards,

Pendyala Sesha Srinivas

 

pokechan
Beginner
2,052 Views
Hello Sesha, I recently updated the code on github. It should be easier to read it now. The entry point is main() in game.cpp
And to compile Intel.cpp you must check the partially linked option thank you for your answer, Pokechan.
0 Kudos
pokechan
Beginner
2,079 Views

Hello Sesha, i compile using two Visual Studio 2022 project, one with DPCPP to compile intel.cpp to an object file and the other project to compile wih gcc the other files where i link intel.obj

i fixed the error (that i don't get in my devices):

replace by

void R(uint8_t n) { data[0] = n; };
void G(uint8_t n) { data[1] = n; };
void B(uint8_t n) { data[2] = n; };
void A(uint8_t n) { data[3] = n; };

 and when i execute sycl-ls i get

pokechan_0-1698921041957.png

thank you for your answer

all regards, Pokechan

0 Kudos
SeshaP_Intel
Moderator
1,954 Views

Hi,

 

>>> i fixed the error (that i don't get in my devices):

Glad to know that the issue was resolved. 

 

Could you please confirm whether we can close this thread from our end? If not, please provide us with the Visual Studio project solutions with us and the error you are facing.

 

Thanks and Regards,

Pendyala Sesha Srinivas

 

0 Kudos
pokechan
Beginner
1,928 Views

Hi,

I am sorry for the misunderstanding, i was indeed talking about the issue in the screenshot you provided, not my issue.

Thank you for your reply.

Thanks and Regards, pokechan

0 Kudos
SeshaP_Intel
Moderator
1,882 Views

Hi,

 

We are still receiving the same error after running the below commands in the Intel oneAPI command prompt. 

icx /fsycl /EHsc /c intel.cpp /I "./Leviathor-Game-Engine-master/Headers" /I "./Leviathor-Game-Engine-master/lib/include" /I "./SDL-SDL2/include" /I "./SDL_image-SDL2/include"

icx /fsycl /c "./Leviathor-Game-Engine-master/Source/game.cpp" /I "./Leviathor-Game-Engine-master/Headers" /I "./Leviathor-Game-Engine-master/lib/include" /I "./SDL-SDL2/include" /I "./SDL_image-SDL2/include"

icx /fsycl intel.obj game.obj

 

Please find the below screenshot.

SeshaP_Intel_0-1700053494214.png

 

Could you please share your Visual Studio project solutions with us so that we can investigate the issue from our end?

 

Thanks and Regards,

Pendyala Sesha Srinivas

0 Kudos
pokechan
Beginner
1,858 Views

You will find the below folder with the solution, put it with the github code.

Thank you for you reply, i hopy we will get through this issue soon.

Regards, Pokechan

0 Kudos
SeshaP_Intel
Moderator
1,786 Views

Hi,

 

Thanks for sharing the Visual Studio project solutions with us. We were able to build the .obj and .lib files, but we are still encountering the same error during the linking phase in the 'game' solution. Please find the screenshot below.

SeshaP_Intel_0-1700739651851.png

 

Could you please let us know if you have followed any additional steps?

Regarding the error you are facing, could you please try executing the below sample program (code.cpp) on your end and let us know the results?

 

#include <CL/sycl.hpp>
#include <vector>
#include <iostream>

using namespace cl::sycl;
using namespace std;

int main()
{
    int N = 10, R = 5;
    vector<int> v(N, 10);

    queue gpuQ(gpu_selector_v);

    buffer<int, 1> bufgpu(v.data(), R);
    buffer<int, 1> bufcpu(v.data() + 5, R);

    cout << "\nSelected GPU Device Name: " << gpuQ.get_device().get_info<info::device::name>() << "\n";

    gpuQ.submit([&](handler& h) {
        accessor agpu(bufgpu, h);
        h.parallel_for(R, [=](auto i) {
            agpu[i] += 2;
            });
        });

    host_accessor gpu(bufgpu, read_only);
    for (int i = 0; i < 5	; i++)
    {
        cout << "gpu[" << i << "] = " << gpu[i] << "\t";
    }

    cout << "\n";
    queue cpuQ(cpu_selector_v);
    cout << "\nSelected CPU Device Name: " << cpuQ.get_device().get_info<info::device::name>() << "\n";

    cpuQ.submit([&](handler& h) {
        accessor acpu(bufcpu, h);
        h.parallel_for(R, [=](auto i) {
            acpu[i] -= 2;
            });
        });


    host_accessor cpu(bufcpu, read_only);
    
    for (int i = 0; i < 5; i++)
    {
        cout << "cpu[" << i << "] = " << cpu[i] << "\t";
    }

    return 0;
}

 


Please share the output screenshot with us. You can run the following command in the Intel oneAPI command prompt. 

 

icx /fsycl code.cpp
code.exe

 

 

If you are encountering the same error, please try running the executable after setting the ONEAPI_DEVICE_SELECTOR environmental variable to either the opencl or level_zero backend with one of the commands below:

 

set ONEAPI_DEVICE_SELECTOR=opencl:*
set ONEAPI_DEVICE_SELECTOR=level_zero:*

 

 

You can refer to this link for more information.

If the issue still persists, please consider reinstalling the Intel oneAPI Base toolkit and let us know the results.

 

Thanks and Regards,

Pendyala Sesha Srinivas

0 Kudos
SeshaP_Intel
Moderator
1,683 Views

Hi,


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


Thanks and Regards,

Pendyala Sesha Srinivas


0 Kudos
SeshaP_Intel
Moderator
1,606 Views

Hi,


We have not heard back from you. This thread will no longer be monitored by Intel. If you need further assistance, please post a new question.


Thanks and Regards,

Pendyala Sesha Srinivas


0 Kudos
pokechan
Beginner
1,417 Views

Hello Shesha, i followed your instructions and now my code build and execute.
i still have some other problems.

i need to run only one function on the GPU and all the other program needs to be on the CPU.

but it seems like i cannot do that with DPCPP, could you tell me if i am wrong and send me some documentations?

thank you again,

regards, poke.

0 Kudos
Reply