Re: [Beignet] Weird clinfo ouput @ FreeBSD-11.0/Intel GPU

2016-10-11 Thread Pan, Xiuli
Hi Igor,

The PCIID should be 0x040a, and we support that device.
If you are running without X, then you should check if
ls /dev/dri/
will return something like these:
card0  controlD64  renderD128
If not you may need to enable i915 in your kernel.
Otherwise, there may be something wrong with you libdrm

Thanks
Xiuli

From: Igor Pavlov [mailto:igor.arabesc.pav...@gmail.com]
Sent: Wednesday, October 12, 2016 8:00 AM
To: Pan, Xiuli 
Cc: beignet@lists.freedesktop.org
Subject: Re: [Beignet] Weird clinfo ouput @ FreeBSD-11.0/Intel GPU

It's a headless system, there is no X.

# pciconf -lvbce

vgapci0@pci0:0:2:0:class=0x03 card=0x040a1849 chip=0x040a8086 rev=0x06 
hdr=0x00
vendor = 'Intel Corporation'
device = 'Xeon E3-1200 v3 Processor Integrated Graphics Controller'
class  = display
subclass   = VGA
bar   [10] = type Memory, range 64, base 0xf640, size 4194304, enabled
bar   [18] = type Prefetchable Memory, range 64, base 0xe000, size 
268435456, enabled
bar   [20] = type I/O Port, range 32, base 0xf000, size 64, enabled
cap 05[90] = MSI supports 1 message
cap 01[d0] = powerspec 2  supports D0 D3  current D0
cap 13[a4] = PCI Advanced Features: FLR TP
Do I have to load some driver maybe?


2016-10-11 10:27 GMT+03:00 Pan, Xiuli 
>:
Hi Igor,
Could you provide the PCI ID of your device by
lspci –v.
It seems we could not get the device, it may because that you build with X but 
running without a screen open, or build without X but running by non-root user.

Thanks
Xiuli

From: Beignet 
[mailto:beignet-boun...@lists.freedesktop.org]
 On Behalf Of Igor Pavlov
Sent: Monday, October 10, 2016 8:51 PM
To: beignet@lists.freedesktop.org
Subject: [Beignet] Weird clinfo ouput @ FreeBSD-11.0/Intel GPU

Dear Beignet community,
Could someone kindly clarify, what do all of this mean?

# uname -opr

FreeBSD 11.0-RELEASE-p1 amd64



# sysctl hw.model

hw.model: Intel(R) Xeon(R) CPU E3-1265L v3 @ 2.50GHz



# pkg info | grep beignet

beignet-1.2.0  OpenCL library for Intel GPUs



# clinfo -v

clinfo version 2.1.16.01.12



# clinfo

Device open failed, aborting...

Number of platforms   1

  Platform Name   Intel Gen OCL Driver

  Platform Vendor Intel

  Platform VersionOpenCL 1.2 beignet 1.2

  Platform ProfileFULL_PROFILE

  Platform Extensions 
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_3d_image_writes cl_khr_image2d_from_buffer 
cl_khr_spir cl_khr_icd cl_intel_accelerator cl_intel_motion_estimation 
cl_intel_subgroups

  Platform Extensions function suffix Intel

Device open failed, aborting...

cl_get_gt_device(): error, unknown device: 



  Platform Name   Intel Gen OCL Driver

Number of devices 0



NULL platform behavior

  clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  Intel Gen OCL Driver

Device open failed, aborting...

cl_get_gt_device(): error, unknown device: 

  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   Intel Gen OCL Driver

  clCreateContext(NULL, ...) [default]No devices found in platform

  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU)  No devices found in 
platform

Device open failed, aborting...

cl_get_gt_device(): error, unknown device: 

  clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU)  No devices found in 
platform

  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR)  No devices found 
in platform

  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM)  No devices found in 
platform

Device open failed, aborting...

cl_get_gt_device(): error, unknown device: 

  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL)  No devices found in 
platform



ICD loader properties

  ICD loader Name OpenCL ICD Loader

  ICD loader Vendor   OCL Icd free software

  ICD loader Version  2.2.7

  ICD loader Profile  OpenCL 1.2

