From d82fe5dfa6cf50b4c3af5a61bff1e8e2c5cc102b Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Thu, 19 Nov 2026 16:07:41 +0100 Subject: [PATCH] Live stills: 16 GPU analysis threads a card, whatever receiver_threads is The rugnux live analysis of a serial collection took min(receiver_threads, 16 per card), so a site running 16 receiver threads on four cards analysed on four threads a card. It now runs 16 a card (fewer where a card's memory does not hold them), as offline rugnux does. Measured on a 10.7 Mpx stills replay: 8 a card saturates, 16 is the fastest, 32 and 64 are 4-9 % slower. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01HVeDQrPqZ52Tp6rzzZGxf3 --- docs/JFJOCH_BROKER.md | 4 +++- receiver/JFJochReceiverRugnuxStills.cpp | 7 +++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/JFJOCH_BROKER.md b/docs/JFJOCH_BROKER.md index 8964c582c..e97402241 100644 --- a/docs/JFJOCH_BROKER.md +++ b/docs/JFJOCH_BROKER.md @@ -230,7 +230,9 @@ goniometer and the rugnux live setting: `receiver_threads` is the number of image threads. The Lite receiver uses at most 16 of them for a collection at 100 Hz or slower or of fewer than 256 images (each thread holds a GPU analysis of its -own); the FPGA receiver takes four when it sums images on the host. The GPU FFT indexers and cuFFT +own); the FPGA receiver takes four when it sums images on the host. The rugnux live analysis of a serial +collection does not take its threads from `receiver_threads`: it runs 16 GPU analysis threads a card (fewer on a +card whose memory does not hold 16 of them). The GPU FFT indexers and cuFFT plans the broker's own indexing uses are built once and kept for the life of the process, and the ones built for earlier indexing settings are released when the settings change. `azim_int.force_cpu` moves the azimuthal integration of the FPGA workflow from the card to the host, which a profile with diff --git a/receiver/JFJochReceiverRugnuxStills.cpp b/receiver/JFJochReceiverRugnuxStills.cpp index 7ede8dc43..0d45e104f 100644 --- a/receiver/JFJochReceiverRugnuxStills.cpp +++ b/receiver/JFJochReceiverRugnuxStills.cpp @@ -6,6 +6,7 @@ #include #include +#include "../common/CUDAWrapper.h" #include "../common/time_utc.h" #include "../frame_serialize/CBORStream2Serializer.h" #include "../rugnux/Rugnux.h" @@ -42,8 +43,10 @@ JFJochReceiverRugnuxStills::JFJochReceiverRugnuxStills(const DiffractionExperime prepass_images(in_prepass_images), live_status(in_live_status), indexing_thread_pool(in_indexing_thread_pool), - // As offline rugnux's per-image loop: 16 a card, at most the threads given - stills_nthreads(ImageWorkers(in_experiment.GetPixelsNum(), static_cast(in_forward_nthreads))) { + // As offline rugnux's per-image loop: 16 a card (fewer where a card's memory does not hold them), whatever + // the receiver's own thread count + stills_nthreads(get_gpu_count() > 0 ? GPUWorkersPerCard(in_experiment.GetPixelsNum(), 16) * get_gpu_count() + : static_cast(in_forward_nthreads)) { StartThreads(); }