Trouble with gnuradio and AMD32

Hello, all

My configuration:
Linux Xubuntu 12.04
AMD Athlon XP 2400
Linux ghost32 3.2.0-24-generic #39-Ubuntu SMP Mon May 21 16:51:22 UTC
2012 i686 athlon i386 GNU/Linux

I am compiled latest version of gnuradio, and tried to run simple grc
file: http://superkuh.com/simplest.grc , and got following error:

(python:3350): GLib-GObject-CRITICAL **: g_param_spec_double: assertion
`default_value >= minimum && default_value <= maximum’ failed

(python:3350): GLib-GObject-CRITICAL **:
g_object_class_install_property: assertion `G_IS_PARAM_SPEC (pspec)’
failed

(python:3350): GLib-GObject-WARNING **: g_object_notify: object class
GdkScreenX11' has no property named resolution’
Using Volk machine: generic
Traceback (most recent call last):
File “./top_block.py”, line 131, in
tb = top_block()
File “./top_block.py”, line 79, in init
peak_hold=False,
File
“/usr/local/lib/python2.7/dist-packages/gnuradio/wxgui/fftsink_gl.py”,
line 89, in init
win=win,
File
“/usr/local/lib/python2.7/dist-packages/gnuradio/blks2impl/logpwrfft.py”,
line
57, in init
c2magsq = gr.complex_to_mag_squared(fft_size)
File
“/usr/local/lib/python2.7/dist-packages/gnuradio/gr/gnuradio_core_general.py”,
line 3838, in complex_to_mag_squared
return _gnuradio_core_general.complex_to_mag_squared(vlen)
RuntimeError: gr_block::set_alignment_multiple
[Inferior 1 (process 3350) exited with code 01]

Then I compiled the program with debugging symbols, and started in the
debugger:

