OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU
Announcements
This forum covers OpenCL* for CPU only. OpenCL* for GPU questions can be asked in the GPU Compute Software forum. Intel® FPGA SDK for OpenCL™ questions can be ask in the FPGA Intel® High Level Design forum.
1663 Discussions

OpenCL samples CPU CL_INVALID_PLATFORM

Chizhov__Vassillen
406 Views

I get the error CL_INVALID_PLATFORM if I try to run the official samples with the CPU (both my iGPU and discrete GPU work fine with those). The CPU in question is i5 7300HQ. It should support OpenCL 2.1 even, so I assume that it has something to do with the OpenCL runtime. I have installed the recommended Inte SDK for OpenCL applications. Should I have installed the CPU runtime additionally? However it refuses to install in the presence of the graphics one.

On an unrelated note, the VS integration of OpenCL somehow managed to break VS, so I had to disable it. I am unsure whether that's a known bug, but VS kept restarting until I disabled the integrated features coming with the OpenCL SDK.

0 Kudos
6 Replies
Michael_C_Intel1
Moderator
406 Views

Hi VassillenC,

Thanks for the question and the interest... A discussion may help many users...

Meta-comments:

  • Can you provide a reference/url to which samples... What is your goal? Are you attempting to run helloworld at this point or something else or more specific? Can you share your goal?
  • What is the graphics driver package version deployed on the system? Can it be updated from the system vendor website or from downloadcenter.intel.com?
  • Can you provide the data in this post here? 
  • Can you post the full text of the output that includes the CL_INVALID_PLATFORM return code, or describe how you observed the error?
  • Can you provide this information from powershell for both System32 and SysWoW64 dirs?
PS C:\Users\yourname> get-childitem "C:\Windows\System32\OpenCL.dll" | % {$_.VersionInfo} | Select *


FileVersionRaw     : 2.1.1.0
ProductVersionRaw  : 2.1.1.0
Comments           :
CompanyName        : Khronos Group
FileBuildPart      : 1
FileDescription    : OpenCL Client DLL
FileMajorPart      : 2
FileMinorPart      : 1
FileName           : C:\Windows\System32\OpenCL.dll
FilePrivatePart    : 0
FileVersion        : 2.1.1.0
InternalName       : OpenCL
IsDebug            : False
IsPatched          : False
IsPrivateBuild     : False
IsPreRelease       : False
IsSpecialBuild     : False
Language           : English (United States)
LegalCopyright     : Copyright © The Khronos Group Inc 2016
LegalTrademarks    :
OriginalFilename   : OpenCL.dll
PrivateBuild       :
ProductBuildPart   : 1
ProductMajorPart   : 2
ProductMinorPart   : 1
ProductName        : Khronos OpenCL ICD
ProductPrivatePart : 0
ProductVersion     :
SpecialBuild       :
PS C:\Users\yourname> get-filehash "C:\Windows\System32\OpenCL.dll"

Algorithm       Hash                                                                   Path
---------       ----                                                                   ----
SHA256          B15B388AEB74F9910537D83F3C44CFB4173459A28573D7391EBB0EACCA1EDE9B       C:\Windows\System32\OpenCL.dll

Speculation:

Depending on which sample, it's plausible that error codes on clGetDeviceIDs(...) (Reference) is expected behavior as the system software is configured. Samples may show interrogation and device selection in different ways...  As an example, by using device attainment function calls like clGetDeviceIDs(...) to select a class of device that may not exist on a platform. If the function selects a device_type for a device that doesn't exist for a particular platform and error will result.

In the Windows* 10 environment please consider the templates in the SDK VS plugin as helloworld samples per the guidance article. The Linux  version includes samples that may emit return error codes because CPU and iGFX present different platforms through the ICD Loader runtime (OpenCL.dll) in the linux environment. iGFX driver CPU & iGFX combination deployments in Windows* 10 emit the same platform.

If the system is configured with platforms that a sample doesn't look for, interrogation routines may emit error codes as well when selecting a device.

Stick with the OpenCL* CPU & iGFX combo implementation included with the gfx driver for Windows* OS if you have iGFX. Do not use the standalone for that configuration.

 

On the VS integration sighting:

Can you post a screen shot of how it breaks...? Perhaps not based on the symptom as described. Continual restarting isn't something I've come across before... 

By which mechanism did you disable it?

Can you post the install logs and VS logs to this thread for our review? How did you obtain and deploy the SDK? Which version is it?

  • Install logs are located in %TEMP%/pset_<generated_tag> directory.
  • VS logs are in %APPDATA%\Microsoft\VisualStudio\<version_of_vs>

The VS integration has some nice features to isolate kernel development from host side boilerplate code before it's necessary. The templates are nice for managing builds.

I hope this helps get you to deploying and exploring.

-MichaelC

Chizhov__Vassillen
406 Views

Hi Michael,

The samples that I am referring to can be found here (under Code Samples at the bottom): https://software.intel.com/en-us/opencl-sdk/training
I am referring specifically to the 1.2 samples, but the same applies to the 2.0 samples in my case. Every project except for CapsBasic (which only queries information about the platforms/devices) fails at context creation if the Intel CPU is used, with the error CL_INVALID_PLATFORM. Note that all projects work fine when run with the corresponding Intel iGPU or my discrete NVIDIA GPU. My goal is to be able to also use the CPU with OpenCL. 


The Intel graphics driver version is: 22.20.16.4749. I believe I can try and install the newest one, but I will have to do so manually since the standard installer refuses to install it with a message about my machine manufacturer. I've done that previously on other machines, but it sometimes breaks Nvidia's optimus, so if there are no better solutions I will try that.

As for the data, the CPU is i5 7300HQ, and the driver is the one mentioned above. The operating system is Windows 10, Version 1803. I was using Visual Studio 2017 with the samples. I highly doubt it's the compiler or anything related, I suspect it's the OpenCL runtime or the drivers.

I stepped through the code and I get CL_INVALID_PLATFORM at context creation. Here is the power shell info:

FileVersionRaw     : 2.2.1.0
ProductVersionRaw  : 2.2.1.0
Comments           :
CompanyName        : Khronos Group
FileBuildPart      : 1
FileDescription    : OpenCL Client DLL
FileMajorPart      : 2
FileMinorPart      : 2
FileName           : C:\Windows\System32\OpenCL.dll
FilePrivatePart    : 0
FileVersion        : 2.2.1.0
InternalName       : OpenCL
IsDebug            : False
IsPatched          : False
IsPrivateBuild     : False
IsPreRelease       : False
IsSpecialBuild     : False
Language           : English (United States)
LegalCopyright     : Copyright © The Khronos Group Inc 2016
LegalTrademarks    :
OriginalFilename   : OpenCL.dll
PrivateBuild       :
ProductBuildPart   : 1
ProductMajorPart   : 2
ProductMinorPart   : 2
ProductName        : Khronos OpenCL ICD
ProductPrivatePart : 0
ProductVersion     :
SpecialBuild       :
Algorithm       Hash                                                                   Path
---------       ----                                                                   ----
SHA256          7837FF537A68F27DC0F50EA399B6BEFC012D29ED8EEA178851C3B61838C81F69       C:\Windows\System32\OpenCL.dll

I am unsure whether this will prove useful, but here's a dump from clinfo( https://github.com/Oblomov/clinfo ): https://pastebin.com/04KsTFRi

As for the Visual Studio 2017 integration: After installing the SDK (ver 2019.4.299), the extension CodeBuilderSessionManager in Visual Studio appeared. I tried working on some projects after that but Visual Studio kept restarting. I restarted my PC a few times trying to understand what was wrong, but this didn't help. Finally Visual Studio 2017 was notifying me that the above extension is slowing down VS, so I decided to disabl it just in case, which fixed all of my issues regarding Visual Studio 2017 restarting. The Visual Studio 2017 version I have is 15.9.2. I have attached the logs below.

Thank you for looking into this.

Michael_C_Intel1
Moderator
406 Views

VassillenC,

Thanks for sending the info...

Haven't had a chance to review your collateral yet, but that's a fairly old driver w.r.t. related developer tools products. Can you share the system vendor and/or system model as configured? The downloadcenter.intel.com packages may stop if they detect a system where the vendor driver package is needed. To clarify, are you saying you experienced a conflict with an updated iGFX driver from the vendor? This is in addition to the downloadcenter.intel.com package aborting? Is this correct?

Thanks,

-MichaelC

 

Chizhov__Vassillen
406 Views

Hi Michael,

My laptop is a Nitro AN515-51, the official product page doesn't provide any more recent version unfortunately. However, I have previously manually updated the drivers on another laptop (the worst that had happened was Optimus breaking, but I somehow fixed it at some point). If the driver that I have is indeed very old and that is the problem, I guess I'll try my luck with manually updating the driver, and I'll see if that solves the CPU OpenCL issues.
As for the other questions, I have attached the error message I get when I try running igfx_win10_100.6912.exe. I'll just try to use the .zip version and hope it doesn't break Optimus.

Thank you for your cooperation.

Edit: I installed the driver manually, and all the samples work great now, it also doesn't seem to be conflicting with Optimus (at least from what I could see). I still have 3 Intel OpenCL platforms showing up, but that's only a minor issue. Thank you for the help.

 

Michael_C_Intel1
Moderator
406 Views

Hi VassillenC,

Thanks for the feedback.

On the driver:

The Intel first party package will disable when the vendor configuration expects the vendor driver. Vendor driver usage may be tied to certain amounts of support or vendor service with the system.

I recommend contacting the vendor to request they update that package to repackage something more recent from Intel...

I'll see what I can do from my side as well to encourage the vendor... Vendors have a base Intel reference that they deliver against. Windows* 10 changed a lot of it's driver infrastructure toward the end of last year to their 'DCH' driver framework. The driver package on your system is prior to the change.

Another option could be to temporarily remove the graphics driver. Then the standalone CPU RT package from Intel may be deployed. This could either be obtained from Intel registration center website or from the SDK tools installer.

On the looping:

Will need to follow up on this a little later.

On the source error codes:

Will need to follow up on this a little later as well.

 

-MichaelC

Michael_C_Intel1
Moderator
406 Views

All,

Some lean feedback for users who may be browsing the thread.

Driver package stakeholders suggested an older Windows* 10 OS version i.e. RS1 or RS2 may result in a conflict with newer driver packages.

It may be beneficial for users with Windows* 10 OS to move to a more recent update of Windows* 10 OS. The original poster indicated the platform was OS build 1803.

 

Thanks,

-MichaelC

Reply