How to use oneAPI Construction Kit as SYCL backend?

Hi, I’m trying oneAPI Construction Kit project recently, I compiled oneAPI Construction Kit RISC-V G1 target and register the OpenCL ICD. Then I did some tests with UnitCL and CLSmith tools, it works fine.

Then I want to try run SYCL code on this target. I installed DPC++ followed the intel website. But sycl-ls didn’t show my OpenCL device. There are just two Intel devices.

ubuntu@VM-0-15-ubuntu:/etc/OpenCL/vendors$ sycl-ls 
[opencl:acc:0] Intel(R) FPGA Emulation Platform for OpenCL(TM), Intel(R) FPGA Emulation Device OpenCL 1.2  [2024.17.3.0.08_160000]
[opencl:cpu:1] Intel(R) OpenCL, AMD EPYC 9754 128-Core Processor OpenCL 3.0 (Build 0) [2024.17.3.0.08_160000]
ubuntu@VM-0-15-ubuntu:/etc/OpenCL/vendors$ ls -lh
total 16K
-rw-r--r-- 1 root root 79 May 15 08:43 Altera.icd
-rw-r--r-- 1 root root 79 May 15 17:05 codeplay.icd
-rw-r--r-- 1 root root 54 May 15 08:43 intel64.icd
-rw-r--r-- 1 root root 58 May 15 08:43 Intel_FPGA_SSG_Emulator.icd
ubuntu@VM-0-15-ubuntu:/etc/OpenCL/vendors$ 
ubuntu@VM-0-15-ubuntu:/etc/OpenCL/vendors$ cat codeplay.icd 
/home/ubuntu/projects/oneapi-construction-kit/build-riscv/install/lib/libCL.so
ubuntu@VM-0-15-ubuntu:/etc/OpenCL/vendors$ 

My question is, how to run SYCL code with oneAPI Construction Kit ?

Hi @Skylark,

Thanks for trying out the construction kit!

There are a couple of things you can try to do to debug this issue. Firstly, do the devices show when using clinfo? If not then there’s some problem in the ICD Loader. If they do then we can reasonably assume that somehow sycl-ls isn’t showing the devices. In that case, the environment variable SYCL_PI_TRACE=1 should show the full set of calls that sycl-ls makes in device discovery.

If you paste the output of some of these commands, that might give us more information to work with.

Many thanks,
Duncan.

Hi @duncan,
Thanks for your quick reply! Follow your advise, I tried clinfo, I found that the Platform ComputeAorta and the Device RefSi G1 RV64 can be found successful, you can see there are 3 platforms.
But SYCL_PI_TRACE=1 sycl-ls --verbose command showed there are just 2 platforms.
I guess it’s the problem of oneAPI, which may just prob the platform that the vendor is Intel(R) Corporation.
I just follow this guide to install oneAPI, maybe this version just support intel devices.

BTW, the OS is ubuntu20.04, the oneAPI Construction Kit version is 3.0.0.

Do you have any further suggestion?
Thanks!

below is the command logs:

ubuntu@VM-0-15-ubuntu:/etc/OpenCL$ clinfo
Number of platforms                               3
  Platform Name                                   Intel(R) FPGA Emulation Platform for OpenCL(TM)
  Platform Vendor                                 Intel(R) Corporation
  Platform Version                                OpenCL 1.2 Intel(R) FPGA SDK for OpenCL(TM), Version 20.3
  Platform Profile                                EMBEDDED_PROFILE
  Platform Extensions                             cl_khr_spirv_linkonce_odr cl_khr_fp64 cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_3d_image_writes cl_khr_byte_addressable_store cl_khr_depth_images cl_khr_icd cl_khr_il_program cl_intel_unified_shared_memory cl_intel_fpga_host_pipe cl_intel_program_scope_host_pipe cles_khr_int64 cl_intel_channels
  Platform Extensions function suffix             IntelFPGA

  Platform Name                                   Intel(R) OpenCL
  Platform Vendor                                 Intel(R) Corporation
  Platform Version                                OpenCL 3.0 LINUX
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_spirv_linkonce_odr cl_khr_fp64 cl_khr_fp16 cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_3d_image_writes cl_khr_byte_addressable_store cl_khr_depth_images cl_khr_icd cl_khr_il_program cl_intel_unified_shared_memory cl_intel_devicelib_assert cl_khr_subgroup_shuffle cl_khr_subgroup_shuffle_relative cl_khr_subgroup_extended_types cl_khr_subgroup_non_uniform_arithmetic cl_intel_subgroups cl_intel_subgroups_char cl_intel_subgroups_short cl_intel_subgroups_long cl_intel_required_subgroup_size cl_intel_spirv_subgroups cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_intel_device_attribute_query cl_intel_exec_by_local_thread cl_intel_vec_len_hint cl_intel_device_partition_by_names cl_khr_spir cl_khr_image2d_from_buffer cl_intel_concurrent_dispatch
  Platform Host timer resolution                  1ns
  Platform Extensions function suffix             INTEL

  Platform Name                                   ComputeAorta
  Platform Vendor                                 Codeplay Software Ltd.
  Platform Version                                OpenCL 3.0 ComputeAorta 3.0.0 Linux x86_64
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_codeplay_kernel_exec_info cl_codeplay_soft_math cl_khr_create_command_queue cl_khr_icd cl_codeplay_extra_build_options
  Platform Host timer resolution                  0ns
  Platform Extensions function suffix             CODEPLAY

  Platform Name                                   Intel(R) FPGA Emulation Platform for OpenCL(TM)
Number of devices                                 1
  Device Name                                     Intel(R) FPGA Emulation Device
  Device Vendor                                   Intel(R) Corporation
  Device Vendor ID                                0x1172
  Device Version                                  OpenCL 1.2 
  Driver Version                                  2024.17.3.0.08_160000
  Device OpenCL C Version                         OpenCL C 1.2 
  Device Type                                     Accelerator
  Device Profile                                  EMBEDDED_PROFILE
  Device Available                                Yes
  Compiler Available                              Yes
  Linker Available                                Yes
  Max compute units                               4
  Max clock frequency                             0MHz
  Device Partition                                (core)
    Max number of sub-devices                     4
    Supported partition types                     by counts, equally, by names (Intel)
    Supported affinity domains                    (n/a)
  Max work item dimensions                        3
  Max work item sizes                             67108864x67108864x67108864
  Max work group size                             67108864
  Preferred work group size multiple              128
  Preferred / native vector sizes                 
    char                                                 1 / 64      
    short                                                1 / 32      
    int                                                  1 / 16      
    long                                                 1 / 8       
    half                                                 0 / 0        (n/a)
    float                                                1 / 16      
    double                                               1 / 8        (cl_khr_fp64)
  Half-precision Floating-point support           (n/a)
  Single-precision Floating-point support         (core)
    Denormals                                     Yes
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 No
    Round to infinity                             No
    IEEE754-2008 fused multiply-add               No
    Support is emulated in software               No
    Correctly-rounded divide and sqrt operations  No
  Double-precision Floating-point support         (cl_khr_fp64)
    Denormals                                     Yes
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 Yes
    Round to infinity                             Yes
    IEEE754-2008 fused multiply-add               Yes
    Support is emulated in software               No
  Address bits                                    64, Little-Endian
  Global memory size                              7661834240 (7.136GiB)
  Error Correction support                        No
  Max memory allocation                           3830917120 (3.568GiB)
  Unified memory for Host and Device              Yes
  Minimum alignment for any data type             128 bytes
  Alignment of base address                       1024 bits (128 bytes)
  Global Memory cache type                        Read/Write
  Global Memory cache size                        524288 (512KiB)
  Global Memory cache line size                   64 bytes
  Image support                                   No
  Local memory type                               Global
  Local memory size                               262144 (256KiB)
  Max number of constant args                     480
  Max constant buffer size                        131072 (128KiB)
  Max size of kernel argument                     3840 (3.75KiB)
  Queue properties                                
    Out-of-order execution                        Yes
    Profiling                                     Yes
  Prefer user sync for interop                    No
  Profiling timer resolution                      1ns
  Execution capabilities                          
    Run OpenCL kernels                            Yes
    Run native kernels                            Yes
    IL version                                    SPIR-V_1.0
    SPIR versions                                 1.2
  printf() buffer size                            1048576 (1024KiB)
  Built-in kernels                                (n/a)
  Device Extensions                               cl_khr_spirv_linkonce_odr cl_khr_fp64 cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_3d_image_writes cl_khr_byte_addressable_store cl_khr_depth_images cl_khr_icd cl_khr_il_program cl_intel_unified_shared_memory cl_intel_fpga_host_pipe cl_intel_program_scope_host_pipe cles_khr_int64 cl_intel_channels

  Platform Name                                   Intel(R) OpenCL
