clGetPlatformIDs() crash

Hello! I work and study in CAE/mathematical modeling field. Now I’m trying to use OpenCL on my laptop. According to all the utilities I’ve tried I have no OpenCL support, although I know that it should have, at least early versions.

Laptop: HP Envy m6-1153er, Windows 8.1 64 bit;
Hardware: AMD Radeon HD 7670m; Intel HD Graphics 4000; Intel Core i5 CPU;
BIOS info: InsydeH20 Setup Utility Rev. 3.7; f.12;
The device manager recognizes both devices correctly (from the first glance). According to it both devices’ drivers are 8.982.10.6000 from AMD.

FurMark didn’t even recognize my dicrete card. It simply stated that I only have the Intel HD Graphics.
GPU Shark says the same.
GPU-Z tells me that I have both, but no OpenCL support on either of the devices. But on startup it emerges a message, saying that OpenCL lib call crashed while attempting to get OpenCL support info.
I’ve installed Intel SDK for OpenCL and AMD APP SDK one by one. I linked to the most obvious respective libs and included the most obvious headers.
But the following code crashes (see GPU-Z error):


cl_uint n_plats=0u;
cl_uint n_entries = 0u;
cl_platform_id plat_ids;
cl_int ret = clGetPlatformIDs(n_entries, &plat_ids, &n_plats);

I have been studying this problem for a week already and found some direct statements that it IS possible to use OpenCL on my Radeon card:
https://helpx.adobe.com/premiere-pro/system-requirements.html (Call me Mr. BrightSide, but I assume they should have tested it)
and
https://community.amd.com/thread/162244
The reasons I didn’t use the second advices are it’s not my computer they were talking about and as far as I know there exists quite a number of problems with [re|de]installing AMD drivers on Windows (Win 8.1 in particular) and especially on laptops with switchable graphics like mine (by the way I have never tried switchable thing out, so I don’t know if it works).

Anyway I would like to use OpenCL on this computer, so if anyone has some knowledge, please share it with me.

P.S. I don’t know if it’s of any importance but C++ AMP, for instance, recognizes Intel HD Graphics card well, but not the Radeon.

I assume clinfo does not recognize your GPU either? Did you run sample that come with both SDKs? The latest stable driver for your GPU is 15.7. It is your best bet to install it, otherwise not much can be done. You probably have to update Intel driver as well.
Anyway, what exactly do you mean by “use” OpenCL? Since, if you only need to write and test some code to deploy on a powerful machine, you’d better off with a CPU-based driver.

Hello, Salabar and thank you for your time. clinfo crashes))) just like GPU-Z or my simple programm. Just in case this way of using clGetPlatformIDs doesn’t look right you may rest assured I’ve tried all the others (e.g. clGetPlatformIDs(0,0,&n_plats)) and all other ways crashed too. I nay only assume it has to do with wrong linkage of dll.
Unfortunately I haven’t got any samples with AMD APP SDK.
I have indeed tried to install latest drivers but after it device manager ceased to recognized both the devices. It said they were both functioning incorrectly and had no idea what they were whatsoever. So after that experience I’ve just made a recovery. From what I’ve heard it’s a huge pain to change AMD drivers.
Well, of course, ideally I’d like to use the discrete Radeon video card since it’s not that weak in terms of performance. Even early versions of OpenCL supported would be nice and useful. Of course it’s mostly just for lols. But imagine if everyone owning a circa 2012 AMD video card would be absolutely isolated from OpenCL, that would be just insane. My friend has an NVidia from 2008 and OpenCL apps work pretty cool on it (and it has 32 cores or so). And by the way GPU-Z and other stuff have no problems with detecting its capabilities.

Oh well. Do any benchmarks\games run well, by the way? I can only suggest you to do the following: update the chipset driver of your motherboard, remove current graphics drivers using a program called DDU, update Intel graphics driver and install the legacy driver 15.7.1 for your AMD GPU. http://support.amd.com/en-us/download/desktop/legacy?product=legacy3&os=Windows+8.1+-+64
If the discrete card still won’t be detected, add this to the header:

__declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1; // Force high performance GPU for AMD systems

(Not sure if it actually does a thing for OpenCL though).

Unfortunately I haven’t got any samples with AMD APP SDK.

Are you sure? They go to C:\Users\USERNAME\AMD APP SDK\3.0 by default.

Unfortunately I’m not really into games, but couple of years ago I played GTA IV on this laptop (it was before updating to Win8.1) and I think maybe switchable graphics worked (because it ran smoother and with considerbaly higher FPS when connected to an outlet), but the overall perf was just ok, nothing surprisingly good or bad.
Sorry, to what header should I insert the code snippet you gave?
Yes, surprisingly I didn’t get the samples.
[ATTACH=CONFIG]130[/ATTACH]
OK, I’ll try reinstalling the drivers. But, first: will I be able to recover from whatever will be the consequences? Second: have you heard about unofficial leshcatlabs’ drivers that are a sort of optimized and bundled Intel+AMD drivers for laptops like mine with switchable grpahics, and if you have heard about them, can it work for me?

Sorry, to what header should I insert the code snippet you gave?

Your main.cpp is fine, I suppose. Then again, this is a hack Windows uses to load the correct d3d*.dll. OpenCL uses it’s own mechanism.

OK, I’ll try reinstalling the drivers. But, first: will I be able to recover from whatever will be the consequences?

Create a Windows recovery point and you should be fine. It never hurts to backup vital data, of course.

Does GPU-Z say either GPU can do OpenCL?
If clGetPlatformIDs is crashing, that’s a known issue; a bad OpenCL.dll. Back it up, delete it, and re-install your GPU driver which should put back a good one.

As stated above GPU-Z doesn’t find OpenCL on either of the devices.
Last week I’ve upgraded my AMD driver. The only consequences were: I downloaded Intel OpenCL SDK and wrote the program like above to check platforms and devices and it didn’t recognize either Radeon or Intel HD Graphics (only CPU), but recognized two platforms AMD APP and the Intel itself;
my computer was extremely hot and nearly left a burnt spot on the table (joking of course). I’ve just recovered and forgot about drivers installation without thinking things through first. Then after taking a deep breath I’ve installed AMD APP SDK and here I am with bad dlls or whatever.

SO.
I’ve done as you suggested. Restore point -> delete Intel drivers -> restore point -> delete AMD drivers -> install AMD APP SDK.

Device manager shows Intel HD Graphics 4000 and AMD Radeon HD 7600 series. More generic, but good enough for me.
C++ AMP recognizes only Intel HD accelerator, but when I started some compute-intensive apps on this accelerator and checked each device activity through GPU-Z the Radeon worked and not the Intel. So it seems to detect the right card through wrong “face”.
OpenCL API shows two platforms, one of which is AMD. This platform has a GPU device named “Turks”. Not sure what that means but seems to be Radeon (again checked its activity during the computation).
Switchable graphics seems to be back too. FurMark performs better and loads the right card (Radeon).

Anyway, Salabar, thank you very much for help and patience!!!
By the way, HP and AMD forums remained silent to my cry for help, so let Zeus strike them with lightnings!