Skip to content

Commit

Permalink
Merge pull request #834 from anarkiwi/uhds
Browse files Browse the repository at this point in the history
VkFFT performance improvements for both worker and scanner.
  • Loading branch information
anarkiwi authored Aug 22, 2023
2 parents 099b54d + 8ac94dd commit fe44725
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
4 changes: 2 additions & 2 deletions docker/Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ RUN cmake .. && make -j "$(nproc)"
FROM iqtlabs/gnuradio:3.10.7 as gr-iqtlabs-builder
ENV DEBIAN_FRONTEND noninteractive
WORKDIR /root
RUN git clone https://github.com/iqtlabs/gr-iqtlabs -b 1.0.33
RUN git clone https://github.com/iqtlabs/gr-iqtlabs -b 1.0.34
RUN apt-get update && apt-get install -y --no-install-recommends libopencv-dev libvulkan-dev
WORKDIR /root/gr-iqtlabs/build
COPY --from=sigmf-builder /usr/local /usr/local
Expand All @@ -48,7 +48,7 @@ RUN cmake .. && make -j "$(nproc)" && make install
FROM iqtlabs/gnuradio:3.10.7 as uhd_sample_recorder-builder
ENV DEBIAN_FRONTEND noninteractive
WORKDIR /root
RUN git clone https://github.com/iqtlabs/uhd_sample_recorder -b v1.0.5
RUN git clone https://github.com/iqtlabs/uhd_sample_recorder -b v1.0.6
WORKDIR /root/uhd_sample_recorder
RUN ./bin/install-deps.sh && ./bin/build.sh
WORKDIR /root/uhd_sample_recorder/build
Expand Down
20 changes: 14 additions & 6 deletions gamutrf/grscan.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,24 +260,26 @@ def get_db_blocks(self, fft_size, samp_rate, scaling):
raise ValueError("scaling must be 'spectrum' or 'density'")
return [
blocks.complex_to_mag_squared(fft_size),
blocks.multiply_const_vff([scale] * fft_size),
blocks.multiply_const_ff(scale, fft_size),
blocks.nlog10_ff(10, fft_size, 0),
]

def get_window(self, fft_size):
return window.hann(fft_size)

def get_offload_fft_block(self, fft_batch_size, fft_size, fft_block):
return [
def get_offload_fft_block(self, fft_batch_size, fft_size, fft_block, fft_roll):
offload_blocks = [
blocks.stream_to_vector(gr.sizeof_gr_complex, fft_batch_size * fft_size),
blocks.multiply_const_vff(
[val for val in self.get_window(fft_size) for _ in range(2)]
* fft_batch_size
),
fft_block,
blocks.vector_to_stream(gr.sizeof_gr_complex * fft_size, fft_batch_size),
self.iqtlabs.vector_roll(fft_size),
]
if fft_roll:
offload_blocks.append(self.iqtlabs.vector_roll(fft_size)),
return offload_blocks

def get_fft_blocks(
self, use_vkfft, fft_batch_size, fft_size, dc_block_len, dc_block_long
Expand All @@ -286,15 +288,21 @@ def get_fft_blocks(
if dc_block_len:
fft_blocks.append(grfilter.dc_blocker_cc(dc_block_len, dc_block_long))
fft_block = None
fft_roll = False
if self.wavelearner:
fft_block = self.wavelearner.fft(
int(fft_batch_size * fft_size), (fft_size), True
)
fft_roll = True
elif use_vkfft:
fft_block = self.iqtlabs.vkfft(int(fft_batch_size * fft_size), fft_size)
fft_block = self.iqtlabs.vkfft(
int(fft_batch_size * fft_size), fft_size, True
)
if fft_block:
fft_blocks.extend(
self.get_offload_fft_block(fft_batch_size, fft_size, fft_block)
self.get_offload_fft_block(
fft_batch_size, fft_size, fft_block, fft_roll
)
)
else:
fft_blocks.extend(
Expand Down

0 comments on commit fe44725

Please sign in to comment.