Jump to content
Duffyx

Enable hardware acceleration on FreeBSD

Recommended Posts

Luke

The situation is still the same. Please see post 21. Thanks.

Share this post


Link to post
Share on other sites
bizarro252

Thanks. I will look on the FreeNAS forums to see if someone has already asked and if not will see if anyone fits the bill :)

Share this post


Link to post
Share on other sites
Luke

Thanks. Make sure they are aware it is gainful employment.

Share this post


Link to post
Share on other sites
bizarro252

Will do, rules say no advertising so checking with one of their admins about how / if I can post about it.

Share this post


Link to post
Share on other sites
Aanerud

It’s possible ,

https://passthroughpo.st/gpu-passthrough-reported-working-on-bhyve/

 

But probably still pretty experimental.

 

Workaround that many uses, is having the host run ESXi, then FreeBSD / FreeNAS as a VM. That allows you to spin up “whatever” next to it, and get full local speed.

 

ESXi uses pass trough to the HBA for the drives, and pass trough GPU’s to other VM’s

 

 

Sent from my iPhone using Tapatalk

Share this post


Link to post
Share on other sites
bizarro252

So, at least according to this, where they are discussing enabling it on Plex, it needs to be on FreeBSD 12, so we (FreeNAS users anyways) may just have to wait.

 

https://www.ixsystems.com/community/threads/activating-plex-hardware-acceleration.75391/#post-545237

 

Looks like beta release will start in Dec.

https://redmine.ixsystems.com/versions/467

Edited by bizarro252
  • Like 1

Share this post


Link to post
Share on other sites
makarai

So, at least according to this, where they are discussing enabling it on Plex, it needs to be on FreeBSD 12, so we (FreeNAS users anyways) may just have to wait.

 

https://www.ixsystems.com/community/threads/activating-plex-hardware-acceleration.75391/#post-545237

 

Looks like beta release will start in Dec.

https://redmine.ixsystems.com/versions/467

 

 

unfortunately this is not the current roadmap.

Share this post


Link to post
Share on other sites
bizarro252

unfortunately this is not the current roadmap.

Hi, what do you mean?  Do I have the wrong/old link?

Thanks

Share this post


Link to post
Share on other sites
Baenwort

So, at least according to this, where they are discussing enabling it on Plex, it needs to be on FreeBSD 12, so we (FreeNAS users anyways) may just have to wait.

 

https://www.ixsystems.com/community/threads/activating-plex-hardware-acceleration.75391/#post-545237

 

Looks like beta release will start in Dec.

https://redmine.ixsystems.com/versions/467

 

So according to the post at the bottom he got it working on 11.3 which we are now upto on FreeNAS. https://www.ixsystems.com/community/threads/activating-plex-hardware-acceleration.75391/post-551470

 

Anyone had any success? 

Share this post


Link to post
Share on other sites
Duffyx
Posted (edited)

I haven't gotten this to work on FreeBSD 12-STABLE and since recently I'm on FreeBSD 13 (head) so I'm happy to test anything. ATM I can only tell that its not working because of the way Emby detects hardware transcoding features with ffdetect. I have everything loaded correctly, vainfo shows all available entries for VAAPI, etc.

root@emby:/usr/local/lib/emby-server/bin # su -m emby -c "./ffdetect vaenc"
ffdetect version 4.3.0-emby_2019_11_09 Copyright (c) 2018-2019 softworkz for Emby LLC
  built with gcc 9.2.0 (FreeBSD Ports Collection)
  configuration: --cc=gcc --prefix=/usr/home/embybuilder/Buildbot-master/x64_freebsd12/ffdetect-x64_freebsd12/staging --pkg-config=pkg-config --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-vdpau --enable-vaapi --extra-libs='-ldrm -lva -lva-drm -ldl -lm -lpthread' --arch=x86_64 --disable-shared --enable-static
  libavutil      56. 34.100 / 56. 34.100
root@emby:/usr/local/lib/emby-server/bin # su -m emby -c "./ffdetect vadec"
ffdetect version 4.3.0-emby_2019_11_09 Copyright (c) 2018-2019 softworkz for Emby LLC
  built with gcc 9.2.0 (FreeBSD Ports Collection)
  configuration: --cc=gcc --prefix=/usr/home/embybuilder/Buildbot-master/x64_freebsd12/ffdetect-x64_freebsd12/staging --pkg-config=pkg-config --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-vdpau --enable-vaapi --extra-libs='-ldrm -lva -lva-drm -ldl -lm -lpthread' --arch=x86_64 --disable-shared --enable-static
  libavutil      56. 34.100 / 56. 34.100
