An Implementation of a FIR Filter on a GPU
Faculty
Students
General-purpose computing using graphics processors (GPUs) is an active area of research. Numerical algorithms often perform same computations for each input element. Their performance can improve when the computation is parallelized. GPUs include several programmable fragment processing units (FPUs) that render an image using a number of textures. Programmers can define textures as inputs of the numerical algorithm and implement the algorithm as a fragment program. The image is rendered to an off-screen buffer and is then copied to the main memory.
The goal of this project is to implement a finite impulse response (FIR) filter on a GPU. A FIR filter is often used in audio processing applications. Other algorithms such as a frequency translating FIR filter and a Hilbert transformation use FIR filter as the building block.
We added our implementation of FIR filter to GNU Software Radio and evaluated its performance using a Pentium 4-HT 3.2 GHz processor and a Geforce 6600 video card. The results of the experiments indicate that the GPU implementation has better performance then the CPU implementation for a large number of taps.
NEW: FIR on GPU as a stand-alone program is available for download!
NVidia Software Installation under Linux
GNU Radio Installation under Linux Fedora Core 4
- Check out gnuradio module from GNU Radio CVS. Follow instructions on http://comsec.com/wiki?CvsAccess.
- Compiling Gnu Radio on FC4 is tricky. GCC version 3.3.5 can compile Gnu Radio. The default Fedora Core 4 compiler GCC 4.0.0 cannot compile it. You need to download GCC 3.3.5 and compile it. But GCC 4.0.0 cannot compile GCC 3.3.5 either! You need to download GCC 3.4.0 and compile it with GCC 4.0.0. Then you can compile GCC 3.3.5 with GCC 3.4.0. Use the following command to use a non-default compiler: export CC=path-to-gcc and export CXX=path-to-g++. Once you compiled GCC 3.3.5 you can finally compile GNU Radio using it. If you know how to do it easier -- please let me know.
- Download FIR on GPU code as a patch.
- In all Makefile.in files change NVSDK and NVSDK_DEMO variables to NVidia SDK directories.
- Change to Gnu Radio directory. Type the following commands, one after another: (1) ./bootstrap (2) ./configure --disable-gui (3) ./bootstrap (4) patch -p2 < fir.patch (5) ./configure --disable-gui. First time, bootstrap and configure return an error. This is why you need to execute these commands twice.
- Not all targets are built successfully if you run make. Instead, run make -k
- Change to directory ./src/gnu/lib and execute make. If no error comes up then skip the next step.
- On my computer, libtool arguments need a modification. Replace -lfftw3f and -lm with /usr/local/lib/libfftw3f.a /usr/lib/libm.so
- Go to examples directory and type make test1. If an executable is created then you installed Gnu Radio successfully.
Downloads
Documentation
FIR on GPU is implemented as a patch to GNU Radio. The code is added inside #ifdef USE_GPU #endif pre-processor directives. If GNU Radio libraries and the demo code are compiled with -DUSE_GPU then GPU versions of GNU Radio blocks will replace the original CPU implementations. Change Makefiles that contain -DUSE_GPU to turn GPU implementations on/off (for i in `find . -name Makefile`; do grep -H 'DUSE_GPU' $i; done). The reason why original source files were patched instead of implementing new GNU Radio blocks is to allow GNU Radio programs use GPU without any modifications except a new compilation flag -DUSE_GPU. test1 is radio transmitter/receiver example.
Alexey Smirnov
2005-10-25