mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-03 09:45:22 +03:00
Handle case where hwaccel is not setup
This commit is contained in:
parent
baeb3ddc75
commit
3be336afa8
@ -86,10 +86,13 @@ def get_temperatures() -> dict[str, float]:
|
||||
def get_gpu_stats(config: FrigateConfig) -> dict[str, dict]:
|
||||
"""Parse GPUs from hwaccel args and use for stats."""
|
||||
hwaccel_args = set(
|
||||
map(lambda camera: camera.ffmpeg.hwaccel_args, config.cameras.values())
|
||||
)
|
||||
map(lambda camera: camera.ffmpeg.hwaccel_args if camera.ffmpeg.hwaccel_args else None, config.cameras.values())
|
||||
).remove(None)
|
||||
stats: dict[str, dict] = {}
|
||||
|
||||
if not hwaccel_args:
|
||||
return None
|
||||
|
||||
for args in hwaccel_args:
|
||||
if "cuvid" in args:
|
||||
# nvidia GPU
|
||||
|
||||
@ -134,6 +134,13 @@ export default function System() {
|
||||
</div>
|
||||
|
||||
<Heading size="lg">GPUs</Heading>
|
||||
{!gpu_usages ? (
|
||||
<div className="p-4">
|
||||
<Link href={'https://docs.frigate.video/configuration/hardware_acceleration'}>
|
||||
Hardware acceleration has not been setup, see the docs to setup hardware acceleration.
|
||||
</Link>
|
||||
</div>
|
||||
) : (
|
||||
<div data-testid="gpus" className="grid grid-cols-1 3xl:grid-cols-3 md:grid-cols-2 gap-4 p-2 px-4">
|
||||
{gpuNames.map((gpu) => (
|
||||
<div
|
||||
@ -157,6 +164,7 @@ export default function System() {
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
|
||||
<Heading size="lg">Cameras</Heading>
|
||||
<div data-testid="cameras" className="grid grid-cols-1 3xl:grid-cols-3 md:grid-cols-2 gap-4">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user