Here's what you can do with OpenCL directly in MetaTrader 5 without any DLLs - page 14

 
kaus_bonus:


If you get an error when registering, check your email anyway.

When registering it says "Invalid format" when entering any kind of password

here's the link, it's 300mb, it takes a long time to drag and drop. it might work without cookies.

http://registrationcenter-download.intel.com/akdlm/irc_nas/vcp/11058/intel_sdk_for_opencl_setup_6.3.0.1904.exe

It's pulling out, thanks!
 
After removing the Intel SDK for OpenCL Applications a new device appeared
OpenCL  Device #0:  CPU GenuineIntel  Intel(R) Core(TM) i7-2700 K CPU @ 3.50 GHz with OpenCL 1.1 (8 units, 3510 MHz, 16301 Mb, version 2.0, rating 25)
OpenCL  Device #1:  CPU Intel(R) Corporation  Intel(R) Core(TM) i7-2700 K CPU @ 3.50 GHz with OpenCL 2.1 (8 units, 3500 MHz, 16301 Mb, version 6.3.0.1904)

But the error remains

OpenCL not found. Error code=5114
 
fxsaber:
After installing Intel SDK for OpenCL Applications there is a new device

But the error remains

By the way, new error codes have been added - Runtime errors

ERR_MATH_OVERFLOW

4019

An overflow occurred while calculating a math function


ERR_GLOBALVARIABLE_NOT_MODIFIED

4503

No global variable modifications were made

ERR_GLOBALVARIABLE_CANNOTREAD

4504

Failed to open and read file with global variable values

ERR_GLOBALVARIABLE_CANNOTWRITE

4505

Failed to write file with global variable values


ERR_TRADE_CALC_FAILED

4758

Failed to compute profit or margin


ERR_STRING_ARRAY_ONLY

5063

Must be an array of type string


ERR_OPENCL_TOO_MANY_OBJECTS

5113

Maximal number of OpenCL objects exceeded

ERR_OPENCL_SELECTDEVICE

5114

OpenCL device selection error

 
Rashid Umarov:

By the way, new error codes have been added - Execution time errors

There are not enough examples that generate each type of error.
 
Rashid Umarov:
Correct the Help for the case where the CLContextCreate input parameter is not set explicitly.
Документация по MQL5: Работа с OpenCL / CLContextCreate
Документация по MQL5: Работа с OpenCL / CLContextCreate
  • www.mql5.com
Работа с OpenCL / CLContextCreate - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 

The bug is still not fixed -Intel's processor-integrated graphics IGPs are not selected in context as the only GPU device with a filter by device type:

CLContextCreate(CL_USE_GPU_ONLY)
или
CLContextCreate()
Scripts script Seascape (GBPUSD,H1) loaded successfully
OpenCL  device #0: GPU Intel(R) Corporation Intel(R) HD Graphics 4400 with OpenCL 1.2 (20 units, 400 MHz, 1425 Mb, version 10.18.14.5117)
OpenCL  device #1: CPU Intel(R) Corporation Intel(R) Core(TM) i7-4500 U CPU @ 1.80 GHz with OpenCL 1.2 (4 units, 1800 MHz, 8087 Mb, version 4.2.0.148, rating 67)
OpenCL  device performance test started
OpenCL  device #0 performance test error: 'cannot create OpenCL program (5105)'
OpenCL  device performance test finished with error(s)
OpenCL  device #0: GPU Intel(R) Corporation Intel(R) HD Graphics 4400 with OpenCL 1.2 (20 units, 400 MHz, 1425 Mb, version 10.18.14.5117)
OpenCL  device #1: CPU Intel(R) Corporation Intel(R) Core(TM) i7-4500 U CPU @ 1.80 GHz with OpenCL 1.2 (4 units, 1800 MHz, 8087 Mb, version 4.2.0.148, rating 67)
Scripts script Seascape (GBPUSD,H1) removed

Funnily enough, at the same point, Print gives a different error code:

Seascape (GBPUSD,H1)    OpenCL not found. Error=5114

If you set the device explicitly:

CLContextCreate(0)