(gdb) s
Single stepping until exit from function Py_Main,
which has no line number information.
0x0805e78b in main ()
(gdb) bt
#0 0x0805e78b in main ()
(gdb) l
11 // detail/sp_counted_base_gcc_x86.hpp - g++ on 486+ or AMD64
12 //
13 // Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media
Ltd.
14 // Copyright 2004-2005 Peter Dimov
15 //
16 // Distributed under the Boost Software License, Version 1.0.
(See
17 // accompanying file LICENSE_1_0.txt or copy at
18 // http://www.boost.org/LICENSE_1_0.txt)
19 //
20 //
(gdb) n
Single stepping until exit from function main,
which has no line number information.
0x006b94d3 in __libc_start_main () from /lib/i386-linux-gnu/libc.so.6
(gdb) l
21 // Lock-free algorithm by Alexander Terekhov
22 //
23 // Thanks to Ben Hitchings for the #weak + (#shared != 0)
24 // formulation
25 //
26
27 #include <boost/detail/sp_typeinfo.hpp>
28
29 namespace boost
30 {
(gdb) n
Single stepping until exit from function __libc_start_main,
which has no line number information.
[Inferior 1 (process 3367) exited with code 01]

My problem is like this:
http://lists.gnu.org/archive/html/discuss-gnuradio/2012-03/msg00294.html
Then i run volk_profile, and got this errors:

Using Volk machine: generic
RUN_VOLK_TESTS: volk_32fc_s32fc_rotatorpuppet_32fc_a
no architectures to test
RUN_VOLK_TESTS: volk_16ic_s32f_deinterleave_real_32f_a
no architectures to test
RUN_VOLK_TESTS: volk_16ic_deinterleave_real_8i_a
no architectures to test
RUN_VOLK_TESTS: volk_16ic_deinterleave_16i_x2_a
no architectures to test
RUN_VOLK_TESTS: volk_16ic_s32f_deinterleave_32f_x2_a
no architectures to test
RUN_VOLK_TESTS: volk_16ic_deinterleave_real_16i_a
no architectures to test
RUN_VOLK_TESTS: volk_16ic_magnitude_16i_a
no architectures to test
RUN_VOLK_TESTS: volk_16ic_s32f_magnitude_32f_a
no architectures to test
RUN_VOLK_TESTS: volk_16i_s32f_convert_32f_a
no architectures to test
RUN_VOLK_TESTS: volk_16i_s32f_convert_32f_u
no architectures to test
RUN_VOLK_TESTS: volk_16i_convert_8i_a
no architectures to test
RUN_VOLK_TESTS: volk_16i_convert_8i_u

Best regards, Igor

On Fri, Jun 1, 2012 at 3:12 PM, Igor V. [email protected]
wrote:

I am compiled latest version of gnuradio, and tried to run simple grc file:
GdkScreenX11' has no property named resolution’
“/usr/local/lib/python2.7/dist-packages/gnuradio/blks2impl/logpwrfft.py”,
debugger:
13 // Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd.
0x006b94d3 in __libc_start_main () from /lib/i386-linux-gnu/libc.so.6
30 {
RUN_VOLK_TESTS: volk_32fc_s32fc_rotatorpuppet_32fc_a
no architectures to test
RUN_VOLK_TESTS: volk_16i_convert_8i_u

Best regards, Igor

Igor,
After running volk_profile, can you retry your GRC program? It looks
like what’s happening is that because your processor is so old, there
are no Volk kernels available for it, so it only has the ‘generic’
version to run at any time. If you open up $(HOME)/.volk/volk_config,
it should be filled with " generic’ to tell the volk library
to only every run a generic kernel.

If that’s still not working for you after volk_profile has run, then
something with that processor is confusing Volk. Otherwise, the bug in
the post you pointed towards with the volk_32fc_x2_multiply_32fc_a has
been fixed and the output of your GDB here isn’t really telling me
anything. We’ll have to look deeper.

Thanks,
Tom

On 06/01/2012 02:12 PM, Igor V. wrote:

I am compiled latest version of gnuradio, and tried to run simple grc
(python:3350): GLib-GObject-WARNING **: g_object_notify: object class
win=win,

11 // detail/sp_counted_base_gcc_x86.hpp - g++ on 486+ or AMD64
Single stepping until exit from function main,
28

no architectures to test
RUN_VOLK_TESTS: volk_16i_convert_8i_a

I guess I haven’t really checked on things here for a while. I compiled
3.5.3.2 (3.6.0 is having issues building, not sure why yet but I don’t
have time right now to dig any deeper.) and gqrx and get the same sort
of error as Igor with gnuradio_companion and gqrx. Gqrx and grc run
fine on my intel atom 32 bit system. On any of my AMD32 machines, I get
this error.

Below is the output of grc:

Using Volk machine: generic
Traceback (most recent call last):
File “/home/fred/gnuradio/top_block.py”, line 154, in
tb = top_block()
File “/home/fred/gnuradio/top_block.py”, line 95, in init
self.gr_multiply_xx_1 = gr.multiply_vff(1)
File
“/usr/lib/python2.6/site-packages/gnuradio/gr/gnuradio_core_general.py”,
line 8642, in multiply_ff
return _gnuradio_core_general.multiply_ff(vlen)
RuntimeError: gr_block::set_alignment_multiple

Here is the output from gqrx:

gr_fir_ccc: using 3DNow!Ext
Using Volk machine: generic
terminate called after throwing an instance of ‘std::invalid_argument’
what(): gr_block::set_alignment_multiple
Aborted

volk_profile gives the same error as previous.

Cheers,

Fred

On 06/05/2012 09:39 AM, Josh B. wrote:

My problem is like this:
[Discuss-gnuradio] Segfault with volk on 32 bit AMD
Then i run volk_profile, and got this errors:

Using Volk machine: generic

Looks like volk isnt detecting your machine right… hmmm curious.

All, we dont have an sse machine generated since there are no sse only
kernels. So that should be expected.

gr_fir_ccc: using 3DNow!Ext
Using Volk machine: generic
terminate called after throwing an instance of ‘std::invalid_argument’
what(): gr_block::volk_get_alignment
Aborted

so volk_get_alignment() should be returning 1. Would that be a problem
for volk_get_alignment in this particular block, Tom?

-josh

My problem is like this:
[Discuss-gnuradio] Segfault with volk on 32 bit AMD
Then i run volk_profile, and got this errors:

Using Volk machine: generic

Looks like volk isnt detecting your machine right… hmmm curious.

gr_fir_ccc: using 3DNow!Ext
Using Volk machine: generic
terminate called after throwing an instance of ‘std::invalid_argument’
what(): gr_block::set_alignment_multiple
Aborted

And the volk alignment width must somehow be returning zero? I think
thats the only way to make that function unhappy.

-josh

On 06/05/2012 04:29 PM, Tom R. wrote:

Aborted
than 1 and throws a: “throw std::invalid_argument
(“gr_block::set_alignment_multiple”);”

So yeah, with VOLK not handling that processor correctly, it looks
like it can’t get the alignment right, either.

Would patching VOLK to return a minimum of 1 work, or is that just
masking a larger issue for these older processors?

volk is fine, but this gives a 0
volk_get_alignment() / sizeof(gr_complex)
needs some std::max somewhere

On Tue, Jun 5, 2012 at 1:49 PM, Josh B. [email protected] wrote:

Looks like volk isnt detecting your machine right… hmmm curious.

so volk_get_alignment() should be returning 1. Would that be a problem
for volk_get_alignment in this particular block, Tom?

-josh

Yep, it would cause this problem. That block uses VOLK, so it will try
to set the alignment property for the scheduler, which calls
set_alignment. That function checks to see if the multiple is less
than 1 and throws a: “throw std::invalid_argument
(“gr_block::set_alignment_multiple”);”

So yeah, with VOLK not handling that processor correctly, it looks
like it can’t get the alignment right, either.

Would patching VOLK to return a minimum of 1 work, or is that just
masking a larger issue for these older processors?

Tom

On Fri, Jun 1, 2012 at 3:12 PM, Igor V. [email protected]
wrote:

I am compiled latest version of gnuradio, and tried to run simple grc file:
GdkScreenX11' has no property named resolution’
Using Volk machine: generic

Igor,

I’ve updated the code in git that should fix this problem you’re
having. The ‘generic’ machine didn’t have an alignment at all, so it’s
uncertain what was being returned. I’ve set it up to return 1 now, so
it should work.

Tom

On 06/07/2012 01:09 PM, Tom R. wrote:

(python:3350): GLib-GObject-WARNING **: g_object_notify: object class
GdkScreenX11' has no property namedresolution’
Using Volk machine: generic

Igor,

I’ve updated the code in git that should fix this problem you’re
having. The ‘generic’ machine didn’t have an alignment at all, so it’s
uncertain what was being returned. I’ve set it up to return 1 now, so
it should work.

No, the generic alignment defaulted to 1 already.

The bug is that the multiply block is passing 0 into the set alignment
multiple

1/sizeof(complex) is 0 -> due to integer math

On 06/07/2012 01:14 PM, Josh B. wrote:

i686 athlon i386 GNU/Linux
(python:3350): GLib-GObject-CRITICAL **: g_object_class_install_property:
uncertain what was being returned. I’ve set it up to return 1 now, so
it should work.

No, the generic alignment defaulted to 1 already.

The bug is that the multiply block is passing 0 into the set alignment
multiple

1/sizeof(complex) is 0 → due to integer math

Heres how I handled it in gr extras. Not using the alignment call, but
same basic idea. A std::max in the scheduler code would fix this issue
everywhere though

-josh

FYI, in case you want to test this fix. But I think its pretty strait
forward:

http://gnuradio.org/cgit/jblum.git/commit/?h=fix_alignment_issue

-Josh

On Sat, Jun 9, 2012 at 7:40 PM, Josh B. [email protected] wrote:

FYI, in case you want to test this fix. But I think its pretty strait
forward:

http://gnuradio.org/cgit/jblum.git/commit/?h=fix_alignment_issue

-Josh

Josh,
I decided to go with your original recommendation of using std::max(1,
alignment) for each block calling set_alignment. It’s not really the
set_alignment functions job to make a decision on what the caller
meant when they passed in a number; it just protects against incorrect
values. The guy that calls the set_alignment function should make sure
it’s passing the right value.

It’s a bit more work this way (although mostly I expect people to
copy-and-paste), but this makes more sense.

Thanks,
Tom