Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gr-fec fecapi_async_decoders example not working #3376

Closed
pepassaco opened this issue Apr 17, 2020 · 17 comments
Closed

gr-fec fecapi_async_decoders example not working #3376

pepassaco opened this issue Apr 17, 2020 · 17 comments

Comments

@pepassaco
Copy link

pepassaco commented Apr 17, 2020

Hello!

I was trying the example fecapi_async_decoders from gnuradio/gr-fec/examples (my GNURadio version is the latest 3.8), surprisingly, it does not work as it should. If you try the dummy or repetition encoders, the output bytes match the input ones. However, if you select the convolutional encoder, they do not match at all:

https://imgur.com/R41BUj3

Screenshot

What can be causing this bug and how can it be solved? The fecapi_decoders example seems to work ok interestingly enough.

@mohmmadd
Copy link

mohmmadd commented Apr 25, 2020

It works in GNURadio 3.7.
packet_loopback_hier.grc from gr-digital/examples/packet that use async-decoder/encoder has the same problem.

@mormj
Copy link
Contributor

mormj commented Apr 26, 2020

Looks to be related to #2642 - pretty much looks like conv encoder examples don't work in 3.8. This should definitely be prioritized.

@mormj
Copy link
Contributor

mormj commented Apr 30, 2020

@jdemel @michaelld - I traced this back to the volk_8u_x4_conv_k7_r2_8u kernel, which behaves differently between whatever is included in 3.7 and whatever got included with 3.8. When I manually paste the generic kernel in the cc_decoder_impl.cc code, the bits line up as expected.

@jdemel
Copy link
Contributor

jdemel commented May 1, 2020

@mormj So the generic VOLK kernel works as expected? But some other kernel version does not?
Do you see correct results withVOLK_GENERIC=1? This should enforce generic kernel use.

Which GNU Radio and which VOLK version do you use exactly?

@mormj
Copy link
Contributor

mormj commented May 4, 2020

This works - but leaving off the VOLK_GENERIC does not

josh@josh-clean1910:/share/gnuradio/grdev/src/gnuradio$ export VOLK_GENERIC=1
josh@josh-clean1910:/share/gnuradio/grdev/src/gnuradio$ /usr/bin/python3 -u /share/gnuradio/grdev/src/gnuradio/gr-fec/examples/fecapi_cc_decoders.py

This is the latest master and latest volk. Looks like an AVX implementation was added in volk between the 3.7 and 3.8 release

Here are my machines in cmake

-- Available architectures: generic;64;3dnow;abm;popcount;mmx;fma;sse;sse2;norc;sse3;ssse3;sse4_a;sse4_1;sse4_2;avx;avx2;avx512f;avx512cd
-- Available machines: generic;sse2_64_mmx;sse3_64_mmx;ssse3_64_mmx;sse4_a_64_mmx;sse4_1_64_mmx;sse4_2_64_mmx;avx_64_mmx;avx2_64_mmx;avx512f_64_mmx;avx512cd_64_mmx

@michaelld
Copy link
Contributor

@mormj which version of VOLK are you using for testing? If not the current release, can you try the current release?

@mormj
Copy link
Contributor

mormj commented May 5, 2020

This was with the latest tip on master:

commit 6acb788a50087b74783670e5c1cd17fddd681953 (HEAD -> master, origin/master, origin/HEAD)
Merge: 4a196aa 930aa21
Author: Michael Dickens <michael.dickens@ettus.com>
Date:   Sat May 2 20:46:52 2020 -0400

    Merge pull request #378 from jdemel/ci-fix-remove
    
    ci: Remove Ubuntu 16.04 GCC5 test on TravisCI

But I know for sure it's broken before that. I'll try the last tagged release

@mormj
Copy link
Contributor

mormj commented May 5, 2020

The issue still occurs with Volk 2.2.1, and goes away with VOLK_GENERIC=1

@michaelld
Copy link
Contributor

The issue still occurs with Volk 2.2.1, and goes away with VOLK_GENERIC=1

How about with the recent Volk 2.3.0 release?

@mohmmadd
Copy link

mohmmadd commented May 19, 2020

How about with the recent Volk 2.3.0 release?

I checked it. The problem persists.

@mohmmadd
Copy link

Is problem resolvable?!

@mormj
Copy link
Contributor

mormj commented Jul 30, 2020

I'm sure it is, but it will require a fix in Volk, or removal of the specific kernel

@jdemel
Copy link
Contributor

jdemel commented Jul 30, 2020

I tried different kernels. It seems the AVX2 kernel fails. generic/spiral work as expected.

@tim-huggins
Copy link

Is there a workaround for this aside from reverting to 3.7?

@jdemel
Copy link
Contributor

jdemel commented Aug 7, 2020

@tim-huggins, yeah. there's a workaround. Run volk_profile, then inspect ~/.volk/volk_config. Find the line that starts with:

volk_8u_x4_conv_k7_r2_8u 

and make sure, it ends with spiral spiral (or generic generic or a mix thereof)

volk_8u_x4_conv_k7_r2_8u spiral spiral

The AVX kernel seems to be the reason for this bug. Unfortunately, it only manifests itself in GR. Thus, this bug is difficult to reproduce and track down.

@Aang23
Copy link

Aang23 commented Feb 7, 2022

With the AVX kernel disabled in Volk, and gnuradio/volk#475, this issue appears to be gone.

@michaelld
Copy link
Contributor

@Aang23 thanks for the report! I'm closing this. If someone finds that this doesn't work, please reopen and add some context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants