arr-scripts icon indicating copy to clipboard operation
arr-scripts copied to clipboard

hwaccel not invoking gpu (intel arc380)

Open cgram23 opened this issue 9 months ago • 6 comments

I'm running sabnzbd in unraid 7. I have my intel arc380 passed through (similarly to how I pass it through to my plex docker). I can see the /dev/dri/renderD128 in the sabnzbd docker, and I have elevated permissions just in case that was causing issues.

When I download an h264 file with sma set to transcode to hevc/265 using vaapi, it fails with the following errors:

[AVHWDeviceContext @ 0x153c42280f80] Failed to initialise VAAPI connection: -1 (unknown libva error). Device creation failed: -5. No device available for decoder: device type vaapi needed for codec h264. [vist#0:0/h264 @ 0x153c4160b800] Hardware device setup failed for decoder: I/O error [vost#0:0/libx265 @ 0x153c46d2b7c0] Error initializing a simple filtergraph Error opening output file /data/usenet/complete/tv/Ghosts.US.S04E12.Its.the.End.of.the.World.as.We.Know.It.and.What.Were.We.Talking.About.1080p.AMZN.WEB-DL.DDP5.1.H.264-NTb-Scrambled.2/Ghosts.US.S04E12.Its.the.End.of.the.World.as.We.Know.It.and.What.Were.We.Talking.About.1080p.AMZN.WEB-DL.DDP5.1.H.264-NTb-Scrambled.mkv. Error opening output files: I/O error

my sma.ini for the converter is:

[Converter] ffmpeg = ffmpeg ffprobe = ffprobe threads = 0 hwaccels = vaapi hwaccel-decoders = vaapi hwdevices = /dev/dri/renderD128 hwaccel-output-format = vaapi:vaapi output-directory = output-format = mkv output-extension = mkv temp-extension = minimum-size = 0 ignored-extensions = nfo, ds_store copy-to = move-to = delete-original = True process-same-extensions = True bypass-if-copying-all = False force-convert = True post-process = False wait-post-process = False detailed-progress = False opts-separator = , preopts = -fflags,+genpts postopts = regex-directory-replace = [^\w-_. ] output-directory-space-ratio = 0.0

Any idea what I'm doing wrong?

cgram23 avatar Mar 20 '25 18:03 cgram23

You need to specify the video codec as one of the compatible hw accelerated ones most likely...

Which is not showing at in the posted config...

Edit: I'm also not sure HW acceleration works because I only use SMA to repackage items to MVK format, trim audio tracks (languages), tag and etc... I do not re-encode at all with it...

RandomNinjaAtk avatar Mar 24 '25 19:03 RandomNinjaAtk

Fair enough.

So to add the video codec....is this an additional field that I would need to add to the config? Would you happen to know the syntax?

cgram23 avatar Mar 24 '25 19:03 cgram23

Your SMA.ini file should be a lot longer....

Full config should look similar to this: https://github.com/RandomNinjaAtk/arr-scripts/blob/main/sabnzbd/sma.ini

The specific line, where you need to add the codec used to convert with: https://github.com/RandomNinjaAtk/arr-scripts/blob/22889ee42b0cae67ccbf85f7de184ac40c9ad216/sabnzbd/sma.ini#L46

I would recommend reviewing the source projects documentation: https://github.com/mdhiggins/sickbeard_mp4_automator/wiki/AutoProcess-Settings

I think the codec you want to enter can be found here: https://github.com/mdhiggins/sickbeard_mp4_automator/blob/3fbf63fb603ad093e50ab583e5d35a1feda4bb44/converter/avcodecs.py#L1199

RandomNinjaAtk avatar Mar 24 '25 19:03 RandomNinjaAtk

Yea...I have all that. I was just showing the primary converter section since I thought that would be most relevant.

I'll keep playing with it.

cgram23 avatar Mar 24 '25 20:03 cgram23

Your probably best off, using the CLI and doing some manual testing with SMA and your config, that way you can fast iterate....

Example command: python3 /config/scripts/sma/manual.py --config "/config/scripts/sma.ini" -i "file_to_covert.mp4" From: https://github.com/RandomNinjaAtk/arr-scripts/blob/22889ee42b0cae67ccbf85f7de184ac40c9ad216/sabnzbd/video.bash#L208

RandomNinjaAtk avatar Mar 24 '25 20:03 RandomNinjaAtk

Copy that. Thanks for the tip.

cgram23 avatar Mar 24 '25 20:03 cgram23