GNUradio

I have been trying to get GNUradio working, on the Jetson TK1, with no success yet. Has anyone had any luck with it?

Done some playing and think I’ve gotten it to compile properly. I needed to force cmake to use the correct settings.

The line I used was

cmake -DCMAKE_C_FLAGS="-march=armv7-a -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a15" -DCMAKE_ASM-ATT_FLAGS="-march=armv7-a -mthumb-interwork -mfloat-abi=hard -mfpu=neon" …/

Hello,

Thanks Cynar. I see from the GNURADIO website that cmake flags need setting globally, but it’s not clear where this is done? Do you have any pointers?

It’s great news to see others are having success - I’m hoping to get gr-fosphor working using POCL on the Jetson TK1.

Best regards,

Alex

I used this page:
http://gnuradio.org/redmine/projects/gnuradio/wiki/BuildGuide

however, I did try the script and a few other options first, so there may be some dependencies I installed by other routes.

Just replace the cmake …/ with the line above.

So, here’s an update to my progress with getting GNURADIO installed and running on the Jetson TK1.

All appears well with GNURADIO, I can run both QT and WX GUIs and my RTL-SDR happily streams samples in to GNURADIO-COMPANION. Now all I need to do is figure out why gr-foshor (the tool I’m really interested in running on the TK1) Seg Faults!

Hardware: Nvidia Jetson Tegra TK1 Development Board
Ubuntu: 14.0.4
Kernel: 3.10.40-ged4f697
GNU Radio Companion: 3.7.6git-276-gc67281b6
rtl_sdr: Latest GIT repo
GLFW: 3.1
gr-fosphor: Latest GIT repo
libboost: 1.54
libgruel: not installed

Here’s the commands I executed having loaded a fresh file system image on to the Jetson TK1 using Jetpack 1.0 [Linux4Tegra r21.2]

sudo apt-get update

(didn’t run “sudo apt-get upgrade” because I wanted to test it “as-is”)

sudo apt-get install git cmake
sudo apt-get install  aptitude nano
sudo apt-get -y install git-core cmake g++ python-dev swig pkg-config libfftw3-dev libboost-all-dev libcppunit-dev libgsl0-dev libusb-dev libsdl1.2-dev python-wxgtk2.8 python-numpy python-cheetah python-lxml doxygen libxi-dev python-sip libqt4-opengl-dev libqwt-dev libfontconfig1-dev libxrender-dev
sudo apt-get install python-sip python-sip-dev python-qwt5-qt4
sudo nano /etc/apt/sources.list

(check that the universe repos are included in the list)

cd ~
git clone http://git.gnuradio.org/git/gnuradio.git
cd gnuradio/
mkdir build
cd build/
cmake -DCMAKE_C_FLAGS="-march=armv7-a -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a15" -DCMAKE_ASM-ATT_FLAGS="-march=armv7-a -mthumb-interwork -mfloat-abi=hard -mfpu=neon" ../
make 
sudo make install
sudo ldconfig
volk_profile -b

(to run benchmarking mode. I let it run to completion)

make test

(qa_volk_test_all fails for me and the test appears to crash just after 83/192 at Start 84: qa_ber_bf)

gnuradio-companion

(Set options to WX GUI, connect [Waveform generators]->Signal Source to [Misc]->throttle to [Instrumentation]->[WX]->WX GUI FFT Sink, Save, run and test)

sudo apt-get install libusb-1.0.0
cd ~
git clone git://git.osmocom.org/rtl-sdr.git
cd rtl-sdr/
mkdir build
cd build
cmake -DINSTALL_UDEV_RULES=ON -DCMAKE_C_FLAGS="-march=armv7-a -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a15" -DCMAKE_ASM-ATT_FLAGS="-march=armv7-a -mthumb-interwork -mfloat-abi=hard -mfpu=neon" ../
make
sudo make install
sudo ldconfig
sudo nano /etc/modprobe.d/blacklist.conf

add “blacklist dvb_usb_rtl28xxu” to file

sudo reboot
lsusb

(you Should see Realtek Semiconductor Corp. RTL2832U DVB-T)

rtl_fm -f 97.5e6 -M wbfm -s 200000 -r 48000 - | aplay -r 48k -f S16_LE

(If you have speakers plugged in you should hear either noise or a broadcast radio station if you’re really lucky)

cd ~
git clone git://git.osmocom.org/gr-osmosdr
cd gr-osmosdr/
mkdir build
cd build/
cmake -DCMAKE_C_FLAGS="-march=armv7-a -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a15" -DCMAKE_ASM-ATT_FLAGS="-march=armv7-a -mthumb-interwork -mfloat-abi=hard -mfpu=neon" ../
make
sudo make install
sudo ldconfig

run gnu radio companion and drop [Sources]->RTL-SDR Source and connect to [Instrumentation]->WX GUI FFt Sink

The next part details installing gr-fosphor and, at the moment, this is a work in progress (see later)

sudo apt-get install cmake xorg-dev libglu1-mesa-dev
cd ~
git clone https://github.com/glfw/glfw
cd glfw
mkdir build
cd build
cmake -DBUILD_SHARED_LIBS=true -DCMAKE_C_FLAGS="-march=armv7-a -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a15" -DCMAKE_ASM-ATT_FLAGS="-march=armv7-a -mthumb-interwork -mfloat-abi=hard -mfpu=neon" ../
make
sudo make install
sudo ldconfig
sudo apt-get install opencl-headers
cd ~ 
git clone git://git.osmocom.org/gr-fosphor
cd gr-fosphor
mkdir build
cd build
cmake -DCMAKE_C_FLAGS="-march=armv7-a -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a15" -DCMAKE_ASM-ATT_FLAGS="-march=armv7-a -mthumb-interwork -mfloat-abi=hard -mfpu=neon" ../
make
sudo make install
sudo ldconfig
cd ../lib/fosphor/
make

Now I cam attempt to run gr-fosphor to check that that it realised we don’t have an OpenCL ICD installed

./main

--------------------------output follows------------------------------------
[!] CL Error (-1001, cl.c:275): Unable to fetch platform IDs
[!] No suitable OpenCL device found
[!] Failed to initialize fosphor
-----------------------------output ends------------------------------------

Since Nvidia don’t yet offer an OpenCL ICD for the Tegra, I made use of the four ARM A15 cores instead using FreeOCL:

sudo apt-get install libatomic-ops-dev subversion
cd ~
svn checkout http://freeocl.googlecode.com/svn/trunk/ freeocl-read-only
cd freeocl-read-only/
mkdir build
cd build
cmake -DCMAKE_C_FLAGS="-march=armv7-a -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a15" -DCMAKE_ASM-ATT_FLAGS="-march=armv7-a -mthumb-interwork -mfloat-abi=hard -mfpu=neon" ../
make
sudo make install
sudo ldconfig

First I recorded a cfile, then run the file through gr-fosphor, at which point it SegFaults:

osmocom_fft

--------------------------output follows------------------------------------
gr-osmosdr v0.1.4-8-g46bb1ad1 (0.1.5git) gnuradio 3.7.6git-276-gc67281b6
built-in source types: file rtl rtl_tcp rfspace
Using device #0 Generic RTL2832U SN: 77771111153705700
Found Rafael Micro R820T tuner
Exact sample rate is: 250000.000414 Hz
Using Volk machine: neon_hardfp
Recording samples to /tmp/name-f9.577000e+08-s1.600000e+06-t20150102175731.cfile
Finished recording to /tmp/name-f9.577000e+08-s1.600000e+06-t20150102175731.cfile
-----------------------------output ends------------------------------------

cd ~/gr-fosphor/lib/fosphor
./main /tmp/name-f9.577000e+08-s1.600000e+06-t20150102175731.cfile

--------------------------output follows------------------------------------
[+] Selected device: ARMv7 Processor rev 3 (v7l)
536150000ns
25451000ns
Segmentation fault
-----------------------------output ends------------------------------------
I’m going to contact the developers and see if they can point me in the right direction to debug the issue.

You might want to compile any of your own components with the “-g” option and then run this final app via gdb…once it crashes do a backtrace “bt”. Looks like this one might be straightforward to get a fault point on.

In some cases “strace” may also reveal the issue (e.g. if it’s trying to open something that doesn’t exists and if the code doesn’t do proper checking, it often just segfaults).

The known issues list suggests that you provide the path to the OpenCL lib on compile time.

I highly recommend that you always specify a prefix when building your own libraries/applications. You can install them e.g. to “$HOME/build” or whatever. When you install something to that prefix, any application depending on it, must find it. In some cases you only need to add that path to pkgconfig’s search path, in some cases you need to provide the proper compiler/linker flags.

When installing to your own prefix,

  • you can use newer/older libraries without breaking the OS.
  • updating the OS doesn't overwrite your libraries/header files.
  • uou can easily have multiple build trees, if you need to try different versions

I just want to thank TechfreakZ for the GNUradio installation procedure. I had no issues with it on a fresh Jetpack 1.0.