root@emby:/usr/local/lib/emby-server/bin # su -m emby -c "./ffdetect vaencdec"
ffdetect version 4.3.0-emby_2019_11_09 Copyright (c) 2018-2019 softworkz for Emby LLC
  built with gcc 9.2.0 (FreeBSD Ports Collection)
  configuration: --cc=gcc --prefix=/usr/home/embybuilder/Buildbot-master/x64_freebsd12/ffdetect-x64_freebsd12/staging --pkg-config=pkg-config --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-vdpau --enable-vaapi --extra-libs='-ldrm -lva -lva-drm -ldl -lm -lpthread' --arch=x86_64 --disable-shared --enable-static
  libavutil      56. 34.100 / 56. 34.100
root@emby:/usr/local/lib/emby-server/bin # su -m emby -c vainfo
libva info: VA-API version 1.6.0
libva info: Trying to open /usr/local/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_6
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.6 (libva 2.6.0.0)
vainfo: Driver version: Intel iHD driver - 19.4.0
vainfo: Supported profile and entrypoints
      VAProfileNone                   : VAEntrypointVideoProc
      VAProfileNone                   : VAEntrypointStats
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Simple            : VAEntrypointEncSlice
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointFEI
      VAProfileH264Main               : VAEntrypointEncSliceLP
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointFEI
      VAProfileH264High               : VAEntrypointEncSliceLP
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointEncPicture
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline: VAEntrypointFEI
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
      VAProfileVP8Version0_3          : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointFEI
Edited by Duffyx
  • Like 1

Share this post


Link to post
Share on other sites
Luke

 

I haven't gotten this to work on FreeBSD 12-STABLE and since recently I'm on FreeBSD 13 (head) so I'm happy to test anything. ATM I can only tell that its not working because of the way Emby detects hardware transcoding features with ffdetect. I have everything loaded correctly, vainfo shows all available entries for VAAPI, etc.

root@emby:/usr/local/lib/emby-server/bin # su -m emby -c "./ffdetect vaenc"
ffdetect version 4.3.0-emby_2019_11_09 Copyright (c) 2018-2019 softworkz for Emby LLC
  built with gcc 9.2.0 (FreeBSD Ports Collection)
  configuration: --cc=gcc --prefix=/usr/home/embybuilder/Buildbot-master/x64_freebsd12/ffdetect-x64_freebsd12/staging --pkg-config=pkg-config --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-vdpau --enable-vaapi --extra-libs='-ldrm -lva -lva-drm -ldl -lm -lpthread' --arch=x86_64 --disable-shared --enable-static
  libavutil      56. 34.100 / 56. 34.100
root@emby:/usr/local/lib/emby-server/bin # su -m emby -c "./ffdetect vadec"
ffdetect version 4.3.0-emby_2019_11_09 Copyright (c) 2018-2019 softworkz for Emby LLC
  built with gcc 9.2.0 (FreeBSD Ports Collection)
  configuration: --cc=gcc --prefix=/usr/home/embybuilder/Buildbot-master/x64_freebsd12/ffdetect-x64_freebsd12/staging --pkg-config=pkg-config --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-vdpau --enable-vaapi --extra-libs='-ldrm -lva -lva-drm -ldl -lm -lpthread' --arch=x86_64 --disable-shared --enable-static
  libavutil      56. 34.100 / 56. 34.100
root@emby:/usr/local/lib/emby-server/bin # su -m emby -c "./ffdetect vaencdec"
ffdetect version 4.3.0-emby_2019_11_09 Copyright (c) 2018-2019 softworkz for Emby LLC
  built with gcc 9.2.0 (FreeBSD Ports Collection)
  configuration: --cc=gcc --prefix=/usr/home/embybuilder/Buildbot-master/x64_freebsd12/ffdetect-x64_freebsd12/staging --pkg-config=pkg-config --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-vdpau --enable-vaapi --extra-libs='-ldrm -lva -lva-drm -ldl -lm -lpthread' --arch=x86_64 --disable-shared --enable-static
  libavutil      56. 34.100 / 56. 34.100
root@emby:/usr/local/lib/emby-server/bin # su -m emby -c vainfo
libva info: VA-API version 1.6.0
libva info: Trying to open /usr/local/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_6
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.6 (libva 2.6.0.0)
vainfo: Driver version: Intel iHD driver - 19.4.0
vainfo: Supported profile and entrypoints
      VAProfileNone                   : VAEntrypointVideoProc
      VAProfileNone                   : VAEntrypointStats
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Simple            : VAEntrypointEncSlice
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointFEI
      VAProfileH264Main               : VAEntrypointEncSliceLP
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointFEI
      VAProfileH264High               : VAEntrypointEncSliceLP
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointEncPicture
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline: VAEntrypointFEI
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
      VAProfileVP8Version0_3          : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointFEI

 

Can you provide the hardware detection log? thanks.

