LizardByte / Sunshine

Self-hosted game stream host for Moonlight.
http://app.lizardbyte.dev/Sunshine/
GNU General Public License v3.0
17.7k stars 855 forks source link

Error: Could not open codec [h264_nvenc]: No such file or directory #872

Closed S3LL1G28 closed 10 months ago

S3LL1G28 commented 1 year ago

Is there an existing issue for this?

Is your issue described in the documentation?

Is your issue present in the nightly release?

Describe the Bug

Here is the error: Error: Could not open codec [h264_nvenc]: No such file or directory

So nividia couldn't be choose.

Expected Behavior

nvidia decoder is find and could be used

Additional Context

I've got a NVIDIA 1660 GTX 6Go. Installed as an egpu on sonnetch box. It is working with nvidia geforce experience. my dixdiag is working for catching nvidia name

c:\Program Files\Sunshine\tools>dxgi-info.exe ====== ADAPTER ===== Device Name : Intel(R) Iris(R) Xe Graphics Device Vendor ID : 0x00008086 Device Device ID : 0x00009A49 Device Video Mem : 128 MiB Device Sys Mem : 0 MiB Share Sys Mem : 3918 MiB

====== OUTPUT ======
Output Name       : \\.\DISPLAY1
AttachedToDesktop : yes
Resolution        : 1920x1080

====== ADAPTER ===== Device Name : NVIDIA GeForce GTX 1660 Device Vendor ID : 0x000010DE Device Device ID : 0x00002184 Device Video Mem : 5980 MiB Device Sys Mem : 0 MiB Share Sys Mem : 3918 MiB

====== OUTPUT ======

====== ADAPTER ===== Device Name : Microsoft Basic Render Driver Device Vendor ID : 0x00001414 Device Device ID : 0x0000008C Device Video Mem : 0 MiB Device Sys Mem : 0 MiB Share Sys Mem : 3918 MiB

====== OUTPUT ======

Host Operating System

Windows

Operating System Version

windows 11

Architecture

64 bit

Sunshine commit or version

0.18.0

Package

Windows - installer

GPU Type

Nvidia

GPU Model

NVIDIA GeForce GTX 1660

GPU Driver/Mesa Version

528.02

Capture Method (Linux Only)

No response

Relevant log output

LOGS:

[2023:01:31:13:35:40]: Info: Compiling shaders...
[2023:01:31:13:35:40]: Info: Compiled shaders
[2023:01:31:13:35:40]: Warning: Couldn't setup connection to ViGEm for gamepad support [E0000001]
[2023:01:31:13:35:40]: Info: // Testing for available encoders, this may generate errors. You can safely ignore those errors. //
[2023:01:31:13:35:40]: Info: Trying encoder [nvenc]
[2023:01:31:13:35:40]: Info: ddprobe.exe [1] [] returned: 0x00000000
[2023:01:31:13:35:40]: Info: Set GPU preference: 1
[2023:01:31:13:35:40]: Info: 
Device Description : Intel(R) Iris(R) Xe Graphics
Device Vendor ID   : 0x00008086
Device Device ID   : 0x00009A49
Device Video Mem   : 128 MiB
Device Sys Mem     : 0 MiB
Share Sys Mem      : 3918 MiB
Feature Level      : 0x0000B100
Capture size       : 1920x1080
Offset             : 0x0
Virtual Desktop    : 1920x1080
[2023:01:31:13:35:40]: Info: Desktop resolution [1920x1080]
[2023:01:31:13:35:40]: Info: Desktop format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2023:01:31:13:35:40]: Info: 
Colorspace         : DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
Bits Per Color     : 8
Red Primary        : [0.639648,0.330078]
Green Primary      : [0.299805,0.599609]
Blue Primary       : [0.149414,0.0595703]
White Point        : [0.3125,0.329102]
Min Luminance      : 0.5 nits
Max Luminance      : 270 nits
Max Full Luminance : 270 nits
[2023:01:31:13:35:40]: Info: SDR color coding [Rec. 601]
[2023:01:31:13:35:40]: Info: Color range: [JPEG]
[2023:01:31:13:35:40]: Error: Could not open codec [h264_nvenc]: No such file or directory
[2023:01:31:13:35:40]: Info: 
Device Description : Intel(R) Iris(R) Xe Graphics
Device Vendor ID   : 0x00008086
Device Device ID   : 0x00009A49
Device Video Mem   : 128 MiB
Device Sys Mem     : 0 MiB
Share Sys Mem      : 3918 MiB
Feature Level      : 0x0000B100
Capture size       : 1920x1080
Offset             : 0x0
Virtual Desktop    : 1920x1080
[2023:01:31:13:35:40]: Info: Desktop resolution [1920x1080]
[2023:01:31:13:35:40]: Info: Desktop format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2023:01:31:13:35:40]: Info: 
Colorspace         : DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
Bits Per Color     : 8
Red Primary        : [0.639648,0.330078]
Green Primary      : [0.299805,0.599609]
Blue Primary       : [0.149414,0.0595703]
White Point        : [0.3125,0.329102]
Min Luminance      : 0.5 nits
Max Luminance      : 270 nits
Max Full Luminance : 270 nits
[2023:01:31:13:35:40]: Info: SDR color coding [Rec. 601]
[2023:01:31:13:35:40]: Info: Color range: [JPEG]
[2023:01:31:13:35:40]: Error: Could not open codec [h264_nvenc]: No such file or directory
[2023:01:31:13:35:40]: Info: 
Device Description : Intel(R) Iris(R) Xe Graphics
Device Vendor ID   : 0x00008086
Device Device ID   : 0x00009A49
Device Video Mem   : 128 MiB
Device Sys Mem     : 0 MiB
Share Sys Mem      : 3918 MiB
Feature Level      : 0x0000B100
Capture size       : 1920x1080
Offset             : 0x0
Virtual Desktop    : 1920x1080
[2023:01:31:13:35:40]: Info: Desktop resolution [1920x1080]
[2023:01:31:13:35:40]: Info: Desktop format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2023:01:31:13:35:40]: Info: 
Colorspace         : DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
Bits Per Color     : 8
Red Primary        : [0.639648,0.330078]
Green Primary      : [0.299805,0.599609]
Blue Primary       : [0.149414,0.0595703]
White Point        : [0.3125,0.329102]
Min Luminance      : 0.5 nits
Max Luminance      : 270 nits
Max Full Luminance : 270 nits
[2023:01:31:13:35:40]: Info: SDR color coding [Rec. 601]
[2023:01:31:13:35:40]: Info: Color range: [JPEG]
[2023:01:31:13:35:40]: Error: Could not open codec [h264_nvenc]: No such file or directory
[2023:01:31:13:35:40]: Info: 
Device Description : Intel(R) Iris(R) Xe Graphics
Device Vendor ID   : 0x00008086
Device Device ID   : 0x00009A49
Device Video Mem   : 128 MiB
Device Sys Mem     : 0 MiB
Share Sys Mem      : 3918 MiB
Feature Level      : 0x0000B100
Capture size       : 1920x1080
Offset             : 0x0
Virtual Desktop    : 1920x1080
[2023:01:31:13:35:40]: Info: Desktop resolution [1920x1080]
[2023:01:31:13:35:40]: Info: Desktop format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2023:01:31:13:35:40]: Info: 
Colorspace         : DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
Bits Per Color     : 8
Red Primary        : [0.639648,0.330078]
Green Primary      : [0.299805,0.599609]
Blue Primary       : [0.149414,0.0595703]
White Point        : [0.3125,0.329102]
Min Luminance      : 0.5 nits
Max Luminance      : 270 nits
Max Full Luminance : 270 nits
[2023:01:31:13:35:40]: Info: SDR color coding [Rec. 601]
[2023:01:31:13:35:40]: Info: Color range: [JPEG]
[2023:01:31:13:35:40]: Error: Could not open codec [h264_nvenc]: No such file or directory
[2023:01:31:13:35:40]: Info: Encoder [nvenc] failed
[2023:01:31:13:35:40]: Info: Trying encoder [quicksync]
[2023:01:31:13:35:40]: Info: 
Device Description : Intel(R) Iris(R) Xe Graphics
Device Vendor ID   : 0x00008086
Device Device ID   : 0x00009A49
Device Video Mem   : 128 MiB
Device Sys Mem     : 0 MiB
Share Sys Mem      : 3918 MiB
Feature Level      : 0x0000B100
Capture size       : 1920x1080
Offset             : 0x0
Virtual Desktop    : 1920x1080
[2023:01:31:13:35:40]: Info: Desktop resolution [1920x1080]
[2023:01:31:13:35:40]: Info: Desktop format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2023:01:31:13:35:40]: Info: 
Colorspace         : DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
Bits Per Color     : 8
Red Primary        : [0.639648,0.330078]
Green Primary      : [0.299805,0.599609]
Blue Primary       : [0.149414,0.0595703]
White Point        : [0.3125,0.329102]
Min Luminance      : 0.5 nits
Max Luminance      : 270 nits
Max Full Luminance : 270 nits
[2023:01:31:13:35:40]: Info: SDR color coding [Rec. 601]
[2023:01:31:13:35:40]: Info: Color range: [JPEG]
[2023:01:31:13:35:40]: Info: 
Device Description : Intel(R) Iris(R) Xe Graphics
Device Vendor ID   : 0x00008086
Device Device ID   : 0x00009A49
Device Video Mem   : 128 MiB
Device Sys Mem     : 0 MiB
Share Sys Mem      : 3918 MiB
Feature Level      : 0x0000B100
Capture size       : 1920x1080
Offset             : 0x0
Virtual Desktop    : 1920x1080
[2023:01:31:13:35:40]: Info: Desktop resolution [1920x1080]
[2023:01:31:13:35:40]: Info: Desktop format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2023:01:31:13:35:40]: Info: 
Colorspace         : DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
Bits Per Color     : 8
Red Primary        : [0.639648,0.330078]
Green Primary      : [0.299805,0.599609]
Blue Primary       : [0.149414,0.0595703]
White Point        : [0.3125,0.329102]
Min Luminance      : 0.5 nits
Max Luminance      : 270 nits
Max Full Luminance : 270 nits
[2023:01:31:13:35:40]: Info: SDR color coding [Rec. 601]
[2023:01:31:13:35:40]: Info: Color range: [JPEG]
[2023:01:31:13:35:40]: Info: 
Device Description : Intel(R) Iris(R) Xe Graphics
Device Vendor ID   : 0x00008086
Device Device ID   : 0x00009A49
Device Video Mem   : 128 MiB
Device Sys Mem     : 0 MiB
Share Sys Mem      : 3918 MiB
Feature Level      : 0x0000B100
Capture size       : 1920x1080
Offset             : 0x0
Virtual Desktop    : 1920x1080
[2023:01:31:13:35:40]: Info: Desktop resolution [1920x1080]
[2023:01:31:13:35:40]: Info: Desktop format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2023:01:31:13:35:40]: Info: 
Colorspace         : DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
Bits Per Color     : 8
Red Primary        : [0.639648,0.330078]
Green Primary      : [0.299805,0.599609]
Blue Primary       : [0.149414,0.0595703]
White Point        : [0.3125,0.329102]
Min Luminance      : 0.5 nits
Max Luminance      : 270 nits
Max Full Luminance : 270 nits
[2023:01:31:13:35:40]: Info: SDR color coding [Rec. 601]
[2023:01:31:13:35:40]: Info: Color range: [JPEG]
[2023:01:31:13:35:41]: Info: 
Device Description : Intel(R) Iris(R) Xe Graphics
Device Vendor ID   : 0x00008086
Device Device ID   : 0x00009A49
Device Video Mem   : 128 MiB
Device Sys Mem     : 0 MiB
Share Sys Mem      : 3918 MiB
Feature Level      : 0x0000B100
Capture size       : 1920x1080
Offset             : 0x0
Virtual Desktop    : 1920x1080
[2023:01:31:13:35:41]: Info: Desktop resolution [1920x1080]
[2023:01:31:13:35:41]: Info: Desktop format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2023:01:31:13:35:41]: Info: 
Colorspace         : DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
Bits Per Color     : 8
Red Primary        : [0.639648,0.330078]
Green Primary      : [0.299805,0.599609]
Blue Primary       : [0.149414,0.0595703]
White Point        : [0.3125,0.329102]
Min Luminance      : 0.5 nits
Max Luminance      : 270 nits
Max Full Luminance : 270 nits
[2023:01:31:13:35:41]: Info: SDR color coding [Rec. 601]
[2023:01:31:13:35:41]: Info: Color range: [JPEG]
[2023:01:31:13:35:41]: Info: 
Device Description : Intel(R) Iris(R) Xe Graphics
Device Vendor ID   : 0x00008086
Device Device ID   : 0x00009A49
Device Video Mem   : 128 MiB
Device Sys Mem     : 0 MiB
Share Sys Mem      : 3918 MiB
Feature Level      : 0x0000B100
Capture size       : 1920x1080
Offset             : 0x0
Virtual Desktop    : 1920x1080
[2023:01:31:13:35:41]: Info: Desktop resolution [1920x1080]
[2023:01:31:13:35:41]: Info: Desktop format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2023:01:31:13:35:41]: Info: 
Colorspace         : DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
Bits Per Color     : 8
Red Primary        : [0.639648,0.330078]
Green Primary      : [0.299805,0.599609]
Blue Primary       : [0.149414,0.0595703]
White Point        : [0.3125,0.329102]
Min Luminance      : 0.5 nits
Max Luminance      : 270 nits
Max Full Luminance : 270 nits
[2023:01:31:13:35:41]: Info: SDR color coding [Rec. 601]
[2023:01:31:13:35:41]: Info: Color range: [JPEG]
[2023:01:31:13:35:41]: Info: 
Device Description : Intel(R) Iris(R) Xe Graphics
Device Vendor ID   : 0x00008086
Device Device ID   : 0x00009A49
Device Video Mem   : 128 MiB
Device Sys Mem     : 0 MiB
Share Sys Mem      : 3918 MiB
Feature Level      : 0x0000B100
Capture size       : 1920x1080
Offset             : 0x0
Virtual Desktop    : 1920x1080
[2023:01:31:13:35:41]: Info: Desktop resolution [1920x1080]
[2023:01:31:13:35:41]: Info: Desktop format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2023:01:31:13:35:41]: Info: 
Colorspace         : DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
Bits Per Color     : 8
Red Primary        : [0.639648,0.330078]
Green Primary      : [0.299805,0.599609]
Blue Primary       : [0.149414,0.0595703]
White Point        : [0.3125,0.329102]
Min Luminance      : 0.5 nits
Max Luminance      : 270 nits
Max Full Luminance : 270 nits
[2023:01:31:13:35:41]: Info: SDR color coding [Rec. 709]
[2023:01:31:13:35:41]: Info: Color range: [JPEG]
[2023:01:31:13:35:41]: Error: Could not open codec [h264_qsv]: Function not implemented
[2023:01:31:13:35:41]: Info: 
Device Description : Intel(R) Iris(R) Xe Graphics
Device Vendor ID   : 0x00008086
Device Device ID   : 0x00009A49
Device Video Mem   : 128 MiB
Device Sys Mem     : 0 MiB
Share Sys Mem      : 3918 MiB
Feature Level      : 0x0000B100
Capture size       : 1920x1080
Offset             : 0x0
Virtual Desktop    : 1920x1080
[2023:01:31:13:35:41]: Info: Desktop resolution [1920x1080]
[2023:01:31:13:35:41]: Info: Desktop format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2023:01:31:13:35:41]: Info: 
Colorspace         : DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
Bits Per Color     : 8
Red Primary        : [0.639648,0.330078]
Green Primary      : [0.299805,0.599609]
Blue Primary       : [0.149414,0.0595703]
White Point        : [0.3125,0.329102]
Min Luminance      : 0.5 nits
Max Luminance      : 270 nits
Max Full Luminance : 270 nits
[2023:01:31:13:35:41]: Info: SDR color coding [Rec. 709]
[2023:01:31:13:35:41]: Info: Color range: [JPEG]
[2023:01:31:13:35:41]: Info: 
Device Description : Intel(R) Iris(R) Xe Graphics
Device Vendor ID   : 0x00008086
Device Device ID   : 0x00009A49
Device Video Mem   : 128 MiB
Device Sys Mem     : 0 MiB
Share Sys Mem      : 3918 MiB
Feature Level      : 0x0000B100
Capture size       : 1920x1080
Offset             : 0x0
Virtual Desktop    : 1920x1080
[2023:01:31:13:35:41]: Info: Desktop resolution [1920x1080]
[2023:01:31:13:35:41]: Info: Desktop format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2023:01:31:13:35:41]: Info: 
Colorspace         : DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
Bits Per Color     : 8
Red Primary        : [0.639648,0.330078]
Green Primary      : [0.299805,0.599609]
Blue Primary       : [0.149414,0.0595703]
White Point        : [0.3125,0.329102]
Min Luminance      : 0.5 nits
Max Luminance      : 270 nits
Max Full Luminance : 270 nits
[2023:01:31:13:35:41]: Info: SDR color coding [Rec. 601]
[2023:01:31:13:35:41]: Info: Color range: [JPEG]
[2023:01:31:13:35:41]: Info: 
Device Description : Intel(R) Iris(R) Xe Graphics
Device Vendor ID   : 0x00008086
Device Device ID   : 0x00009A49
Device Video Mem   : 128 MiB
Device Sys Mem     : 0 MiB
Share Sys Mem      : 3918 MiB
Feature Level      : 0x0000B100
Capture size       : 1920x1080
Offset             : 0x0
Virtual Desktop    : 1920x1080
[2023:01:31:13:35:41]: Info: Desktop resolution [1920x1080]
[2023:01:31:13:35:41]: Info: Desktop format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2023:01:31:13:35:41]: Info: 
Colorspace         : DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
Bits Per Color     : 8
Red Primary        : [0.639648,0.330078]
Green Primary      : [0.299805,0.599609]
Blue Primary       : [0.149414,0.0595703]
White Point        : [0.3125,0.329102]
Min Luminance      : 0.5 nits
Max Luminance      : 270 nits
Max Full Luminance : 270 nits
[2023:01:31:13:35:41]: Info: SDR color coding [Rec. 601]
[2023:01:31:13:35:41]: Info: Color range: [JPEG]
[2023:01:31:13:35:42]: Warning: quicksync: h264: replacing nalu prefix data
[2023:01:31:13:35:42]: Warning: quicksync: hevc: replacing nalu prefix data
[2023:01:31:13:35:42]: Info: 
[2023:01:31:13:35:42]: Info: // Ignore any errors mentioned above, they are not relevant. //
[2023:01:31:13:35:42]: Info: 
[2023:01:31:13:35:42]: Info: Found encoder quicksync: [h264_qsv, hevc_qsv]
[2023:01:31:13:35:42]: Info: Configuration UI available at [https://localhost:47990]
[2023:01:31:13:35:42]: Info: Registered Sunshine mDNS service
romracer commented 1 year ago

Your log says Sunshine is using the integrated Intel Iris Xe in your computer, not the 1660. Therefore, Nvidia's nvenc is not available, but you can see it enables Intel's Quick Sync Video encoders ("*_qsv") instead. If you want to force Sunshine to use a different adapter, you'll need to edit the config. Probably this option:

https://docs.lizardbyte.dev/projects/sunshine/en/latest/about/advanced_usage.html#adapter-name

adapter_name = NVIDIA GeForce GTX 1660

S3LL1G28 commented 1 year ago

Hi Romracer,

Thank you for your answer but i need to be more accurate.

Intel quick sync seems not to be already compliant if I read the log well. => ##Could not open codec [h264_qsv]: Function not implemented##

I forget to tell that I already test with putting the right nvidia name but then sunshine crash.

probably the reason is "Error: Could not open codec [h264_nvenc]: No such file or directory"

How to investiguate more please.

thx.

S3LL1G28 commented 1 year ago

Just to add another detail. I've changed my GPU to a rtx3060 Ti and same result. sunshine hang.

So same behaviour.

cgutman commented 1 year ago

This is expected behavior. The Desktop Duplication API only supports capturing from the GPU used for display. See Microsoft's documentation: https://learn.microsoft.com/en-us/troubleshoot/windows-client/shell-experience/error-when-dda-capable-app-is-against-gpu

Since cross-device sharing of textures is not supported, we would have to read back the frame from the iGPU to the CPU and then write it to the dGPU to encode it. This is not something we currently support and may not perform very well if we did support it. If you want to capture and encode on the eGPU, connect a display or HDMI dummy display dongle to it and run the games on that display.

Is their actually an issue with QuickSync here or are you just wanting to force NVENC for some other reason?

S3LL1G28 commented 1 year ago

Hi Cgutman,

Thank you for your answer but I don't understand all the things.

My nuc pc is connected to the egpu over thunderbolt 3 and then hdmi is connected to my monitor.

Previously I was using geforce gamestreaming with the same configuration. And I think it's uses the same egpu to transcode. I just want to try using nvidia to encode to see if better result than intel igpu.

About igpu, don't know... If it's working why not. But I have some difficulties to see if decoding over igpu is enought good.

By using transcoding I Highly loose fps , than playing directly. but it's another story.

In case of I will use a dummy dongle I have one. I will tell.

S3LL1G28 commented 1 year ago

Ouch !!!!!!!

To sum up.

Effectively using a dongle for a fake monitor is the right solution !!!!!

Perhaps you can note this for others.

If you have an Intel GPU and an external GPU with nvidia you could do this.

1- Add a hdmi dongle to simulate a screen. 2- In sunshine choose this second fake screen 3- Choose nvidia card (use exe from sunshine tools to have the name) in adapter name 4- force nvidia encoder.

If like me you like Apex, first from your principal screen launch Apex (it will stay in principal screen). Then choose window mode without edge. After that go in your moonlight you will see windows screen. to recover Apex in this fake screen type "windows+shift" and left or right arrow.

A big thx for this wonderfull project it's working better than gamestream from nvidia.

I want to donate for that !!!!!!!!!!!!!

We close this issue ?

Seriously where can I make donation, tell me ?

ReenigneArcher commented 1 year ago

We close this issue ?

Leave it open for now. I'll try to add something to documentation about this.

Seriously where can I make donation, tell me ?

Thank you, much appreciated! If you'd like to donate, see the available methods here: https://app.lizardbyte.dev#donate

LizardByte-bot commented 1 year ago

This issue has been fixed and will be available in the next release.