NOTE:   your OpenCL library declares to support OpenCL 1.2,

but it seems to support up to OpenCL 2.0 too.

Nothing to output !

--
Igor

___
Beignet mailing list
Beignet@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/beignet


Re: [Beignet] [PATCH v3] Utests: Allow testing cl_intel_accelerator via ICD

2016-10-11 Thread Rebecca N. Palmer
v3: Use extension check, not beignet check.  Treat claiming
to have the extension but not having the kernel as a failure.

---
(v2 was the un-numbered 10/10/16 08:07 version...which I subsequently
noticed was broken in that it assumed a non-NULL
clGetExtensionFunctionAddressForPlatform result meant the extension
was supported, which it doesn't in general,
https://www.khronos.org/registry/cl/sdk/2.1/docs/man/xhtml/clGetExtensionFunctionAddressForPlatform.html
 )

--- a/utests/builtin_kernel_block_motion_estimate_intel.cpp
+++ b/utests/builtin_kernel_block_motion_estimate_intel.cpp
@@ -8,6 +8,19 @@ OCLRELEASEACCELERATORINTEL * oclReleaseA
 
 void builtin_kernel_block_motion_estimate_intel(void)
 {
+  std::string extStr;
+  size_t param_value_size;
+  OCL_CALL(clGetDeviceInfo, device, CL_DEVICE_EXTENSIONS, 0, 0, 
_value_size);
+  std::vector param_value(param_value_size);
+  OCL_CALL(clGetDeviceInfo, device, CL_DEVICE_EXTENSIONS, param_value_size,
+   param_value.empty() ? NULL : _value.front(), 
_value_size);
+  if (!param_value.empty())
+extStr = std::string(_value.front(), param_value_size-1);
+  // cl_intel_motion_estimation depends on cl_intel_accelerator, so we only 
need to check one
+  if (strstr(extStr.c_str(), "cl_intel_motion_estimation") == NULL) {
+printf("No cl_intel_motion_estimation, Skip!");
+return;
+  }
   char* built_in_kernel_names;
   size_t built_in_kernels_size;
   cl_int err = CL_SUCCESS;
@@ -21,7 +34,8 @@ void builtin_kernel_block_motion_estimat
   if (strstr(built_in_kernel_names, "block_motion_estimate_intel") == NULL)
   {
 free(built_in_kernel_names);
-return;
+printf("Can't find block_motion_estimate_intel built-in kernel");
+OCL_ASSERT(0);
   }
 
   cl_program built_in_prog = clCreateProgramWithBuiltInKernels(ctx, 1, 
, built_in_kernel_names, );
--- a/utests/CMakeLists.txt
+++ b/utests/CMakeLists.txt
@@ -287,7 +287,8 @@ set (utests_sources
   multi_queue_events.cpp
   compiler_mix.cpp
   compiler_math_3op.cpp
-  compiler_bsort.cpp)
+  compiler_bsort.cpp
+  builtin_kernel_block_motion_estimate_intel.cpp)
 
 if (LLVM_VERSION_NODOT VERSION_GREATER 34)
   SET(utests_sources
@@ -328,7 +329,6 @@ else(GEN_PCI_ID)
 endif(GEN_PCI_ID)
 
 if (NOT_BUILD_STAND_ALONE_UTEST)
-  SET(utests_sources ${utests_sources} 
builtin_kernel_block_motion_estimate_intel.cpp)
   ADD_CUSTOM_TARGET(kernel_bin.bin DEPENDS ${kernel_bin}.bin)
 endif (NOT_BUILD_STAND_ALONE_UTEST)
 

___
Beignet mailing list
Beignet@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/beignet


Re: [Beignet] Weird clinfo ouput @ FreeBSD-11.0/Intel GPU

2016-10-11 Thread Pan, Xiuli
Hi Igor,
Could you provide the PCI ID of your device by
lspci –v.
It seems we could not get the device, it may because that you build with X but 
running without a screen open, or build without X but running by non-root user.

Thanks
Xiuli

From: Beignet [mailto:beignet-boun...@lists.freedesktop.org] On Behalf Of Igor 
Pavlov
Sent: Monday, October 10, 2016 8:51 PM
To: beignet@lists.freedesktop.org
Subject: [Beignet] Weird clinfo ouput @ FreeBSD-11.0/Intel GPU

Dear Beignet community,
Could someone kindly clarify, what do all of this mean?

# uname -opr

FreeBSD 11.0-RELEASE-p1 amd64



# sysctl hw.model

hw.model: Intel(R) Xeon(R) CPU E3-1265L v3 @ 2.50GHz



# pkg info | grep beignet

beignet-1.2.0  OpenCL library for Intel GPUs



# clinfo -v

clinfo version 2.1.16.01.12



# clinfo

Device open failed, aborting...

Number of platforms   1

  Platform Name   Intel Gen OCL Driver

  Platform Vendor Intel

  Platform VersionOpenCL 1.2 beignet 1.2

  Platform ProfileFULL_PROFILE

  Platform Extensions 
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_3d_image_writes cl_khr_image2d_from_buffer 
cl_khr_spir cl_khr_icd cl_intel_accelerator cl_intel_motion_estimation 
cl_intel_subgroups

  Platform Extensions function suffix Intel

Device open failed, aborting...

cl_get_gt_device(): error, unknown device: 



  Platform Name   Intel Gen OCL Driver

Number of devices 0



NULL platform behavior

  clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  Intel Gen OCL Driver

Device open failed, aborting...

cl_get_gt_device(): error, unknown device: 

  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   Intel Gen OCL Driver

  clCreateContext(NULL, ...) [default]No devices found in platform

  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU)  No devices found in 