Number of devices                                 1
  Device Name                                     AMD EPYC 9754 128-Core Processor
  Device Vendor                                   Intel(R) Corporation
  Device Vendor ID                                0x8086
  Device Version                                  OpenCL 3.0 (Build 0)
  Driver Version                                  2024.17.3.0.08_160000
  Device OpenCL C Version                         OpenCL C 3.0 
  Device Type                                     CPU
  Device Profile                                  FULL_PROFILE
  Device Available                                Yes
  Compiler Available                              Yes
  Linker Available                                Yes
  Max compute units                               4
  Max clock frequency                             0MHz
  Device Partition                                (core)
    Max number of sub-devices                     4
    Supported partition types                     by counts, equally, by names (Intel)
    Supported affinity domains                    (n/a)
  Max work item dimensions                        3
  Max work item sizes                             8192x8192x8192
  Max work group size                             8192
  Preferred work group size multiple              128
  Max sub-groups per work group                   2048
  Sub-group sizes (Intel)                         4, 8, 16, 32, 64
  Preferred / native vector sizes                 
    char                                                 1 / 64      
    short                                                1 / 32      
    int                                                  1 / 16      
    long                                                 1 / 8       
    half                                                 0 / 0        (cl_khr_fp16)
    float                                                1 / 16      
    double                                               1 / 8        (cl_khr_fp64)
  Half-precision Floating-point support           (cl_khr_fp16)
    Denormals                                     No
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 No
    Round to infinity                             No
    IEEE754-2008 fused multiply-add               No
    Support is emulated in software               No
  Single-precision Floating-point support         (core)
    Denormals                                     Yes
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 No
    Round to infinity                             No
    IEEE754-2008 fused multiply-add               No
    Support is emulated in software               No
    Correctly-rounded divide and sqrt operations  No
  Double-precision Floating-point support         (cl_khr_fp64)
    Denormals                                     Yes
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 Yes
    Round to infinity                             Yes
    IEEE754-2008 fused multiply-add               Yes
    Support is emulated in software               No
  Address bits                                    64, Little-Endian
  Global memory size                              7661834240 (7.136GiB)
  Error Correction support                        No
  Max memory allocation                           3830917120 (3.568GiB)
  Unified memory for Host and Device              Yes
  Shared Virtual Memory (SVM) capabilities        (core)
    Coarse-grained buffer sharing                 Yes
    Fine-grained buffer sharing                   Yes
    Fine-grained system sharing                   Yes
    Atomics                                       Yes
  Minimum alignment for any data type             128 bytes
  Alignment of base address                       1024 bits (128 bytes)
  Preferred alignment for atomics                 
    SVM                                           64 bytes
    Global                                        64 bytes
    Local                                         0 bytes
  Max size for global variable                    65536 (64KiB)
  Preferred total size of global vars             65536 (64KiB)
  Global Memory cache type                        Read/Write
  Global Memory cache size                        524288 (512KiB)
  Global Memory cache line size                   64 bytes
  Image support                                   Yes
    Max number of samplers per kernel             480
    Max size for 1D images from buffer            239432320 pixels
    Max 1D or 2D image array size                 2048 images
    Base address alignment for 2D image buffers   64 bytes
    Pitch alignment for 2D image buffers          64 pixels
    Max 2D image size                             16384x16384 pixels
    Max 3D image size                             2048x2048x2048 pixels
    Max number of read image args                 480
    Max number of write image args                480
    Max number of read/write image args           480
  Max number of pipe args                         16
  Max active pipe reservations                    65535
  Max pipe packet size                            1024
  Local memory type                               Global
  Local memory size                               32768 (32KiB)
  Max number of constant args                     480
  Max constant buffer size                        131072 (128KiB)
  Max size of kernel argument                     3840 (3.75KiB)
  Queue properties (on host)                      
    Out-of-order execution                        Yes
    Profiling                                     Yes
    Local thread execution (Intel)                Yes
  Queue properties (on device)                    
    Out-of-order execution                        Yes
    Profiling                                     Yes
    Preferred size                                4294967295 (4GiB)
    Max size                                      4294967295 (4GiB)
  Max queues on device                            4294967295
  Max events on device                            4294967295
  Prefer user sync for interop                    No
  Profiling timer resolution                      1ns
  Execution capabilities                          
    Run OpenCL kernels                            Yes
    Run native kernels                            Yes
    Sub-group independent forward progress        No
    IL version                                    SPIR-V_1.0
    SPIR versions                                 1.2
  printf() buffer size                            1048576 (1024KiB)
  Built-in kernels                                (n/a)
  Device Extensions                               cl_khr_spirv_linkonce_odr cl_khr_fp64 cl_khr_fp16 cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_3d_image_writes cl_khr_byte_addressable_store cl_khr_depth_images cl_khr_icd cl_khr_il_program cl_intel_unified_shared_memory cl_intel_devicelib_assert cl_khr_subgroup_shuffle cl_khr_subgroup_shuffle_relative cl_khr_subgroup_extended_types cl_khr_subgroup_non_uniform_arithmetic cl_intel_subgroups cl_intel_subgroups_char cl_intel_subgroups_short cl_intel_subgroups_long cl_intel_required_subgroup_size cl_intel_spirv_subgroups cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_intel_device_attribute_query cl_intel_exec_by_local_thread cl_intel_vec_len_hint cl_intel_device_partition_by_names cl_khr_spir cl_khr_image2d_from_buffer cl_intel_concurrent_dispatch

  Platform Name                                   ComputeAorta
