From 1a80fba07f0f09a8cf52549b7f595e7fde6483d6 Mon Sep 17 00:00:00 2001 From: Christos Falas Date: Tue, 31 Dec 2024 17:49:51 +0000 Subject: [PATCH] change mp spawn method mp.Queue is not pickle-able, which prevents spawn method from working, but is necessary for CUDA to work properly --- src/ingest.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ingest.py b/src/ingest.py index 00c0437..c55eac0 100644 --- a/src/ingest.py +++ b/src/ingest.py @@ -33,7 +33,7 @@ class FeitTransmitter: class FeitReceiver: - def __init__(self, host: Host): + def __init__(self, host: Host, processing_queue: "mp.Queue[CSI]"): self.host = host self.server = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) self.server.connect(host) @@ -48,8 +48,9 @@ class FeitReceiver: self.logger = logging.getLogger( f"{__name__}.{self.__class__.__name__}-{self.host}" ) + self.processing_queue = processing_queue - def listen(self, queue: "mp.Queue[CSI]"): + def listen(self): prev_time = datetime.now() while True: # This is the max size of a UDP packet. The size of the actual CSI @@ -62,7 +63,7 @@ class FeitReceiver: f"Received CSI data after {datetime.now() - prev_time}" ) prev_time = datetime.now() - queue.put(csidata) + self.processing_queue.put(csidata) except struct.error: self.logger.error("Failed to parse CSI data")