platform

Device open failed, aborting...

cl_get_gt_device(): error, unknown device: 

  clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU)  No devices found in 
platform

  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR)  No devices found 
in platform

  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM)  No devices found in 
platform

Device open failed, aborting...

cl_get_gt_device(): error, unknown device: 

  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL)  No devices found in 
platform



ICD loader properties

  ICD loader Name OpenCL ICD Loader

  ICD loader Vendor   OCL Icd free software

  ICD loader Version  2.2.7

  ICD loader Profile  OpenCL 1.2

NOTE:   your OpenCL library declares to support OpenCL 1.2,

but it seems to support up to OpenCL 2.0 too.

Nothing to output !

--
Igor
___
Beignet mailing list
Beignet@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/beignet


Re: [Beignet] [PATCH] Add clGetKernelSubGroupInfoKHR to _cl_icd_dispatch table

2016-10-11 Thread Rebecca N. Palmer

Now I see that the problem is the API cannot be used through ICD, but in 
OpenCL1.2 it is a vender extension.
Beignet may consider it a vendor extension, but ocl-icd doesn't: 
anything with a KHR or EXT name goes through the "check the dispatch 
table first" lookup process, whether or not it exists in the version of 
OpenCL the ICD says it supports.



Should we use the ICD OpenCL2.0 API table of it?

If you mean my patch, yes.


Or maybe we should not use clGetExtensionFunctionForPlatform or 
clGetExtensionFunction to get the API clGetKernelSubGroupInfoKHR?
The alternative of just calling clGetKernelSubGroupInfoKHR without such 
a lookup also goes through the address table when used via ICD, so it 
will have the same problem...plus the additional problem of being a 
compile-time error on older versions of ocl-icd that don't know about 
this function.  (If you want to see the code that does this, build 
ocl-icd then look in ocl_icd_loader_gen.c)


If you want the warning to go away, you'd need to update Beignet's 
headers to 2.0+ (we already do that in Debian (for different reasons), 
it doesn't change the 1.2 version Beignet reports via clGetDeviceInfo) 
*and* use a stricter check (OCL_ICD_IDENTIFIED_FUNCTIONS > 120), or 
suppress it via compiler option (though the latter might also suppress 
the warning if you accidentally put a function in the wrong slot - I 
haven't tried).


___
Beignet mailing list
Beignet@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/beignet