Hardware Acceleration Issue [Nvidia Windows]

I have an issue where I am unable to consistently get the option to use hardware acceleration as part of my DVR.

My Setup:

  • ESXI 6.0 host
  • Windows 8.1 Guest
  • Nvidia GT 710 video card w/ direct I/O passthrough to guest OS (GPU is recognized by guest)

Here are the scenarios:

  1. Fresh install of Channels DVR to system tray: No option to select HW transcoding, SW transcoding is used
  2. Reboot of Windows 8.1 with Channels DVR to system tray: No option to select HW transcoding, SW transcoding is used
  3. After Channels DVR install to systray, select option to run Channels DVR as Windows Service: HW transcoding is available as an option, and selected - used successfully.
  4. Reboot Windows 8.1 Guest with Channels DVR installed as a service, SW transcoding is only option available.

In any of these scenarios, if I uninstall channels DVR, then reinstall to systray and then install as service; or uninstall the service, then reinstall the service the HW transcoding option becomes available only after I am able to install freshly as a windows service.

Any help on how I can get HW transcoding to be available persistently after every reboot?

Thanks…

That’s weird. When the hardware option shows up and you select it, does the web player work?

Yes. The web player does work. Just verified it.

HW transcoding was enabled and was able to watch NFL Network via the web player.

Let me know how else I can help. This issue is consistently reproducible with my setup.

Hmm ok. When the DVR starts up, it tries to use the hardware encoder. If it works, the option is enabled. So I guess for some reason it’s not working reliably when the DVR starts. I’ll try to add some debug logging so we can figure out where it’s failing.

Thanks…

@tmm1 - Any updates on getting to the bottom of this issue? It is a bit annoying after every restart having to stop the DVR service, remove the DVR service and then reinstall the service as a way to get HW transcoding available. This should hopefully be easy to debug since it is consistently reproducible on my setup.

Please let me know how I can help. Thanks.

FWIW, I experience a similar issue on Mac OS. However, I simply restart the DVR and that usually corrects the problem. Sometimes, I have to restart it more than once before HW transcoding is detected and selected. I’ve never had to uninstall the DVR to fix the issue.

For me, I rarely restart the Mac Mini that it is running on so it’s only a minor nuisance.

I spent most the day yesterday working on this. There’s a new prerelease build with debugging available.

Please first upgrade, by holding down SHIFT on the keyboard and clicking Check For Updates.

Then run this in PowerShell and copy/paste the new “HWE” entries that appear on the log:

iwr -usebasicparsing -method post http://127.0.01:8089/hls/hwaccel

Thanks! Here’s the results:

1. Output #1 - Running the PowerShell command after a fresh boot and having the DVR run as a Windows Service. This is the scenario where where HWE is not available and Software is the only option shown:

2017/12/21 13:14:37 [SYS] Starting Channels DVR v2017.12.21.0720 (windows-x86_64) in C:\ProgramData\ChannelsDVR\data
2017/12/21 13:14:37 [SYS] Running as a Windows system service.
2017/12/21 13:15:55 [HDR] Found 2 devices
2017/12/21 13:15:57 [SYS] Started HTTP Server
2017/12/21 13:19:29 [DVR] Recording engine started in D:\Channels DVR
2017/12/21 13:19:29 [SYS] Bonjour service running for dvr-wmc.local. [192.168.1.5]
2017/12/21 13:19:29 [SYS] Created database snapshot: backup-20171221.131929
2017/12/21 13:19:39 [IDX] Pruned 0 expired airings from USA-IL68236-X in 63.9908ms.
2017/12/21 13:23:52 [HWE] Trying C:\ProgramData\ChannelsDVR\latest\ffmpeg.exe C:\ProgramData\ChannelsDVR\latest\ffmpeg.exe -hide_banner -nostats -loglevel warning -loglevel verbose -f lavfi -t 0.1 -i color=black:640x480 -c:v h264_mf -profile:v high -level 42 -b:v 400k -maxrate:v 600k -f null -y nul
[Parsed_color_0 @ 0000000000637d00] size:640x480 rate:25/1 duration:-1.000000 sar:1/1
Input #0, lavfi, from ‘color=black:640x480’:
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: rawvideo, 1 reference frame (I420 / 0x30323449), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (h264_mf))
Press [q] to stop, [?] for help
[graph 0 input from stream 0:0 @ 0000000001e601c0] w:640 h:480 pixfmt:yuv420p tb:1/25 fr:25/1 sar:1/1 sws_param:flags=2
[auto_scaler_0 @ 0000000001e609e0] w:iw h:ih flags:‘bicubic’ interl:0
[format @ 0000000001e60420] auto-inserting filter ‘auto_scaler_0’ between the filter ‘Parsed_null_0’ and the filter ‘format’
[auto_scaler_0 @ 0000000001e609e0] w:640 h:480 fmt:yuv420p sar:1/1 -> w:640 h:480 fmt:nv12 sar:1/1 flags:0x4
[h264_mf @ 0000000000a59a40] could not find any MFT for the given media type
[h264_mf @ 0000000000a59a40] could not create MFT
Error initializing output stream 0:0 – Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!
2017/12/21 13:23:54 [HWE] Failure: exit status 1
2017/12/21 13:23:54 [HWE] Trying C:\ProgramData\ChannelsDVR\latest\ffmpeg.exe C:\ProgramData\ChannelsDVR\latest\ffmpeg.exe -hide_banner -nostats -loglevel warning -loglevel verbose -f lavfi -t 0.1 -i color=black:640x480 -c:v h264_nvenc -profile:v high -level 42 -b:v 400k -maxrate:v 600k -f null -y nul
[Parsed_color_0 @ 00000000003782e0] size:640x480 rate:25/1 duration:-1.000000 sar:1/1
Input #0, lavfi, from ‘color=black:640x480’:
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: rawvideo, 1 reference frame (I420 / 0x30323449), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (h264_nvenc))
Press [q] to stop, [?] for help
[graph 0 input from stream 0:0 @ 00000000014131e0] w:640 h:480 pixfmt:yuv420p tb:1/25 fr:25/1 sar:1/1 sws_param:flags=2
[h264_nvenc @ 0000000000a08bc0] Loaded Nvenc version 8.1
[h264_nvenc @ 0000000000a08bc0] Nvenc initialized successfully
[h264_nvenc @ 0000000000a08bc0] 1 CUDA capable devices found
[h264_nvenc @ 0000000000a08bc0] [ GPU #0 - < GeForce GT 710 > has Compute SM 3.5 ]
2017/12/21 13:23:57 [HWE] Killing ffmpeg after 3s timeout…
2017/12/21 13:23:57 [HWE] Failure: exit status 1
2017/12/21 13:23:57 [HWE] Trying C:\ProgramData\ChannelsDVR\latest\ffmpeg.exe C:\ProgramData\ChannelsDVR\latest\ffmpeg.exe -hide_banner -nostats -loglevel warning -loglevel verbose -f lavfi -t 0.1 -i color=black:640x480 -c:v h264_qsv -profile:v high -level 42 -b:v 400k -maxrate:v 600k -f null -y nul
[Parsed_color_0 @ 00000000003182e0] size:640x480 rate:25/1 duration:-1.000000 sar:1/1
Input #0, lavfi, from ‘color=black:640x480’:
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: rawvideo, 1 reference frame (I420 / 0x30323449), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (h264_qsv))
Press [q] to stop, [?] for help
[graph 0 input from stream 0:0 @ 00000000013c3ba0] w:640 h:480 pixfmt:yuv420p tb:1/25 fr:25/1 sar:1/1 sws_param:flags=2
[auto_scaler_0 @ 00000000013c3860] w:iw h:ih flags:‘bicubic’ interl:0
[format @ 00000000013c3920] auto-inserting filter ‘auto_scaler_0’ between the filter ‘Parsed_null_0’ and the filter ‘format’
[auto_scaler_0 @ 00000000013c3860] w:640 h:480 fmt:yuv420p sar:1/1 -> w:640 h:480 fmt:nv12 sar:1/1 flags:0x4
[h264_qsv @ 00000000009b7880] Error initializing an internal MFX session: unsupported (-3)
Error initializing output stream 0:0 – Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!
2017/12/21 13:23:57 [HWE] Failure: exit status 1
2017/12/21 13:23:57 [HWE] Trying C:\ProgramData\ChannelsDVR\latest\ffmpeg.exe C:\ProgramData\ChannelsDVR\latest\ffmpeg.exe -hide_banner -nostats -loglevel warning -loglevel verbose -f lavfi -t 0.1 -i color=black:640x480 -c:v h264_qsv -profile:v high -level 42 -b:v 400k -maxrate:v 600k -look_ahead 0 -f null -y nul
[Parsed_color_0 @ 00000000003e8380] size:640x480 rate:25/1 duration:-1.000000 sar:1/1
Input #0, lavfi, from ‘color=black:640x480’:
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: rawvideo, 1 reference frame (I420 / 0x30323449), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (h264_qsv))
Press [q] to stop, [?] for help
[graph 0 input from stream 0:0 @ 00000000013c3100] w:640 h:480 pixfmt:yuv420p tb:1/25 fr:25/1 sar:1/1 sws_param:flags=2
[auto_scaler_0 @ 00000000013c3ee0] w:iw h:ih flags:‘bicubic’ interl:0
[format @ 00000000013c3380] auto-inserting filter ‘auto_scaler_0’ between the filter ‘Parsed_null_0’ and the filter ‘format’
[auto_scaler_0 @ 00000000013c3ee0] w:640 h:480 fmt:yuv420p sar:1/1 -> w:640 h:480 fmt:nv12 sar:1/1 flags:0x4
[h264_qsv @ 00000000009b8520] Error initializing an internal MFX session: unsupported (-3)
Error initializing output stream 0:0 – Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!
2017/12/21 13:23:57 [HWE] Failure: exit status 1
2017/12/21 13:24:51 [HWE] Trying C:\ProgramData\ChannelsDVR\latest\ffmpeg.exe C:\ProgramData\ChannelsDVR\latest\ffmpeg.exe -hide_banner -nostats -loglevel warning -loglevel verbose -f lavfi -t 0.1 -i color=black:640x480 -c:v h264_mf -profile:v high -level 42 -b:v 400k -maxrate:v 600k -f null -y nul
[Parsed_color_0 @ 00000000005682c0] size:640x480 rate:25/1 duration:-1.000000 sar:1/1
Input #0, lavfi, from ‘color=black:640x480’:
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: rawvideo, 1 reference frame (I420 / 0x30323449), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (h264_mf))
Press [q] to stop, [?] for help
[graph 0 input from stream 0:0 @ 0000000001e40840] w:640 h:480 pixfmt:yuv420p tb:1/25 fr:25/1 sar:1/1 sws_param:flags=2
[auto_scaler_0 @ 0000000001e409e0] w:iw h:ih flags:‘bicubic’ interl:0
[format @ 0000000001e40900] auto-inserting filter ‘auto_scaler_0’ between the filter ‘Parsed_null_0’ and the filter ‘format’
[auto_scaler_0 @ 0000000001e409e0] w:640 h:480 fmt:yuv420p sar:1/1 -> w:640 h:480 fmt:nv12 sar:1/1 flags:0x4
[h264_mf @ 0000000000a36ee0] could not find any MFT for the given media type
[h264_mf @ 0000000000a36ee0] could not create MFT
Error initializing output stream 0:0 – Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!
2017/12/21 13:24:51 [HWE] Failure: exit status 1
2017/12/21 13:24:51 [HWE] Trying C:\ProgramData\ChannelsDVR\latest\ffmpeg.exe C:\ProgramData\ChannelsDVR\latest\ffmpeg.exe -hide_banner -nostats -loglevel warning -loglevel verbose -f lavfi -t 0.1 -i color=black:640x480 -c:v h264_nvenc -profile:v high -level 42 -b:v 400k -maxrate:v 600k -f null -y nul
[Parsed_color_0 @ 00000000004d85c0] size:640x480 rate:25/1 duration:-1.000000 sar:1/1
Input #0, lavfi, from ‘color=black:640x480’:
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: rawvideo, 1 reference frame (I420 / 0x30323449), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (h264_nvenc))
Press [q] to stop, [?] for help
[graph 0 input from stream 0:0 @ 00000000014a3520] w:640 h:480 pixfmt:yuv420p tb:1/25 fr:25/1 sar:1/1 sws_param:flags=2
[h264_nvenc @ 0000000000a98220] Loaded Nvenc version 8.1
[h264_nvenc @ 0000000000a98220] Nvenc initialized successfully
[h264_nvenc @ 0000000000a98220] 1 CUDA capable devices found
[h264_nvenc @ 0000000000a98220] [ GPU #0 - < GeForce GT 710 > has Compute SM 3.5 ]
[h264_nvenc @ 0000000000a98220] supports NVENC
Output #0, null, to ‘nul’:
Metadata:
encoder : Lavf57.71.100
Stream #0:0: Video: h264 (h264_nvenc) (High), 1 reference frame, yuv420p, 640x480 [SAR 1:1 DAR 4:3], q=-1–1, 400 kb/s, 25 fps, 25 tbn, 25 tbc
Metadata:
encoder : Lavc57.89.100 h264_nvenc
Side data:
cpb: bitrate max/min/avg: 600000/0/400000 buffer size: 800000 vbv_delay: -1
No more output streams to write to, finishing.
frame= 3 fps=1.8 q=25.0 Lsize=N/A time=00:00:00.12 bitrate=N/A speed=0.0702x
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Input file #0 (color=black:640x480):
Input stream #0:0 (video): 4 packets read (1843200 bytes); 4 frames decoded;
Total: 4 packets (1843200 bytes) demuxed
Output file #0 (nul):
Output stream #0:0 (video): 3 frames encoded; 3 packets muxed (171 bytes);
Total: 3 packets (171 bytes) muxed
[h264_nvenc @ 0000000000a98220] Nvenc unloaded

2. Output #2 - Running the PowerShell command after I have stopped the DVR service, removed the DVR service, and installed the DVR as a background service. This is the scenario where where HWE available:

2017/12/21 13:37:09 [SYS] Starting Channels DVR v2017.12.21.0720 (windows-x86_64) in C:\ProgramData\ChannelsDVR\data
2017/12/21 13:37:09 [SYS] Running as a Windows system service.
2017/12/21 13:37:11 [HDR] Found 2 devices
2017/12/21 13:37:12 [SYS] Started HTTP Server
2017/12/21 13:37:17 [DVR] Recording engine started in D:\Channels DVR
2017/12/21 13:37:17 [SYS] Bonjour service running for dvr-wmc.local. [192.168.1.5]
2017/12/21 13:37:17 [SYS] Created database snapshot: backup-20171221.133717
2017/12/21 13:37:28 [IDX] Pruned 150 expired airings from USA-IL68236-X in 744.0108ms.
2017/12/21 13:39:21 [HWE] Trying C:\ProgramData\ChannelsDVR\latest\ffmpeg.exe C:\ProgramData\ChannelsDVR\latest\ffmpeg.exe -hide_banner -nostats -loglevel warning -loglevel verbose -f lavfi -t 0.1 -i color=black:640x480 -c:v h264_mf -profile:v high -level 42 -b:v 400k -maxrate:v 600k -f null -y nul
[Parsed_color_0 @ 00000000005685a0] size:640x480 rate:25/1 duration:-1.000000 sar:1/1
Input #0, lavfi, from ‘color=black:640x480’:
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: rawvideo, 1 reference frame (I420 / 0x30323449), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (h264_mf))
Press [q] to stop, [?] for help
[graph 0 input from stream 0:0 @ 000000000098e780] w:640 h:480 pixfmt:yuv420p tb:1/25 fr:25/1 sar:1/1 sws_param:flags=2
[auto_scaler_0 @ 000000000098ee00] w:iw h:ih flags:‘bicubic’ interl:0
[format @ 000000000098e520] auto-inserting filter ‘auto_scaler_0’ between the filter ‘Parsed_null_0’ and the filter ‘format’
[auto_scaler_0 @ 000000000098ee00] w:640 h:480 fmt:yuv420p sar:1/1 -> w:640 h:480 fmt:nv12 sar:1/1 flags:0x4
[h264_mf @ 0000000000989a40] could not find any MFT for the given media type
[h264_mf @ 0000000000989a40] could not create MFT
Error initializing output stream 0:0 – Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!
2017/12/21 13:39:21 [HWE] Failure: exit status 1
2017/12/21 13:39:21 [HWE] Trying C:\ProgramData\ChannelsDVR\latest\ffmpeg.exe C:\ProgramData\ChannelsDVR\latest\ffmpeg.exe -hide_banner -nostats -loglevel warning -loglevel verbose -f lavfi -t 0.1 -i color=black:640x480 -c:v h264_nvenc -profile:v high -level 42 -b:v 400k -maxrate:v 600k -f null -y nul
[Parsed_color_0 @ 00000000006985c0] size:640x480 rate:25/1 duration:-1.000000 sar:1/1
Input #0, lavfi, from ‘color=black:640x480’:
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: rawvideo, 1 reference frame (I420 / 0x30323449), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (h264_nvenc))
Press [q] to stop, [?] for help
[graph 0 input from stream 0:0 @ 00000000015c3ee0] w:640 h:480 pixfmt:yuv420p tb:1/25 fr:25/1 sar:1/1 sws_param:flags=2
[h264_nvenc @ 0000000000628220] Loaded Nvenc version 8.1
[h264_nvenc @ 0000000000628220] Nvenc initialized successfully
[h264_nvenc @ 0000000000628220] 1 CUDA capable devices found
[h264_nvenc @ 0000000000628220] [ GPU #0 - < GeForce GT 710 > has Compute SM 3.5 ]
[h264_nvenc @ 0000000000628220] supports NVENC
Output #0, null, to ‘nul’:
Metadata:
encoder : Lavf57.71.100
Stream #0:0: Video: h264 (h264_nvenc) (High), 1 reference frame, yuv420p, 640x480 [SAR 1:1 DAR 4:3], q=-1–1, 400 kb/s, 25 fps, 25 tbn, 25 tbc
Metadata:
encoder : Lavc57.89.100 h264_nvenc
Side data:
cpb: bitrate max/min/avg: 600000/0/400000 buffer size: 800000 vbv_delay: -1
No more output streams to write to, finishing.
frame= 3 fps=0.0 q=25.0 Lsize=N/A time=00:00:00.12 bitrate=N/A speed=0.166x
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Input file #0 (color=black:640x480):
Input stream #0:0 (video): 4 packets read (1843200 bytes); 4 frames decoded;
Total: 4 packets (1843200 bytes) demuxed
Output file #0 (nul):
Output stream #0:0 (video): 3 frames encoded; 3 packets muxed (171 bytes);
Total: 3 packets (171 bytes) muxed
[h264_nvenc @ 0000000000628220] Nvenc unloaded

:point_up_2: This seems to be the problem.

Can you run this command and see how long it takes to complete:

C:\ProgramData\ChannelsDVR\latest\ffmpeg.exe -hide_banner -nostats -loglevel warning -loglevel verbose -f lavfi -t 0.1 -i color=black:640x480 -c:v h264_nvenc -profile:v high -level 42 -b:v 400k -maxrate:v 600k -f null -y nul

Just ran the command. It was very quick to complete. Probably < 1 second.

Hmmm. I guess it’s slower maybe when the system is otherwise busy.

I can try raising the timeout to 5s and make a new build for you to test.

Run this command to upgrade:

iwr -usebasicparsing -method put http://127.0.0.1:8089/updater/check/2017.12.21.2042

Upgraded to 2017.12.21.2042 and rebooted. Didn’t work. Only the SW transcoder shows as available. Once booted, I stopped and started the Channels DVR service via services.msc and the HW transcoder shows as available.

I agree that something during the boot sequence is probably bogging down the resources on my machine causing the HWE check to timeout during initial boot.

Okay I can probably disable the timeout for the NVIDIA encoder.

OK - FWIW, I also tried another test with this build where I set the Channels DVR service to have the Startup Type “Automatic (Delayed Start).” This was successful and I was able to get the HWE option to show up after a fresh boot.

1 Like

Try 2017.12.21.2221

Success with 2017.12.21.2221 - HWE displayed after fresh boot (I also reverted the Delayed Start back to normal).

1 Like

Great! Thanks for reporting and helping to test.

1 Like

My pleasure to help - keep up the great work and looking forward to what Channels has in store in the future!

1 Like