Number of devices                                 1
  Device Name                                     RefSi G1 RV64
  Device Vendor                                   Codeplay Software Ltd.
  Device Vendor ID                                0x10004
  Device Version                                  OpenCL 3.0 ComputeAorta 3.0.0 LLVM 16.0.6
  Driver Version                                  3.0
  Device OpenCL C Version                         OpenCL C 1.2 Clang 16.0.6
  Device Type                                     Accelerator
  Device Profile                                  FULL_PROFILE
  Device Available                                Yes
  Compiler Available                              Yes
  Linker Available                                Yes
  Max compute units                               1
  Max clock frequency                             1MHz
  Device Partition                                (core)
    Max number of sub-devices                     0
    Supported partition types                     None
    Supported affinity domains                    (n/a)
  Max work item dimensions                        3
  Max work item sizes                             1024x1024x1024
  Max work group size                             1024
  Preferred work group size multiple              64
  Max sub-groups per work group                   1024
  Sub-group sizes (Intel)                         (n/a)
  Preferred / native vector sizes                 
    char                                                 1 / 1       
    short                                                1 / 1       
    int                                                  1 / 1       
    long                                                 1 / 1       
    half                                                 0 / 0        (n/a)
    float                                                1 / 1       
    double                                               1 / 1        (cl_khr_fp64)
  Half-precision Floating-point support           (n/a)
  Single-precision Floating-point support         (core)
    Denormals                                     Yes
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 No
    Round to infinity                             No
    IEEE754-2008 fused multiply-add               No
    Support is emulated in software               No
    Correctly-rounded divide and sqrt operations  No
  Double-precision Floating-point support         (cl_khr_fp64)
    Denormals                                     Yes
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 Yes
    Round to infinity                             Yes
    IEEE754-2008 fused multiply-add               Yes
    Support is emulated in software               No
  Address bits                                    64, Little-Endian
  Global memory size                              2130706432 (1.984GiB)
  Error Correction support                        No
  Max memory allocation                           2130706432 (1.984GiB)
  Unified memory for Host and Device              Yes
  Shared Virtual Memory (SVM) capabilities        (core)
    Coarse-grained buffer sharing                 No
    Fine-grained buffer sharing                   No
    Fine-grained system sharing                   No
    Atomics                                       No
  Minimum alignment for any data type             128 bytes
  Alignment of base address                       1024 bits (128 bytes)
  Preferred alignment for atomics                 
    SVM                                           0 bytes
    Global                                        0 bytes
    Local                                         0 bytes
  Max size for global variable                    0
  Preferred total size of global vars             0
  Global Memory cache type                        Read/Write
  Global Memory cache size                        0
  Global Memory cache line size                   0 bytes
  Image support                                   No
  Max number of pipe args                         0
  Max active pipe reservations                    0
  Max pipe packet size                            0
  Local memory type                               Local
  Local memory size                               262144 (256KiB)
  Max number of constant args                     8
  Max constant buffer size                        65536 (64KiB)
  Max size of kernel argument                     1024
  Queue properties (on host)                      
    Out-of-order execution                        No
    Profiling                                     Yes
  Queue properties (on device)                    
    Out-of-order execution                        No
    Profiling                                     No
    Preferred size                                0
    Max size                                      0
  Max queues on device                            0
  Max events on device                            0
  Prefer user sync for interop                    Yes
  Profiling timer resolution                      5ns
  Execution capabilities                          
    Run OpenCL kernels                            Yes
    Run native kernels                            No
    Sub-group independent forward progress        No
    IL version                                    SPIR-V_1.0
    SPIR versions                                 1.2
  printf() buffer size                            1048576 (1024KiB)
  Built-in kernels                                (n/a)
  Device Extensions                               cl_codeplay_kernel_exec_info cl_codeplay_performance_counters cl_codeplay_soft_math cl_intel_required_subgroup_size cl_intel_unified_shared_memory cl_khr_create_command_queue cl_khr_icd cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_byte_addressable_store cl_khr_fp64 cl_codeplay_extra_build_options cl_codeplay_kernel_debug cl_khr_extended_async_copies cl_khr_il_program cl_khr_spir


