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(); }