Closed chaitan3 closed 2 months ago
I'm too lazy to test
You understand, that this causes me to immediately close your issue?
Hi, thanks for the quick reply. I am sorry for clicking that button. But, I did a git history check of the relevant part of the code and did not see any commits on that function in the last few months via git blame. So, my hunch was that things would not be different with git master. I am willing to test and even do debug builds if you want me to. Would you consider reopening the issue?
Here are the results on latest git
[2024:07:10:01:00:42]: Info: Sunshine version: 0.0.0.dirty
24:07:10:01:00:42]: Verbose: [h264_nvenc @ 0x563fd55f5380] Loaded sym: cuArray3DCreate_v2
[2024:07:10:01:00:42]: Verbose: [h264_nvenc @ 0x563fd55f5380] Loaded sym: cuArrayDestroy
[2024:07:10:01:00:42]: Verbose: [h264_nvenc @ 0x563fd55f5380] Loaded sym: cuEGLStreamProducerConnect
[2024:07:10:01:00:42]: Verbose: [h264_nvenc @ 0x563fd55f5380] Loaded sym: cuEGLStreamProducerDisconnect
[2024:07:10:01:00:42]: Verbose: [h264_nvenc @ 0x563fd55f5380] Loaded sym: cuEGLStreamConsumerDisconnect
[2024:07:10:01:00:42]: Verbose: [h264_nvenc @ 0x563fd55f5380] Loaded sym: cuEGLStreamProducerPresentFrame
[2024:07:10:01:00:42]: Verbose: [h264_nvenc @ 0x563fd55f5380] Loaded sym: cuEGLStreamProducerReturnFrame
[2024:07:10:01:00:42]: Verbose: [h264_nvenc @ 0x563fd55f5380] Loaded lib: libnvidia-encode.so.1
[2024:07:10:01:00:42]: Verbose: [h264_nvenc @ 0x563fd55f5380] Loaded sym: NvEncodeAPICreateInstance
[2024:07:10:01:00:42]: Verbose: [h264_nvenc @ 0x563fd55f5380] Loaded sym: NvEncodeAPIGetMaxSupportedVersion
[2024:07:10:01:00:42]: Debug: [h264_nvenc @ 0x563fd55f5380] Loaded Nvenc version 12.2
[2024:07:10:01:00:42]: Debug: [h264_nvenc @ 0x563fd55f5380] Nvenc initialized successfully
[2024:07:10:01:00:42]: Verbose: [h264_nvenc @ 0x563fd55f5380] Calling dl_fn->cuda_dl->cuCtxPushCurrent(ctx->cu_context)
[2024:07:10:01:00:42]: Verbose: [h264_nvenc @ 0x563fd55f5380] Calling dl_fn->cuda_dl->cuCtxPopCurrent(&dummy)
[2024:07:10:01:00:42]: Verbose: [h264_nvenc @ 0x563fd55f5380] Calling dl_fn->cuda_dl->cuCtxPushCurrent(ctx->cu_context)
[2024:07:10:01:00:42]: Verbose: [h264_nvenc @ 0x563fd55f5380] Calling dl_fn->cuda_dl->cuCtxPopCurrent(&dummy)
[2024:07:10:01:00:42]: Verbose: [AVHWDeviceContext @ 0x563fd55e8e00] Calling cu->cuCtxPushCurrent(hwctx->cuda_ctx)
[2024:07:10:01:00:42]: Verbose: [AVHWDeviceContext @ 0x563fd55e8e00] Calling cu->cuMemAlloc(&data, size)
[2024:07:10:01:00:42]: Verbose: [AVHWDeviceContext @ 0x563fd55e8e00] Calling cu->cuCtxPopCurrent(&dummy)
[2024:07:10:01:00:42]: Error: Couldn't scale frame: Invalid argument
[2024:07:10:01:00:42]: Verbose: [h264_nvenc @ 0x563fd55f5380] Calling dl_fn->cuda_dl->cuCtxPushCurrent(ctx->cu_context)
[2024:07:10:01:00:42]: Debug: System tray loop
[2024:07:10:01:00:42]: Debug: System tray loop
[2024:07:10:01:00:42]: Verbose: [h264_nvenc @ 0x563fd55f5380] Calling dl_fn->cuda_dl->cuCtxPopCurrent(&dummy)
[2024:07:10:01:00:42]: Debug: [h264_nvenc @ 0x563fd55f5380] Nvenc unloaded
[2024:07:10:01:00:42]: Verbose: [AVHWDeviceContext @ 0x563fd55e8e00] Calling cu->cuCtxPushCurrent(hwctx->cuda_ctx)
[2024:07:10:01:00:42]: Verbose: [AVHWDeviceContext @ 0x563fd55e8e00] Calling cu->cuMemFree((CUdeviceptr)data)
[2024:07:10:01:00:42]: Verbose: [AVHWDeviceContext @ 0x563fd55e8e00] Calling cu->cuCtxPopCurrent(&dummy)
[2024:07:10:01:00:43]: Verbose: [AVHWDeviceContext @ 0x563fd55e8e00] Calling cu->cuDevicePrimaryCtxRelease(hwctx->internal->cuda_device)
[2024:07:10:01:00:43]: Info: SDR color coding [Rec. 601]
[2024:07:10:01:00:43]: Info: Color depth: 8-bit
[2024:07:10:01:00:43]: Info: Color range: [JPEG]
How did you build Sunshine? The PKGBUILD from sunshine
AUR?
I was using sunshine and sunshine-git AUR packages in the above tests.
I just tried the latest archlinux zst package (git master) from the release page: https://github.com/LizardByte/Sunshine/releases.
And voila, NvENC is working with sway inside docker with the official package. Maybe a warning should be added on the github README to use the official package instead of AUR on archlinux?
Thanks for your time. I am closing this issue.
Unfortunately, the new packagers on AUR, broke nvenc encoding, since they don't understand the compilation process for Sunshine. I've done all I can to try to re-gain control of the AUR package, but all they are willing to do is harass me. 🤷♂️
There are warnings about this in the new docs, but unfortunately it hasn't made it to stable yet.
I guess the positive, is that we now have a new pacman repo that we have full control of. Currently it has the last stable build, but I'm working on adding latest beta there as well (sunshine-git
basically)
https://github.com/LizardByte/pacman-repo
I'm a little surprised that sunshine-git
in AUR is broken though.
BTW, we also have an ArchLinux docker image we publish. Might be of interest to you. https://hub.docker.com/r/lizardbyte/sunshine
Thanks for the docker image link, I might check it out and replace my own home grown image.
As for AUR, that is unfortunate to hear. The pacman repo sounds a great alternative.
@ReenigneArcher are you talking about sunshine-git
on the AUR? I took over maintainership of that because it was broken and the old maintainer was unresponsive.
I'm more than happy to hand over maintainership to you! I'm only doing it cause nobody else was, and I was fixing it for myself anyway, either way, shoot me an email.
@kelvie I am talking about the sunshine
package.
I am done with AUR though. I won't be involved in a platform that allows abusive behavior to maintainers.
Is there an existing issue for this?
Is your issue described in the documentation?
Is your issue present in the latest beta/pre-release?
I'm too lazy to test
Describe the Bug
Using sunshine with Nvidia GPU does not load NvENC with the error message "Couldn't scale frame: Invalid argument". Tracking down the code it appears at this line: https://github.com/LizardByte/Sunshine/blob/638a7020b74b19e330da314b35344afb66dc11b7/src/video.cpp#L104
I am using sunshine inside a docker container running sway 1.9, wlr capture backend works, but nvenc encoder backend does not.
I have tested both the headless and the drm backend of wlroots and get the same error. I have verified nvenc works inside docker with ffmpeg (same container) using the command:
ffmpeg -loglevel error -f lavfi -i color=black:s=1080x1080 -vframes 1 -an -c:v h264_nvenc -f null -
Expected Behavior
NvENC works with sway inside docker instead of using software encoding.
Additional Context
No response
Host Operating System
Docker
Operating System Version
Archlinux
Architecture
64 bit
Sunshine commit or version
0.23.1
Package
Linux - AUR (Third Party)
GPU Type
Nvidia
GPU Model
Geforce 2080 Ti
GPU Driver/Mesa Version
555.58.02
Capture Method
wlroots (Linux)
Config
Apps
No response
Relevant log output