NULL platform behavior
  clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  No platform
  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   No platform
  clCreateContext(NULL, ...) [default]            No platform
  clCreateContext(NULL, ...) [other]              Success [IntelFPGA]
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_DEFAULT)  Success (1)
    Platform Name                                 Intel(R) FPGA Emulation Platform for OpenCL(TM)
    Device Name                                   Intel(R) FPGA Emulation Device
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR)  Success (1)
    Platform Name                                 Intel(R) FPGA Emulation Platform for OpenCL(TM)
    Device Name                                   Intel(R) FPGA Emulation Device
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL)  Success (1)
    Platform Name                                 Intel(R) FPGA Emulation Platform for OpenCL(TM)
    Device Name                                   Intel(R) FPGA Emulation Device
        NOTE:   your OpenCL library only supports OpenCL 2.2,
                but some installed platforms support OpenCL 3.0.
                Programs using 3.0 features may crash
                or behave unexpectedly
ubuntu@VM-0-15-ubuntu:/etc/OpenCL$ SYCL_PI_TRACE=1 sycl-ls --verbose
SYCL_PI_TRACE[basic]: Plugin found and successfully loaded: libpi_opencl.so [ PluginVersion: 14.39.1 ]
SYCL_PI_TRACE[basic]: Plugin found and successfully loaded: libpi_unified_runtime.so [ PluginVersion: 14.39.1 ]
[opencl:acc:0] Intel(R) FPGA Emulation Platform for OpenCL(TM), Intel(R) FPGA Emulation Device OpenCL 1.2  [2024.17.3.0.08_160000]
[opencl:cpu:1] Intel(R) OpenCL, AMD EPYC 9754 128-Core Processor OpenCL 3.0 (Build 0) [2024.17.3.0.08_160000]

