hksonngan / mandelbulber

Automatically exported from code.google.com/p/mandelbulber
GNU General Public License v3.0
0 stars 0 forks source link

OpenCL platformIndex dropdownbox is ignored and hardcoded to 4 platforms #35

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Go to OpenCL Tab and choose another Platform Index than 0
2. Click OpenCL Enable
3. Notice it always uses platform number 0

What version of the product are you using? On what operating system?
1.21-1. Haven't tried 1.21-2 yet because linking is broken there.

Please provide any additional information below.
In cl_support.cpp I added this line

platformIndex = 
gtk_combo_box_get_active(GTK_COMBO_BOX(Interface.comboOpenCLPlatformIndex));

right before this line:

platformList[platformIndex].getInfo((cl_platform_info) CL_PLATFORM_VENDOR, 
&platformVendor);

and it then used the correct platform.

The dropbdownbox is hardcoded to show three entries. In interface.cpp it is 
hardcoded:
Interface.comboOpenCLPlatformIndex = gtk_combo_box_new_text();
gtk_combo_box_append_text(GTK_COMBO_BOX(Interface.comboOpenCLPlatformIndex), 
"0");
gtk_combo_box_append_text(GTK_COMBO_BOX(Interface.comboOpenCLPlatformIndex), 
"1");
gtk_combo_box_append_text(GTK_COMBO_BOX(Interface.comboOpenCLPlatformIndex), 
"2");
gtk_combo_box_append_text(GTK_COMBO_BOX(Interface.comboOpenCLPlatformIndex), 
"3");
gtk_combo_box_set_active(GTK_COMBO_BOX(Interface.comboOpenCLPlatformIndex), 0);

and never set to something else. It rould rather be filled with 0 to 
platformList.size()-1.

Original issue reported on code.google.com by haagch.c...@googlemail.com on 23 Aug 2014 at 10:59

GoogleCodeExporter commented 8 years ago
There was wrong sequence of commands.

folowing lines were moved to proper place:
useCPU = gtk_combo_box_get_active(GTK_COMBO_BOX(Interface.comboOpenCLGPUCPU));
deviceIndex = 
gtk_combo_box_get_active(GTK_COMBO_BOX(Interface.comboOpenCLDeviceIndex));
platformIndex = 
gtk_combo_box_get_active(GTK_COMBO_BOX(Interface.comboOpenCLPlatformIndex));

Original comment by buddhi1...@gmail.com on 23 Aug 2014 at 12:49

GoogleCodeExporter commented 8 years ago
Okay, that works.

But still, there are always 4 platforms in the dropdownbox in the gui. If you 
have 5 different platforms, you can't choose your last and if you have less 
than 4 and choose one index of a platform you don't have it segfaults.

I also believe each platform needs its own number of devices so if you change 
platforms, the devices dropdownbox should probably be reinitialized.

It would be easier too choose the correct platform if the dropdownboxes showed 
the platform name, instead of an index, but that is not so important.

I have seen this code here you can copy&paste for your convenience. :)
http://dhruba.name/2012/08/13/opencl-cookbook-listing-all-platforms-and-their-at
tributes/
http://dhruba.name/2012/08/14/opencl-cookbook-listing-all-devices-and-their-crit
ical-attributes/

Original comment by haagch.c...@googlemail.com on 24 Aug 2014 at 5:39

GoogleCodeExporter commented 8 years ago
Can you give me an example where there is needed more than 4 platforms? I 
haven't heard about any user who has more than three (nVidia, AMD, Intel) at 
the same machine.

By the way, I'm not developing mandelbulber v1 anymore. Now I'm focusing in 
Mandelbulber v2, which is completely rewritten. 
https://code.google.com/p/mandelbulber2/

Original comment by buddhi1...@gmail.com on 24 Aug 2014 at 6:58

GoogleCodeExporter commented 8 years ago

Original comment by buddhi1...@gmail.com on 24 Aug 2014 at 7:47

GoogleCodeExporter commented 8 years ago
Two different GPUs are not too uncommon laptops etc.

If you then have multiple different cpu implementations, it can get short. For 
example I already have three platforms on my laptop:

1. Device: AMD PITCAIRN
 1.1 Hardware version: OpenCL 1.1 MESA 10.4.0-devel
 1.2 Software version: 10.4.0-devel
 1.3 OpenCL C version: OpenCL C 1.1
 1.4 Parallel compute units: 20
1. Device:       Intel(R) Core(TM) i7-3632QM CPU @ 2.20GHz
 1.1 Hardware version: OpenCL 1.2 (Build 44)
 1.2 Software version: 1.2.0.44
 1.3 OpenCL C version: OpenCL C 1.2 
 1.4 Parallel compute units: 8
1. Device: Intel(R) HD Graphics IvyBridge M GT2
 1.1 Hardware version: OpenCL 1.2 beignet 0.9
 1.2 Software version: 0.9
 1.3 OpenCL C version: OpenCL C 1.2 beignet 0.9
 1.4 Parallel compute units: 16

But you are right, it's not so important because it will work for pretty much 
everyone, but maybe you think of it in mandelbulber2 if you haven't already.

Original comment by haagch.c...@googlemail.com on 24 Aug 2014 at 7:56