Discussion of article "How to Install and Use OpenCL for Calculations" - page 6

 

Can anyone have an update to include RX 580 / 570?

I have both cards, but don't have the cookbook for detailed instruction to leverage those cards.

Much appreciate it.

 
Currently I try to get OpenCL running on a GTX1070, but Metatrader doesn't mention the hardware nor I can activate it somewhere. How should it look like with the current MT5?
 
hao xue:

Can anyone have an update to include RX 580 / 570?

I have both cards, but don't have the cookbook for detailed instruction to leverage those cards.

Much appreciate it.

I don't know why terminal doesn't recognize the rx580, but opencl is working. You can try this code:

void OnStart()
  {
//---
   Print("TERMINAL_OPENCL_SUPPORT = ",TerminalInfoInteger(TERMINAL_OPENCL_SUPPORT));
   
   int cl_ctx; 
//--- initialize OpenCL context 
   if((cl_ctx=CLContextCreate(CL_USE_GPU_ONLY))==INVALID_HANDLE) 
     { 
      Print("OpenCL not found"); 
      return; 
     } 
//--- Display general information about OpenCL device 
   Print("OpenCL type: ",EnumToString((ENUM_CL_DEVICE_TYPE)CLGetInfoInteger(cl_ctx,CL_DEVICE_TYPE))); 
   Print("OpenCL vendor ID: ",CLGetInfoInteger(cl_ctx,CL_DEVICE_VENDOR_ID)); 
   Print("OpenCL units: ",CLGetInfoInteger(cl_ctx,CL_DEVICE_MAX_COMPUTE_UNITS)); 
   Print("OpenCL freq: ",CLGetInfoInteger(cl_ctx,CL_DEVICE_MAX_CLOCK_FREQUENCY)," MHz"); 
   Print("OpenCL global mem: ",CLGetInfoInteger(cl_ctx,CL_DEVICE_GLOBAL_MEM_SIZE)," bytes"); 
   Print("OpenCL local mem: ",CLGetInfoInteger(cl_ctx,CL_DEVICE_LOCAL_MEM_SIZE)," bytes"); 

  }
 

Hello All


I've tryed the code on lensflare on a computer with an AMD 530 and another with an NVIDEA gtx 1060 but without success. My EA report a 0 device supported. Did someone have the same problem? Thanks!


void OnStart()
  {
//---
   Print("TERMINAL_OPENCL_SUPPORT = ",TerminalInfoInteger(TERMINAL_OPENCL_SUPPORT));
   
   int cl_ctx; 
//--- initialize OpenCL context 
   if((cl_ctx=CLContextCreate(CL_USE_GPU_ONLY))==INVALID_HANDLE) 
     { 
      Print("OpenCL not found"); 
      return; 
     } 
//--- Display general information about OpenCL device 
   Print("OpenCL type: ",EnumToString((ENUM_CL_DEVICE_TYPE)CLGetInfoInteger(cl_ctx,CL_DEVICE_TYPE))); 
   Print("OpenCL vendor ID: ",CLGetInfoInteger(cl_ctx,CL_DEVICE_VENDOR_ID)); 
   Print("OpenCL units: ",CLGetInfoInteger(cl_ctx,CL_DEVICE_MAX_COMPUTE_UNITS)); 
   Print("OpenCL freq: ",CLGetInfoInteger(cl_ctx,CL_DEVICE_MAX_CLOCK_FREQUENCY)," MHz"); 
   Print("OpenCL global mem: ",CLGetInfoInteger(cl_ctx,CL_DEVICE_GLOBAL_MEM_SIZE)," bytes"); 
   Print("OpenCL local mem: ",CLGetInfoInteger(cl_ctx,CL_DEVICE_LOCAL_MEM_SIZE)," bytes"); 

  }
 

How can I select which openCL processor to use?
It seem that I have CPU + Nvidia +Intel, and according to main page, that the Intel GPU is faster.

Also, because my Nvidia run a little, and then crashes when I try to exit the EA.

 

>In order to demonstrate the advantage of using OpenCL in MQL5, the script OpenCL_Sample.mq5 was written, which calculates the values of a function from two variables on some set and displays the result in the chart window using a graphical label (OBJ_BITMAP_LABEL).

The example is interesting but stunningly useless.....

Can anyone make an example of optimising a standard Expert Advisor on OpenCL ....?

in general I think the article is nothing, the whole world is moving towards frameworks (like CNTK), a developer for MQL5 should write code in MQL5, not OpenCL/CUDA, and the cores (CU) of all video cards should be visible just as ordinary cores in the list of available cores for optimisation and that's it.

I think so ...

Документация по MQL5: Константы, перечисления и структуры / Константы объектов / Типы объектов / OBJ_BITMAP_LABEL
Документация по MQL5: Константы, перечисления и структуры / Константы объектов / Типы объектов / OBJ_BITMAP_LABEL
  • www.mql5.com
//| Создает объект "Графическая метка"                               |               chart_ID=0,                               sub_window=0,                             x=0,                                      y=0,                                      width=0,                                  height=0,                 ...
 
Boris Egorov:

MQL5 developer should write code in MQL5, not in OpenCL/CUDA, and the cores (CU) of all video cards should be visible just as ordinary cores in the list of available cores for optimisation and that's all

I think so ...

as if you were given the opportunity to write code in MQL5 and calculate tasks on GPU, why are you making noise?

Another question is that you do not realise what range of tasks can be solved on GPU, and which ones cannot.

Here is a good article, I read it myself at the beginning of the year https://habr.com/ru/company/combox/blog/425731/.

If you are able to parallelise an optimisation task, then use GPU.

 
Igor Makanu:

as if it were possible to write code in MQL5 and calculate tasks on GPU


just like it is done in python/#.

There is no OpenCL, there is a framework connection, you just tell it what to calculate on, so personally it is easier for me to build a farm from GPU than on CPU.

 
Boris Egorov:

just as it is done in python/#.

there is no OpenCL there, it's a framework connection

everything is correct and the framework is customised for GPU tasks, I tested tensorflow in this way.


then the question is not to MQL5, but to the creators of frameworks for MQL5 - alas, they (frameworks) do not exist, I suffer from this myself,

or rather, there are only a few - alglib in SB and many articles on integration with third-party languages.

i.e. as developers write - write it yourself, there are no ready-made solutions.

 
Igor Makanu:

Everything is correct and the framework is customised for GPU tasks, I tested tensorflow in this way.


then the question is not to MQL5, but to the creators of frameworks for MQL5 - alas, they (frameworks) do not exist, I suffer from this myself,

or rather, there are only a few - alglib in SB and a lot of articles on integration with third-party languages.

i.e. as developers write - write it yourself, there are no ready-made solutions.

not exactly like that.

The developers are good and have done a lot, they have implemented Fuzzy, Alglib, python but the question is why? Why did they spend such a valuable time of cool developers to implement all this, because in fact they are of no use.

Of course, we are talking about neural networks, Alglib is an extremely limited framework and if I'm not mistaken is not free, it is impossible to create a normal neural network on it even in theory.

I am not happy about python either ... well, just think how to transfer the logic of the EA to a completely different language .... and then back again .... correctly no way ... and what's the point of this haemorrhoid.

hence it was necessary to implement either cntk or tenzorflow from the beginning ... then you don't need a standard optimiser, you don't need a genetic algorithm and you can calculate on GPU without problems ...