Intel® oneAPI Base Toolkit
Support for core tools and libraries to build and deploy high-performance data-centric applications
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
245 Discussions

DPC++ sample, LLVM ERROR: SPIRV internal error.

Junghoon
Employee
620 Views

Hi,

I'm trying to use oneAPI in an application and am testing out some features. While doing so, I encountered some errors that may be related to configuration. The following is my code.

#include <iostream>
#include <CL/sycl.hpp>
using namespace sycl;
static const int N = 16;

int main() {
    gpu_selector selector;
    queue q(selector);
    std::cout << "Device : " << q.get_device().get_info<info::device::name>()
                << std::endl;

    int *data = malloc_shared<int>(Nq);

    for (int i = 0i < Ni++) data[i] = i;

    q.parallel_for(range<1>(N), [=](auto i) { data[i] *= 2; }).wait();

    for (int i = 0i < Ni++) std::cout << data[i<< std::endl;
    free(dataq);
    return 0;
}
 
The code is a fairly simple one using USM. The following is it's output after 'dpcpp sample.cpp'
Device : Intel(R) Gen9 HD Graphics NEO
LLVM ERROR: SPIRV internal error.
 
In a seperate post, I found that this may be a gpu driver issue. Indeed, the code works fine with a cpu_selector. However, I do need to use the GPU.
 
However, I'm working on a linux environment, Ubuntu 18.04. I did install intel-opencl as instructed here , but I was unable to install intel-level-zero-gpu and level-zero with the following errors:
 
sudo apt-get install intel-level-zero-gpu level-zero
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package intel-level-zero-gpu
E: Unable to locate package level-zero
 
Is it likely that this is a gpu driver problem? I have posted my intel-opencl package and device info below for reference. I did check the requirements listed here:
lspci -k | grep -EA3 'VGA|3D|Display'
00:02.0 VGA compatible controller: Intel Corporation Device 3e92
Subsystem: ASRock Incorporation Device 3e92
Kernel driver in use: i915
Kernel modules: i915
 
dpkg -s intel-opencl
Package: intel-opencl
Status: install ok installed
Priority: optional
Section: devel
Installed-Size: 4662
Maintainer: Intel Corporation
Architecture: amd64
Version: 19.41.14441
Depends: intel-gmmlib (= 19.3.2), intel-igc-opencl (= 1.0.2597), libc6 (>= 2.17), libgcc1 (>= 1:3.4), libstdc++6 (>= 6)
Description: Intel OpenCL GPU driver
 
CPU: Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz (x86_64)
0 Kudos
7 Replies
AbhishekD_Intel
Moderator
594 Views

Hi,


Thanks for reaching out to us.

It seems to be a GPU driver issue that you are having.

Try apt update and then try installing level zero drivers. If didn't work then also try clearing the apt-cache by apt-get clean and apt-get autoclean before installing level zero drivers.


You may also use GPU with OpenCL runtime if you have already installed the latest opencl drivers, export SYCL_BE=PI_OPENCL before executing your executable.


Hope this will help you to resolve your issue.


Warm Regards,

Abhishek


Junghoon
Employee
582 Views

Hi Abhishek,

Thank you for your reply. I have tried everything you've mentioned and successfully installed the drivers. Now it generates a different.

When I ran the code with a gpu_selector, the program could no longer detect the GPU. It outputs the following error: 

terminate called after throwing an instance of 'cl::sycl::runtime_error'
what(): No device of requested type available. Please check https://software.intel.com/en-us/articles/intel-oneapi-dpcpp-compiler-system-requirements-beta -1 (CL_DEVICE_NOT_FOUND)
Aborted (core dumped)

 

I added the following code and ran it with a cpu to check for available devices:

for (auto device : device::get_devices(info::device_type::all)) {
        std::cout << "  Devices: " << device.get_info<info::device::name>() << std::endl;
    }
 
 
Now, it fails to detect the GPU. This did not happen previously. The output used to include Intel Gen9 GPU. The following is the output now (we use a separate FPGA emulation device):
Devices: Intel(R) FPGA Emulation Device
Devices: Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz
Devices: Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz
Devices: SYCL host device
 
 
I tried re-installing the drivers but was installed fine:
intel-level-zero-gpu is already the newest version (1.0.18762).
intel-opencl is already the newest version (20.51.18762).
level-zero is already the newest version (1.0.22).
 
Could you me make my system detect the GPU again? Thank you
AbhishekD_Intel
Moderator
558 Views

Hi,


Please try executing the following commands and send us logs. Also, observe that after executing those commands whether you are able to see the GPU availability. Commands are:

  1. sycl-ls --verbose
  2. clinfo


Check whether these commands are detecting GPU and send us logs to get more insight into this issue.



Warm Regards,

Abhishek


Junghoon
Employee
557 Views

Hi Abhishek,

I have attached the logs for those commands. Neither of them are detecting the GPU.

AbhishekD_Intel
Moderator
517 Views

Hi,


Sorry for the delay.

We can also see that neither clinfo nor sycl-ls is detecting the GPU.

Will you please check if you are able to see the GPU in the output of lspci command.

You can try out the following command:

$ lspci | grep -i vga


Please share the output of the above command with us.

Also, check if your user is a member of video/render group, if not then try out the following command to update your group.

$ sudo usermod -a -G video <username>


Hope the provided details will help to resolve your issue. Update us with the output.



Warm Regards,

Abhishek


AbhishekD_Intel
Moderator
476 Views

Hi,


Please give us an update on your issue, so that we will get more insight on your issue. Also do let us know if the issue is resolved.


Warm Regards,

Abhishek


AbhishekD_Intel
Moderator
450 Views

Hi,


We haven't heard back from you for a long time. So we are assuming that your issue has been resolved. We will no longer monitor this thread.

Please post a new thread if you have any other issues.


Warm Regards,

Abhishek


Reply