Project

General

Profile

Fosphor » History » Version 57

ahuemer, 02/19/2016 10:50 PM
Specify build dependencies

1 1
= gr-fosphor
2
3 51
GNU Radio block for RTSA-like spectrum visualization using OpenCL and OpenGL acceleration.
4 1
5
http://git.osmocom.org/gr-fosphor/
6
7 51
The block has been used successfully on Linux, OSX and Windows.
8
9 21 horiz0n
== Building
10
11 40
Warning: Mixed prefix install is not supported. You need to install gr-fosphor in the same prefix as your GNU Radio install. If you used build-gnuradio this will be /usr/local and this is what's used in the instructions below. If you use a packaged version of GNU Radio, it's most likely /usr and the best way is then to make a package for gr-fosphor for your distribution.
12 1
13 51
=== OS specific notes
14
15
- For OSX you probably just want to use the gr-fosphor [https://trac.macports.org/browser/trunk/dports/science/gr-fosphor/Portfile port in macports]
16 52
- For Windows you can't use the Visual C++ compiler due to some C99 constructs used in the code that it doesn't support (I mean, it's only been 15 years, you can't expect microsoft to support that bleeding edge stuff). You can use ICC or compile the C part manually using clang. It has been done, so it's possible albeit not trivial.
17 51
18 21 horiz0n
=== GLFW3
19
20
Install dependencies
21
22
{{{
23 24 horiz0n
sudo apt-get install cmake xorg-dev libglu1-mesa-dev
24
}}}
25
26 21 horiz0n
Build GLFW
27
28
{{{
29
git clone https://github.com/glfw/glfw
30
cd glfw
31
mkdir build
32
cd build
33 1
cmake ../ -DBUILD_SHARED_LIBS=true
34 21 horiz0n
make
35 1
sudo make install
36
sudo ldconfig
37
}}}
38
39 51
=== OpenCL
40 25 horiz0n
41 51
To run fosphor, you need an OpenCL implementation. This can be either a GPU implementation (which will often be the faster option), or a CPU implementation. If available, fosphor will also make use of the CL/GL sharing extension allowing to transfer data efficiently between the OpenCL compute kernels and the OpenGL rendering.
42 1
43 51
All the implementations listed below have been successfully used with fosphor.
44 1
45 51
==== NVidia OpenCL
46
47
The NVidia implementation is provided by the binary drivers and support CL/GL sharing very well. Unfortunately the 'nouveau' open-source drivers don't provide OpenCL yet.
48
49 25 horiz0n
 * install [http://www.nvidia.com/object/unix.html NVidia drivers]
50
51 1
{{{
52
sudo apt-get install nvidia-opencl-dev opencl-headers
53 26 horiz0n
}}}
54 1
55 54
For modern version of the distribution / drivers, you might also need :
56
57
{{{
58
sudo apt-get install nvidia-modprobe
59
}}}
60
61 25 horiz0n
62 51
==== AMD GPU OpenCL
63
64 53 horiz0n
 * install [http://support.amd.com/en-us/download AMD drivers] (13.4, 13.11 beta6, 13.12, 14.10 and 14.12 drivers are known to work on linux)
65 1
 * install [http://developer.amd.com/tools-and-sdks/heterogeneous-computing/amd-accelerated-parallel-processing-app-sdk/ AMD APP SDK]
66
67
68 51
==== Intel GPU OpenCL
69 1
70 51
 * fosphor has been confirmed to work with Iris graphics on OSX.
71
 * It also has been used on linux using the [http://www.freedesktop.org/wiki/Software/Beignet/ beignet opencl]
72
  * It doesn't support CL/GL sharing though, even if you're using the Intel GPU for display
73
  * Performance was disappointing on linux though, there seem to be an unidentified bottleneck.
74
75
76
==== Intel CPU OpenCL
77
78
Intel offers a CPU OpenCL implementation. You need a CPU capable of at least SSE 4.2 to be able to use it. This implementation has been confirmed working with fosphor and is the highest performance of all the CPU OpenCL implementation.
79
80
See [https://software.intel.com/en-us/vcsource/tools/opencl-sdk this page]
81 56 ahuemer
82
83
===== Installation instructions
84
85
Download the latest OpenCL runtime from [https://software.intel.com/en-us/articles/opencl-drivers intel.com].
86
87
In November 2015 it was opencl_runtime_14.2_x64_4.5.0.8.tgz.
88
89
That archive contains a rpm subdirectory with several .rpm files.
90
91
Extract the content of the following files, e.g. by first converting them to a .tgz with alien(1) to be able to then use tar(1).
92
93
Then selectively install parts of the content of those archives in your system.
94
95
{{{
96
$ mkdir $HOME/tmp
97
$ cd $HOME/tmp
98
$ wget http://registrationcenter.intel.com/irc_nas/4181/opencl_runtime_14.2_x64_4.5.0.8.tgz
99
$ tar xf opencl_runtime_14.2_x64_4.5.0.8.tgz
100
$ cd pset_opencl_runtime_14.1_x64_4.5.0.8/rpm
101
$ alien --to-tgz opencl-1.2-base-pset-4.5.0.8-1.noarch.rpm
102
$ tar xf opencl-1.2-base-4.5.0.8.tgz
103
$ sudo mv /opt/intel /opt
104
$ rm -rf opt
105
$ alien --to-tgz opencl-1.2-intel-cpu-4.5.0.8-1.x86_64.rpm
106
$ tar xf opencl-1.2-intel-cpu-4.5.0.8.tgz
107
$ sudo mkdir -p /etc/OpenCL/vendors
108
$ sudo mv opt/intel/opencl-1.2-4.5.0.8/etc/intel64.icd /etc/OpenCL/vendors/
109
$ sudo mv opt/intel/opencl-1.2-4.5.0.8/lib64/* /opt/intel/opencl-1.2-4.5.0.8/lib64/
110
$ rm -rf opt
111
}}}
112 51
113
==== AMD CPU OpenCL
114
115
AMD also has a CPU OpenCL implementation see [http://developer.amd.com/tools-and-sdks/opencl-zone/ this page] for details. It's not quite as fast as the Intel one, but it doesn't require SSE 4.2 which allows it to be used on older processors.
116
117
118
==== pocl
119
120
[http://portablecl.org/]
121
122
This is a free-software OpenCL CPU implementation. It's not where as performant as the Intel/AMD ones, but it's opensource and supported on any platform.
123
124
Note that at the time of writing, you need the git version to use fosphor with it due to a very recently fixed memory leak that fosphor triggers.
125
126
127
==== FreeOCL
128
129
[http://code.google.com/p/freeocl/]
130
131
This is another free-software OpenCL CPU implementation that's also been verified to work with fosphor. It uses whatever C++ compiler is installed on the system as the code generation backend.
132
133
Again, at the time of writing, you need the latest SVN version to use fosphor with it due to some recently fixed bugs that fosphor triggers.
134
135
136
=== gr-fosphor
137
138 25 horiz0n
Build gr-fosphor
139
140 57 ahuemer
Build dependencies: gnuradio-dev, opencl-headers, libboost-system-dev, libboost-thread-dev.
141
142 21 horiz0n
{{{
143
git clone git://git.osmocom.org/gr-fosphor
144
cd gr-fosphor
145
mkdir build
146 37
cd build
147 21 horiz0n
cmake ..
148
make
149
sudo make install
150
sudo ldconfig
151
}}}
152 1
153
Build benchmark tool
154 21 horiz0n
155 57 ahuemer
Build dependencies: libglfw3-dev.
156
157 21 horiz0n
{{{
158 1
cd gr-fosphor/lib/fosphor
159 57 ahuemer
make LDFLAGS=-L/opt/intel/opencl-1.2-4.5.0.8/lib64
160 25 horiz0n
}}}
161
162 21 horiz0n
Fosphor is known to build successfully on Linux, OSX and Windows.
163 46
164
==== Known issues
165 1
166 47 horiz0n
 * Some version of ubuntu (like 13.10) have screwed up OpenCL dev files setup and it might be required to manually specify a path to the actual OpenCL library during the cmake step ( like {{{-DOPENCL_LIBRARY=/usr/lib/nvidia-304/libOpenCL.so}}} )
167 46
 * When running python flowgraphs on machines with AMD graphics (fglrx driver) and UHD enabled in gr-osmosdr you may experience the following error {{{[!] CL Error (-1001, fosphor/cl.c:268): Unable to fetch platform IDs}}}. This is due to TLS sections in both, AMD OpenCL library and UHD library interfering with each other. A workaround is available through preloading the AMD OpenCL library {{{LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libamdocl64.so osmocom_fft -F}}} (path may vary). C++ flowgraphs are not affected.
168 2
169
== Screenshots
170 15
171
=== Short video examples
172
173
http://www.youtube.com/watch?v=mjD-l3GAghU
174 1
175
{{{
176
#!html
177 15
<iframe width="960" height="720" src="http://www.youtube.com/embed/mjD-l3GAghU" frameborder="0" allowfullscreen></iframe>
178
}}}
179
180
181
=== osmocom_fft in fosphor mode
182
183 51
Those are when enabling the integrated 'fosphor' mode of osmocom_fft through the -F command line option
184
185
[[Image(GrOsmoSDR:fosphor.png)]]
186 2
[[Image(GrOsmoSDR:fosphor2.png)]]
187 3 horiz0n
188
== Bandwidth figures
189
190
There's a benchmark program available which allows to estimate the maximal bandwidth that can be processed with a specific GPU.
191
192
To build it:
193
194
{{{
195
cd gr-fosphor/lib/fosphor
196
make
197
}}}
198
199
Then execute it by providing a prerecorded complex float file (a couple of 100MB should be fine) in gnuradio format.
200
201
{{{
202
./main some.cfile
203
}}}
204
205 14 horiz0n
Try to leave the window to its default size if possible and watch out for the Msps numbers printed out to the console.
206
207
Submit your numbers & help us to create a GPU survey. We are especially interested in the top end and mobile graphics figures.
208 3 horiz0n
209 8
||'''CPU'''||'''GPU'''||'''Msps'''||
210 31 horiz0n
||?||AMD R290(X)||WANTED||
211 8
||?||NVidia Titan||WANTED||
212 42 horiz0n
||i7-4770K 3.5 GHz||NVidia !GeForce GTX 760||~228||
213 1
||?||AMD Radeon HD 7970 (Tahiti)||~220||
214 41 horiz0n
||i5-3570K 3.4 GHz||AMD Radeon HD 7870 (Tahiti)||~220||
215 40
||i7-3770K 3.4 GHz||Nvidia GTX 660||~202||
216
||i7-3770K 3.4 Ghz||Nvidia GTX 760||~191||
217 39 ttsou
||i7-4770K 3.5 GHz||Nvidia GTX 650 Ti Boost||~188||
218 49
||i5-2500 3.3 GHz||NVidia GTX 460 SE||~129||
219 28 horiz0n
||i5-3570K 3.4GHz||AMD Radeon HD 7870 (Pitcairn)||~112||
220 29 horiz0n
||i5-2500 3.3GHz||NVidia GTX 550 Ti||~110||
221 28 horiz0n
||i5-2500k 3.8GHz||AMD Radeon HD 6850||~100||
222 1
||?||NVidia GTX 550 Ti||~97||
223 28 horiz0n
||QC Xeon 2 GHz||Nvidia !GeForce 560 Ti||~73||
224 42 horiz0n
||C2D 2.66 GHz||NVidia !GeForce GT 640 (GK107)||~67||
225 44
||i5 2.4 GHz||Intel Iris Pro 5100||~65||
226 48
||i7-3610QM||NVidia !GeForce GT 640M LE||~63||
227 42 horiz0n
||i7-950 3.06 GHz||NVidia GT9800||~61||
228
||i5-2500K 4.2 GHz||AMD Radeon HD 6570||~58||
229 30 horiz0n
||C2D 3.00GHz||NVidia !GeForce 9800 GT||~47||
230 43
||i5-2520M 2.5 GHz||NVidia GF119M||~46||
231 28 horiz0n
||C2D 2.4GHz||NVidia 9600M GT||~31||
232 55 horiz0n
||i5-3320M||Intel CPU OpenCL||~24||
233 28 horiz0n
||?||NVidia GT330M||~22||
234
||?||NVidia 8600GT||~15||
235
||C2D 2.2GHz||NVidia NVS 140M||~14||
236 1
||AMD E350 Fusion APU||AMD Radeon 6310||~12||
237 37
||C2Q Q9650 3.00GHz||!GeForce 9300 GE||~11||
238 28 horiz0n
||Atom 330||NVidia ION||~10||
Add picture from clipboard (Maximum size: 48.8 MB)