In the most cases second X server is not required to using and running OpenCL apps. Just same OpenCL from drivers is working without X server, without any envvars setting.
I am running second AMD graphics card by second X server by using simple script, that switch GLX libraries before running second X server. To run painlessly second X server I added options '-sharevts' to sharing single linux console and allowing to using two X server simultaneously. Ofcourse second X server shares this same linux console (vt) like IGP X server. Some stuff is need to be added to X server config:
Option "AllowMosuseOpenFail" "true"
Option "AutoEnableDevices" "false"
Option "DontVTSwitch" "true"
Option "DontZap" "true"
After adding that lines to original xorg.config generated by AMD drivers, we can run second X server. I run server by command:
nohup X -config /etc/X11/xorg.conf.fglrx -sharevts :1 vt7&
EDIT: I am running that command (from script) when I am working on the graphics mode (first X server) from X terminal. When X server running, any switching between linux consoles causes the stopping of the
second X server and the OpenCL apps, so you should not do this operation.
before that you must switch GLX libraries to AMD version:
and switch back to intel, after X server running:
If you would like to use OpenCL via X server, just try to run second X server.
I am using that config due to problems with stability (often crashes/freezes) while AMD GPU was doing some heavy computations and desktop was running on the same GPU.
I appreciate for your response.
However, I am not sure how it can be applied to my problem...
My biggest problem is that I can see nothing (only blank black screen...) when I connect my monitors to Intel iGPU.
(It normally works only when I don't install AMD graphic driver. However, in this case, obviosuly, my AMD GPU is not activated/enabled)
As a result, I have no choice but to connect one of the monitors to AMD graphics card(Even in this case, I have one blank screended monitor connected to iGPU).
In this situation, If I follow your advices, can this problem be solved? More specifically, should the discrete GPU only for OpenCL should be connected to x server?
In my understanding, procedure you specify includes following, correct?
(1) add "ServerFlags" stuffs in "/etc/X11/xorg.conf" (I assume this is automatically genrated by AMD driver and correponds to what I attached)
(2) switch GLX libraries to AMD version
(3) run secondary X server by using the config described in (1)
(4) switch back GLX libraries to intel
Ofcourse, procedure is exactly in that order. I had similar problem when I selected manually graphic driver for intel (just adding line 'Driver "intel") in X server configuration. You can try to choose other driver or do not choose any driver giving to X server ability to detect your IGP.
Hmm...when two monitors are connected to Intel iGPU, at first, I can only see blank black screen before I press ctrl + alt + F1.
The second problem is that any changes to xorg.conf is undone to the default config I attached above after rebooting...(perhaps by AMD driver?)
That sounds more like a Linux administration question than an ocl one:
1) You should check with dmesg and /var/log/syslog for what device is loaded at boot time.
2) From your console check with lsmod which modules are loaded by your kernel after booting.
If the intel video module is loaded and your Xorg.conf is right, you should get your display. You can always blacklist conflicting modules, no need to install/uninstall each time messing your Xorg.conf :-(