Platforms: 2
Platform [#1]:
    Version  : OpenCL 1.2 Intel(R) FPGA SDK for OpenCL(TM), Version 20.3
    Name     : Intel(R) FPGA Emulation Platform for OpenCL(TM)
    Vendor   : Intel(R) Corporation
    Devices  : 1
        Device [#0]:
        Type       : acc
        Version    : OpenCL 1.2 
        Name       : Intel(R) FPGA Emulation Device
        Vendor     : Intel(R) Corporation
        Driver     : 2024.17.3.0.08_160000
        Aspects    : accelerator fp64 online_compiler online_linker queue_profiling usm_device_allocations usm_host_allocations usm_shared_allocations usm_atomic_host_allocations usm_atomic_shared_allocations ext_oneapi_srgb ext_oneapi_non_uniform_groups
        info::device::sub_group_sizes: 4 8 16 32 64
Platform [#2]:
    Version  : OpenCL 3.0 LINUX
    Name     : Intel(R) OpenCL
    Vendor   : Intel(R) Corporation
    Devices  : 1
        Device [#1]:
        Type       : cpu
        Version    : OpenCL 3.0 (Build 0)
        Name       : AMD EPYC 9754 128-Core Processor
        Vendor     : Intel(R) Corporation
        Driver     : 2024.17.3.0.08_160000
        Aspects    : cpu fp16 fp64 online_compiler online_linker queue_profiling usm_device_allocations usm_host_allocations usm_shared_allocations usm_system_allocations usm_atomic_host_allocations usm_atomic_shared_allocations atomic64 ext_oneapi_srgb ext_oneapi_native_assert ext_intel_legacy_image ext_oneapi_non_uniform_groups
        info::device::sub_group_sizes: 4 8 16 32 64
SYCL_PI_TRACE[all]: Requested device_type: info::device_type::automatic
SYCL_PI_TRACE[all]: Requested device_type: info::device_type::automatic
SYCL_PI_TRACE[all]: Selected device: -> final score = 300
SYCL_PI_TRACE[all]:   platform: Intel(R) OpenCL
SYCL_PI_TRACE[all]:   device: AMD EPYC 9754 128-Core Processor
default_selector()      : cpu, Intel(R) OpenCL, AMD EPYC 9754 128-Core Processor OpenCL 3.0 (Build 0) [2024.17.3.0.08_160000]
SYCL_PI_TRACE[all]: Requested device_type: info::device_type::accelerator
SYCL_PI_TRACE[all]: Requested device_type: info::device_type::accelerator
SYCL_PI_TRACE[all]: Selected device: -> final score = 1000
SYCL_PI_TRACE[all]:   platform: Intel(R) FPGA Emulation Platform for OpenCL(TM)
SYCL_PI_TRACE[all]:   device: Intel(R) FPGA Emulation Device
accelerator_selector()  : acc, Intel(R) FPGA Emulation Platform for OpenCL(TM), Intel(R) FPGA Emulation Device OpenCL 1.2  [2024.17.3.0.08_160000]
SYCL_PI_TRACE[all]: Requested device_type: info::device_type::cpu
SYCL_PI_TRACE[all]: Requested device_type: info::device_type::cpu
SYCL_PI_TRACE[all]: Selected device: -> final score = 1000
SYCL_PI_TRACE[all]:   platform: Intel(R) OpenCL
SYCL_PI_TRACE[all]:   device: AMD EPYC 9754 128-Core Processor
cpu_selector()          : cpu, Intel(R) OpenCL, AMD EPYC 9754 128-Core Processor OpenCL 3.0 (Build 0) [2024.17.3.0.08_160000]
SYCL_PI_TRACE[all]: Requested device_type: info::device_type::gpu
SYCL_PI_TRACE[all]: Requested device_type: info::device_type::gpu
gpu_selector()          : No device of requested type available. Please chec...
custom_selector(gpu)    : No device of requested type available. Please chec...
SYCL_PI_TRACE[all]: Selected device: -> final score = 1
SYCL_PI_TRACE[all]:   platform: Intel(R) OpenCL
SYCL_PI_TRACE[all]:   device: AMD EPYC 9754 128-Core Processor
custom_selector(cpu)    : cpu, Intel(R) OpenCL, AMD EPYC 9754 128-Core Processor OpenCL 3.0 (Build 0) [2024.17.3.0.08_160000]
SYCL_PI_TRACE[all]: Selected device: -> final score = 1
SYCL_PI_TRACE[all]:   platform: Intel(R) FPGA Emulation Platform for OpenCL(TM)
SYCL_PI_TRACE[all]:   device: Intel(R) FPGA Emulation Device
custom_selector(acc)    : acc, Intel(R) FPGA Emulation Platform for OpenCL(TM), Intel(R) FPGA Emulation Device OpenCL 1.2  [2024.17.3.0.08_160000]

Hi @Skylark,
That’s helpful, since it does seem to show that the construction kit is working from the OpenCL level. I’m not sure why it would then not show in sycl-ls.

I’ll see if I can get any more information on this.

Hi @Skylark,

Would you be able to try setting the environment variable SYCL_CONFIG_FILE_NAME to the empty string as described in the README? GitHub - codeplaysoftware/oneapi-construction-kit

I hope this helps,
Duncan.

Hi duncan,
It works with ‘SYCL_CONFIG_FILE_NAME=’ flag, the ‘RefSi G1 RV64’ device can be found now, thanks a lot!

$ SYCL_CONFIG_FILE_NAME= sycl-ls
[opencl:acc:0] Intel(R) FPGA Emulation Platform for OpenCL(TM), Intel(R) FPGA Emulation Device OpenCL 1.2  [2024.17.3.0.08_160000]
[opencl:cpu:1] Intel(R) OpenCL, AMD EPYC 9754 128-Core Processor OpenCL 3.0 (Build 0) [2024.17.3.0.08_160000]
[opencl:acc:2] ComputeAorta, RefSi G1 RV64 OpenCL 3.0 ComputeAorta 3.0.0 LLVM 16.0.6 [3.0]

But I run into another issue when running the vector-add-buffers example:

$ /opt/intel/oneapi/compiler/2024.1/bin/compiler/clang++ -fsycl vector-add-buffers_rv.cpp -o vector-add-buffe
$ SYCL_CONFIG_FILE_NAME= ./vector-add-buffers
Running on device: RefSi G1 RV64
Vector size: 10000
An exception is caught for vector add.
terminate called after throwing an instance of 'sycl::_V1::compile_program_error'
  what():  The program was built for 1 devices
Build program log for 'RefSi G1 RV64':
error: OpCapability MemoryAccessAliasingINTEL (#5910) not supported by device
 -11 (PI_ERROR_BUILD_PROGRAM_FAILURE)
Aborted (core dumped)

Seems the dpc++ requires target to support MemoryAccessAliasingINTEL, it doesn’t make sense.

Hi @skylark. Can I check if you built this yourself or took a release binary from the oneAPI Construction Kit? If you built it yourself perhaps you could try the latest stable branch, and if you downloaded the binary perhaps try one of the release dailies from earlier this year? We did fix this issue some time ago, but it perhaps didn’t make it into 3.0.0. We do plan another release at the end of next month.

Thanks @Skylark , I recompiled the latest oneAPI Construction Kit on main branch, it works fine.
Now the SYCL test code works fine on RefSi G1 RV64 target with SYCL_CONFIG_FILE_NAME= option.

ubuntu@VM-0-15-ubuntu:~/projects/syclacademy/Code_Exercises/Data_Parallelism$ icpx -fsycl -I/home/ubuntu/projects/syclacademy/External/Catch2/single_include solution_rv.cpp -o solution_rv

ubuntu@VM-0-15-ubuntu:~/projects/syclacademy/Code_Exercises/Data_Parallelism$ SYCL_CONFIG_FILE_NAME= ./so
lution_rv 
Run on device RefSi G1 RV64
===============================================================================
All tests passed (1024 assertions in 1 test case)