Project

General

Profile

Fosphor » History » Version 55

horiz0n, 02/19/2016 10:50 PM

1 1 sylvain
= gr-fosphor
2 1 sylvain
3 51 sylvain
GNU Radio block for RTSA-like spectrum visualization using OpenCL and OpenGL acceleration.
4 1 sylvain
5 1 sylvain
http://git.osmocom.org/gr-fosphor/
6 1 sylvain
7 51 sylvain
The block has been used successfully on Linux, OSX and Windows.
8 51 sylvain
9 21 horiz0n
== Building
10 21 horiz0n
11 40 sylvain
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 sylvain
13 51 sylvain
=== OS specific notes
14 51 sylvain
15 51 sylvain
- 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 sylvain
- 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 sylvain
18 21 horiz0n
=== GLFW3
19 21 horiz0n
20 21 horiz0n
Install dependencies
21 21 horiz0n
22 21 horiz0n
{{{
23 24 horiz0n
sudo apt-get install cmake xorg-dev libglu1-mesa-dev
24 24 horiz0n
}}}
25 24 horiz0n
26 21 horiz0n
Build GLFW
27 21 horiz0n
28 21 horiz0n
{{{
29 21 horiz0n
git clone https://github.com/glfw/glfw
30 21 horiz0n
cd glfw
31 21 horiz0n
mkdir build
32 21 horiz0n
cd build
33 1 sylvain
cmake ../ -DBUILD_SHARED_LIBS=true
34 21 horiz0n
make
35 1 sylvain
sudo make install
36 1 sylvain
sudo ldconfig
37 1 sylvain
}}}
38 1 sylvain
39 51 sylvain
=== OpenCL
40 25 horiz0n
41 51 sylvain
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 sylvain
43 51 sylvain
All the implementations listed below have been successfully used with fosphor.
44 1 sylvain
45 51 sylvain
==== NVidia OpenCL
46 51 sylvain
47 51 sylvain
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 51 sylvain
49 25 horiz0n
 * install [http://www.nvidia.com/object/unix.html NVidia drivers]
50 25 horiz0n
51 1 sylvain
{{{
52 1 sylvain
sudo apt-get install nvidia-opencl-dev opencl-headers
53 26 horiz0n
}}}
54 1 sylvain
55 54 sylvain
For modern version of the distribution / drivers, you might also need :
56 54 sylvain
57 54 sylvain
{{{
58 54 sylvain
sudo apt-get install nvidia-modprobe
59 54 sylvain
}}}
60 54 sylvain
61 25 horiz0n
62 51 sylvain
==== AMD GPU OpenCL
63 51 sylvain
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 sylvain
 * install [http://developer.amd.com/tools-and-sdks/heterogeneous-computing/amd-accelerated-parallel-processing-app-sdk/ AMD APP SDK]
66 1 sylvain
67 1 sylvain
68 51 sylvain
==== Intel GPU OpenCL
69 1 sylvain
70 51 sylvain
 * fosphor has been confirmed to work with Iris graphics on OSX.
71 51 sylvain
 * It also has been used on linux using the [http://www.freedesktop.org/wiki/Software/Beignet/ beignet opencl]
72 51 sylvain
  * It doesn't support CL/GL sharing though, even if you're using the Intel GPU for display
73 51 sylvain
  * Performance was disappointing on linux though, there seem to be an unidentified bottleneck.
74 51 sylvain
75 51 sylvain
76 51 sylvain
==== Intel CPU OpenCL
77 51 sylvain
78 51 sylvain
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 51 sylvain
80 51 sylvain
See [https://software.intel.com/en-us/vcsource/tools/opencl-sdk this page]
81 51 sylvain
 
82 51 sylvain
83 51 sylvain
==== AMD CPU OpenCL
84 51 sylvain
85 51 sylvain
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.
86 51 sylvain
87 51 sylvain
88 51 sylvain
==== pocl
89 51 sylvain
90 51 sylvain
[http://portablecl.org/]
91 51 sylvain
92 51 sylvain
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.
93 51 sylvain
94 51 sylvain
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.
95 51 sylvain
96 51 sylvain
97 51 sylvain
==== FreeOCL
98 51 sylvain
99 51 sylvain
[http://code.google.com/p/freeocl/]
100 51 sylvain
101 51 sylvain
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.
102 51 sylvain
103 51 sylvain
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.
104 51 sylvain
105 51 sylvain
106 51 sylvain
=== gr-fosphor
107 51 sylvain
108 25 horiz0n
Build gr-fosphor
109 25 horiz0n
110 21 horiz0n
{{{
111 21 horiz0n
git clone git://git.osmocom.org/gr-fosphor
112 21 horiz0n
cd gr-fosphor
113 21 horiz0n
mkdir build
114 37 sylvain
cd build
115 21 horiz0n
cmake ..
116 21 horiz0n
make
117 21 horiz0n
sudo make install
118 21 horiz0n
sudo ldconfig
119 21 horiz0n
}}}
120 1 sylvain
121 1 sylvain
Build benchmark tool
122 21 horiz0n
123 21 horiz0n
{{{
124 21 horiz0n
cd gr-fosphor/lib/fosphor
125 21 horiz0n
make
126 25 horiz0n
}}}
127 25 horiz0n
128 21 horiz0n
Fosphor is known to build successfully on Linux, OSX and Windows.
129 46 sylvain
130 46 sylvain
==== Known issues
131 1 sylvain
132 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}}} )
133 46 sylvain
 * 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.
134 2 sylvain
135 2 sylvain
== Screenshots
136 15 sylvain
137 15 sylvain
=== Short video examples
138 15 sylvain
139 15 sylvain
http://www.youtube.com/watch?v=mjD-l3GAghU
140 1 sylvain
141 1 sylvain
{{{
142 1 sylvain
#!html
143 15 sylvain
<iframe width="960" height="720" src="http://www.youtube.com/embed/mjD-l3GAghU" frameborder="0" allowfullscreen></iframe>
144 15 sylvain
}}}
145 15 sylvain
146 15 sylvain
147 15 sylvain
=== osmocom_fft in fosphor mode
148 15 sylvain
149 51 sylvain
Those are when enabling the integrated 'fosphor' mode of osmocom_fft through the -F command line option
150 51 sylvain
151 51 sylvain
[[Image(GrOsmoSDR:fosphor.png)]]
152 2 sylvain
[[Image(GrOsmoSDR:fosphor2.png)]]
153 3 horiz0n
154 3 horiz0n
== Bandwidth figures
155 3 horiz0n
156 3 horiz0n
There's a benchmark program available which allows to estimate the maximal bandwidth that can be processed with a specific GPU.
157 3 horiz0n
158 3 horiz0n
To build it:
159 3 horiz0n
160 3 horiz0n
{{{
161 3 horiz0n
cd gr-fosphor/lib/fosphor
162 3 horiz0n
make
163 3 horiz0n
}}}
164 3 horiz0n
165 3 horiz0n
Then execute it by providing a prerecorded complex float file (a couple of 100MB should be fine) in gnuradio format.
166 3 horiz0n
167 3 horiz0n
{{{
168 3 horiz0n
./main some.cfile
169 3 horiz0n
}}}
170 3 horiz0n
171 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.
172 14 horiz0n
173 14 horiz0n
Submit your numbers & help us to create a GPU survey. We are especially interested in the top end and mobile graphics figures.
174 3 horiz0n
175 8 sylvain
||'''CPU'''||'''GPU'''||'''Msps'''||
176 31 horiz0n
||?||AMD R290(X)||WANTED||
177 8 sylvain
||?||NVidia Titan||WANTED||
178 42 horiz0n
||i7-4770K 3.5 GHz||NVidia !GeForce GTX 760||~228||
179 1 sylvain
||?||AMD Radeon HD 7970 (Tahiti)||~220||
180 41 horiz0n
||i5-3570K 3.4 GHz||AMD Radeon HD 7870 (Tahiti)||~220||
181 40 sylvain
||i7-3770K 3.4 GHz||Nvidia GTX 660||~202||
182 40 sylvain
||i7-3770K 3.4 Ghz||Nvidia GTX 760||~191||
183 39 ttsou
||i7-4770K 3.5 GHz||Nvidia GTX 650 Ti Boost||~188||
184 49 sylvain
||i5-2500 3.3 GHz||NVidia GTX 460 SE||~129||
185 28 horiz0n
||i5-3570K 3.4GHz||AMD Radeon HD 7870 (Pitcairn)||~112||
186 29 horiz0n
||i5-2500 3.3GHz||NVidia GTX 550 Ti||~110||
187 28 horiz0n
||i5-2500k 3.8GHz||AMD Radeon HD 6850||~100||
188 1 sylvain
||?||NVidia GTX 550 Ti||~97||
189 28 horiz0n
||QC Xeon 2 GHz||Nvidia !GeForce 560 Ti||~73||
190 42 horiz0n
||C2D 2.66 GHz||NVidia !GeForce GT 640 (GK107)||~67||
191 44 sylvain
||i5 2.4 GHz||Intel Iris Pro 5100||~65||
192 48 sylvain
||i7-3610QM||NVidia !GeForce GT 640M LE||~63||
193 42 horiz0n
||i7-950 3.06 GHz||NVidia GT9800||~61||
194 42 horiz0n
||i5-2500K 4.2 GHz||AMD Radeon HD 6570||~58||
195 30 horiz0n
||C2D 3.00GHz||NVidia !GeForce 9800 GT||~47||
196 43 sylvain
||i5-2520M 2.5 GHz||NVidia GF119M||~46||
197 28 horiz0n
||C2D 2.4GHz||NVidia 9600M GT||~31||
198 55 horiz0n
||i5-3320M||Intel CPU OpenCL||~24||
199 28 horiz0n
||?||NVidia GT330M||~22||
200 28 horiz0n
||?||NVidia 8600GT||~15||
201 28 horiz0n
||C2D 2.2GHz||NVidia NVS 140M||~14||
202 1 sylvain
||AMD E350 Fusion APU||AMD Radeon 6310||~12||
203 37 sylvain
||C2Q Q9650 3.00GHz||!GeForce 9300 GE||~11||
204 28 horiz0n
||Atom 330||NVidia ION||~10||
Add picture from clipboard (Maximum size: 48.8 MB)