or like this

   long dCount = CLGetInfoInteger(0,CL_DEVICE_COUNT);
   for(int i = 0; i<dCount; i++)
     {
      int clCtx=CLContextCreate(i);

then everything works - the graphics coprocessor works up a sweat, including admitting that it is a graphics coprocessor:

0: Intel(R) HD Graphics 4400
OpenCL platform ver: OpenCL 1.2 
OpenCL platform profile: FULL_PROFILE
OpenCL device name: Intel(R) HD Graphics 4400
OpenCL device profile: FULL_PROFILE
OpenCL device ver: OpenCL 1.2 
OpenCL open c ver: OpenCL C 1.2 
OpenCL type: CL_DEVICE_GPU

Maybe the key letter in this case according to OpenCL 1.2 specification is device(s)? I.e. the MQL5 wrapper will probably return an array of GPU devices filtered byCL_DEVICE_TYPE_GPU typerather than a single device?

We should fix to a close to the specification implementation - select all devices of the given type in the context and introduce one more function similar toclGetContextInfo(,CL_CONTEXT_NUM_DEVICES,). After all, people may have a farm of several GPUs doing different kinds of tasks.

UPD: I have one more suggestion - maybe the problem is that no rating is defined for an IGP and MQL5 cannot pick the GPU device with the highest rating?

By the way, what is the criterion used to determine this coolness (rating)? GPU frequency * number of units?

clCreateContextFromType
  • www.khronos.org
clCreateContextFromType. Create an OpenCL context from a device type that identifies the specific device(s) to use.
 
aim-1:

The bug is still not fixed -Intel processor-integrated graphics IGPs are not selected in context as the only GPU device with a filter by device type:


Thanks, will figure it out now.

Checked on laptop by disabling Nvidia:

device #0:  GPU NVIDIA Corporation GeForce GTX 1050 Ti with Max-Q Design with OpenCL 1.2 (6 units, 1417 MHz, 4096 Mb, version 442.70, rating 101)
device #1:  GPU Intel(R) Corporation Intel(R) UHD Graphics 630 with OpenCL 2.1 (24 units, 1200 MHz, 13014 Mb, version 26.20.100.7985, rating 73)

After disabling, it automatically finds the embedded GPU and works:

OpenCL.Seascape (GBPUSD,M30)    OpenCL: GPU device 'Intel(R) UHD Graphics 630' selected


Note that your version of the Intel drivers is 10.18.14.511 and mine is 26.20.100.7985

I recommend that you update all drivers, put all updates on the operating system and try again.
 
aim-1:

The bug is still not fixed -Intel processor-integrated graphics IGPs are not selected in context as a single GPU device with a device type filter:

Please do the following:

  1. Close the Terminal
  2. Remove OpenCL from "HKEY_CURRENT_USER\Software\MetaQuotes Software" registry hive
  3. Start the terminal and test


After that, check terminal log for OpenCL errors

For example:

OpenCL device N performance test error: 'error text'

or

OpenCL device N performance test failed


You should check for updates of your Intel video driver

Запуск платформы - Для продвинутых пользователей - Справка по MetaTrader 5
Запуск платформы - Для продвинутых пользователей - Справка по MetaTrader 5
  • www.metatrader5.com
По завершении установки в меню "Пуск" создается группа программ торговой платформы, а на рабочем столе дополнительно помещается ярлык программы. Используйте их для запуска. Нельзя запускать одновременно две копии платформы из одной директории. Чтобы одновременно запустить несколько копий, установите соответствующее количество программ в разные...
 
Renat Fatkhullin:

Please note that your version of the Intel drivers is 10.18.14.511 and mine is 26.20.100.7985

I recommend to update all drivers, put all operating system updates and try again.

Thanks for the prompt support, Renat!

Of course, OpenCL subject is very tasty and it motivates me to go to MQL5, especially as there is already a lot of good material on this topic in the MQL5.com Articles.

The usual cleanliness on the subject of updates before the Compline has been observed, of course. Today I spent the whole night trying to figure out the drivers and SDK.

The Intel website for this stone (IGP) installed the latest (from 25.11.2019 at Q3'13 release, your CPU generation drivers), i.e. both CPU and GPU are supported. CPU only runtime removed before, registry in Khronos branches cleaned.

The original Intel SDK for OpenCL Applications 2016 R2 which last supported Windows 8.1 and GPUs of this Intel 4th Generation Core CPUs is no longer available on the Intel website. If you know where I can download it virus free, I would appreciate it.

But runtime should also work normally, which it does. The GPU is visible both through MQL5 info commands (see above) when selecting it explicitly in CLContextCreate and through EA SeaScape speed. Also no errors are displayed in logs.

I will try to open your registry branch later in the evening after work and use a special startup to play with it, but absence of MQL5 rating assigned to my GPU is the reason for its elimination according to the CL_USE_GPU_ONLY filter beauty contest algorithm.

 
aim-1:

Thank you for your prompt support, Renat!

Of course, OpenCL topic is very tasty and it motivates me to go to MQL5, especially as there is already a lot of good material on this topic in MQL5.com Articles.

The usual cleanliness on the subject of updates before the Compline has been observed, of course. Today I spent the whole night trying to figure out the drivers and SDK.

The Intel website for this stone (IGP) installed the latest (from 25.11.2019 at Q3'13 release, your CPU generation drivers), i.e. both CPU and GPU are supported. CPU only runtime removed before, registry in Khronos branches cleaned.

The original Intel SDK for OpenCL Applications 2016 R2 which last supported Windows 8.1 and GPUs of this Intel 4th Generation Core CPUs is no longer available on the Intel website. If you know where I can download it virus free, I would appreciate it.

But runtime should also work normally, which it does. The GPU is visible both through MQL5 info commands (see above) when selecting it explicitly in CLContextCreate and through the speed of EA SeaScape.

I'll try to open your registry branch later in the evening after work and use a special startup to play, but imho the absence of my GPU rating assigned by MQL5 is the reason for its elimination according to the beauty contest algorithm through the CL_USE_GPU_ONLY filter.

For our part, we will also take a look and add more logs.