mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-02-09 00:17:00 +01:00
detectors/rocm: default option to conserve cpu usage at the expense of latency
This commit is contained in:
parent
da31ee197c
commit
61713115e2
@ -20,6 +20,7 @@ DETECTOR_KEY = "rocm"
|
||||
|
||||
class ROCmDetectorConfig(BaseDetectorConfig):
|
||||
type: Literal[DETECTOR_KEY]
|
||||
conserve_cpu: bool = Field(default=True, title="Conserve CPU at the expense of latency (and reduced max throughput)")
|
||||
|
||||
class ROCmDetector(DetectionApi):
|
||||
type_key = DETECTOR_KEY
|
||||
@ -36,6 +37,9 @@ class ROCmDetector(DetectionApi):
|
||||
)
|
||||
raise
|
||||
|
||||
if detector_config.conserve_cpu:
|
||||
logger.info(f"AMD/ROCm: switching HIP to blocking mode to conserve CPU")
|
||||
ctypes.CDLL('/opt/rocm/lib/libamdhip64.so').hipSetDeviceFlags(4)
|
||||
assert detector_config.model.model_type == 'yolov8', "AMD/ROCm: detector_config.model.model_type: only yolov8 supported"
|
||||
assert detector_config.model.input_tensor == 'nhwc', "AMD/ROCm: detector_config.model.input_tensor: only nhwc supported"
|
||||
if detector_config.model.input_pixel_format != 'rgb':
|
||||
|
Loading…
Reference in New Issue
Block a user