I am trying to know how to activate/access AMD GPU for OpenCL applications and CodeXL when it is not connected to any display.
In other words, I want to use AMD GPU as a dedicated compute device while integrated Intel GPU is in charge of display (and X window).
(1) I have two monitors. All of them have been connected to integrated GPU.
(2) I've installed "AMD Radeon Software Crimson Edition Proprietary Ubuntu Graphics Driver" by using dpkg -i
(3) However, after rebooting, what I can see through my monitors is just blank screen. (At least, during booting, I can see something including Ubuntu logo...)
Please let me know what I need to to fix this issue. I attach my system environment and contents of xorg.conf
My system environment includes the followings:
- Ubuntu 14.04 LTS
- Intel Core i7-4470 CPU
- AMD Radeon R9 Fury X
Contents of xorg.conf
1 Section "ServerLayout"
2 Identifier "amd-layout"
3 Screen 0 "amd-screen" 0 0
6 Section "Device"
7 Identifier "intel"
8 Driver "intel"
9 Option "AccelMethod" "uxa"
10 BusID "PCI:0@0:2:0"
13 Section "Device"
14 Identifier "amd-device"
15 Driver "fglrx"
16 BusID "PCI:1:0:0"
19 Section "Monitor"
20 Identifier "amd-monitor"
21 Option "VendorName" "ATI Proprietary Driver"
22 Option "ModelName" "Generic Autodetecting Monitor"
23 Option "DPMS" "true"
26 Section "Screen"
27 Identifier "amd-screen"
28 Device "amd-device"
29 Monitor "amd-monitor"
30 DefaultDepth 24
31 SubSection "Display"
32 Viewport 0 0
33 Depth 24
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 😞