Share this post


Link to post
Share on other sites
Luke

Did you install using the freenas plugin?

Share this post


Link to post
Share on other sites
Duffyx

I'm on native FreeBSD. If it doesnt work there I doubt it will work on FreeNAS. I installed through FreeBSD ports.

Share this post


Link to post
Share on other sites
bingemeister

I'm having the same issue with my FreeBSD server. Hardware acceleration works perfectly when using ffmpeg directly but ffdetect seems to have some issues with my system.

 

Is it in any way possible to force emby to use hardware acceleration regardless of what ffdetect reports?

 

Output of ffdetect:

# /usr/local/lib/emby-server/bin/ffdetect -hide_banner -show_program_version -loglevel 48 -show_error -show_log 40 vaencdec -print_format json
ffdetect version 4.3.0-emby_2019_11_09 Copyright (c) 2018-2019 softworkz for Emby LLC
  built with gcc 9.2.0 (FreeBSD Ports Collection)
  configuration: --cc=gcc --prefix=/usr/home/embybuilder/Buildbot-master/x64_freebsd12/ffdetect-x64_freebsd12/staging --pkg-config=pkg-config --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-vdpau --enable-vaapi --extra-libs='-ldrm -lva -lva-drm -ldl -lm -lpthread' --arch=x86_64 --disable-shared --enable-static
  libavutil      56. 34.100 / 56. 34.100
{
    "ProgramVersion": {
        "Version": "4.3.0-emby_2019_11_09",
        "Copyright": "Copyright (c) 2018-2019 softworkz for Emby Llc",
        "Compiler": "gcc 9.2.0 (FreeBSD Ports Collection)",
        "Configuration": "--cc=gcc --prefix=/usr/home/embybuilder/Buildbot-master/x64_freebsd12/ffdetect-x64_freebsd12/staging --pkg-config=pkg-config --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-vdpau --enable-vaapi --extra-libs='-ldrm -lva -lva-drm -ldl -lm -lpthread' --arch=x86_64 --disable-shared --enable-static"
    },
    "Devices": [
Begin GetVaAdapterInfo
Found -1 device entries
End GetVaAdapterInfo

    ],
    "Log": [
        {
            "Level": 40,
            "Category": 0,
            "Message": "Found -1 device entries"
        }
    ]
}

Output of vainfo:

# vainfo
error: XDG_RUNTIME_DIR not set in the environment.
error: can't connect to X server!
libva info: VA-API version 1.6.0
libva info: Trying to open /usr/local/lib/dri/iHD_drv_video.so
libva info: va_openDriver() returns -1
libva info: Trying to open /usr/local/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_6
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.6 (libva 2.6.0.0)
vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Server - 2.4.0
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Simple            :	VAEntrypointEncSlice
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSlice
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointEncSlice
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointEncSlice
      VAProfileH264MultiviewHigh      :	VAEntrypointVLD
      VAProfileH264MultiviewHigh      :	VAEntrypointEncSlice
      VAProfileH264StereoHigh         :	VAEntrypointVLD
      VAProfileH264StereoHigh         :	VAEntrypointEncSlice
      VAProfileVC1Simple              :	VAEntrypointVLD
      VAProfileVC1Main                :	VAEntrypointVLD
      VAProfileVC1Advanced            :	VAEntrypointVLD
      VAProfileNone                   :	VAEntrypointVideoProc
      VAProfileJPEGBaseline           :	VAEntrypointVLD

Share this post


Link to post
Share on other sites
Luke

It's not that simple. If ffdetect can't use it, then neither will our embedded ffmpeg builds, so it's not a matter of hacking the detection. We're still trying to figure out what's going on. Thanks.

Share this post


Link to post
Share on other sites
bingemeister

Hm I understand. If there is any information I could provide you with to help you investigate this, please let me know.

Share this post


Link to post
Share on other sites
Luke

We're looking to hire someone from the FreeBSD community who can help us with this.

Share this post


Link to post
Share on other sites
bingemeister

If it helps you to debug the issue I can offer you full SSH access to my server.

  • Like 1

Share this post


Link to post
Share on other sites
Duffyx
Posted (edited)

Luke, could the ffdetect developer use the SSH access? This can help but might be quite intensive.

But when adding enough debug statements in the ffdetect binary, output can be compared between a Linux and FreeBSD machine in between functions.

Edited by Duffyx

Share this post


Link to post
Share on other sites
Luke

Luke, could the ffdetect developer use the SSH access? This can help but might be quite intensive.

But when adding enough debug statements in the ffdetect binary, output can be compared between a Linux and FreeBSD machine in between functions.

 

If you're offering to provide a machine, thank you very much, although once we find a FreeBsd developer we'll make sure they have a local environment for this. Thanks.

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...