Jump to content

Enable hardware acceleration on FreeBSD


Duffyx

Recommended Posts

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

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
Link to post
Share on other sites

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.

Link to post
Share on other sites
  • 6 months later...
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? 

Link to post
Share on other sites

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
Link to post
Share on other sites

 

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.

Link to post
Share on other sites

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

Link to post
Share on other sites
  • 2 weeks later...
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
Link to post
Share on other sites

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.

Link to post
Share on other sites
  • 1 month later...

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
Link to post
Share on other sites

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
Link to post
Share on other sites
  • 2 months later...

Just found this thread. Now that TrueNAS Core is in beta and using FreeBSD 12, I think future development should be done on this platform. TrueNAS Core is replacing FreeNAS.

Edited by dcol
Link to post
Share on other sites
On 7/16/2020 at 12:35 PM, dcol said:

TrueNAS Core is replacing FreeNAS.

FreeNAS is getting a rebrand not really replaced. This isn't a completely new platform. Even today FreeNAS/TrueNAS are over 95% identical with the difference being a few added features for enterprise control. Although with FreeBSD 12 this theoretically should now be possible, and if it is I'm going to go out and spend a whole lot of money on a shiny new GPU :D

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...