-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sunshine won't work with Cuda #305891
Comments
I have tried a reboot as mentioned by #305688 but it does not fix this particular issue. |
Reproduced on nixos. Hardware (not sure if it matters) 5950x + 4090 running NixOS unstable. Command used to reproduce:
then |
After reboot, there is still black screen:
My Machine:
and, I found that the sunshine nixos module doesn't work with journalctl:
|
I think one of the issues with |
After upgrading from NixOS 23.11 to 24.05 I am seeing the exact same error with sunshine. Config:
Is this nixpkgs/pkgs/servers/sunshine/default.nix Line 51 in 57d6973
|
No, that's normal. It's a convention called prime notation.
That does not work for me sadly. |
For me trying to force the capture method worked only on X11 but not wayland |
|
For me, forcing the capture method to "KMS" (in the sunshine config) made it so I could at least stream, but it still falls back to CPU encoding instead of using CUDA, which is much slower. I also tried the Sunshine flatpak (from Flathub), and it works flawlessly with nvenc + CUDA. So it does seem like there's a bug with this nix module. |
I can replicate this. UPDATE: I am now having the same issue when running through Flatpak... This is very strange. UPDATE 2: I have resolved it no longer working by disabling the open kernel module per issue #334180 |
@Continous can you confirm if #334340 helps |
I'm on |
Currently have some visitors for a couple months so I might be delayed, but I wanted to post to let you know I will test it. |
I am presuming unstable has the changes when I say this, however, there has been no improvement. EDIT: Nevermind, it's functional now. |
Hello everyone, I am on the latest unstable and this is 100% still happening, CUDA is not found so sunshine throws this warning: This massively slows down encoding on the host. I installed the flatpak and I can confirm this does NOT occur in the flatpak, I get high FPS when streaming from the flatpak. The way sunshine is being packaged is wrong in nixpkgs, the binary does not get dynamically linked to CUDA, that much I could confirm, but I'm no expert so I don't know if that is expected or not. |
I can confirm 100%, sunshine with the
This leads to massive slowdown on capable hardware, looking into the |
Indeed I don't see In future we should be able to detect this kind of mistakes using #351679 |
Ty @SomeoneSerge ! I've been debugging this for a few hours. I'm not really a C++ developer and never worked with CUDA so bare with me, but I hope some of my findings are of use. If I compile sunshine passing along the cuda_nvcc:
I still see in the compilation logs:
This I believe is what interferes with https://github.com/LizardByte/Sunshine/blob/master/cmake/compile_definitions/linux.cmake#L17a And I still get the warning So I started doing some digging into cmake, the
Which at least by passed the
these I believe are some tests that Cmake automatically does whenever it finds a cuda compiler. I'm kinda stuck here, looked into how to add the Would love if someone more experience with CUDA and C++ could help me debug this and get a solution working, at least I am confident that I identified the issue. Maybe there is also a way to patch out the I also get these warnings:
|
Might as well let it use the static library. If you just pass Instead of
I suppose these are nvcc flags. Does it make a difference if you use
P.S. Nice work! |
That's something weird going on, because I get services.sunshine = {
enable = true;
openFirewall = true;
capSysAdmin = true;
package = (pkgs.sunshine.override { cudaSupport = true; });
}; in my configuration. Just in case, here's my nix-info output
|
Omg! It worked, TY soo much @SomeoneSerge ! This was so difficult for me to make heads or tails of. For future reference for other people frustrated by this issue, this is what I am running now:
Works perfectly! 4K at locked 60 FPS with almost no latency and 1440p at 100+fps. Not sure how we could upstream this, but definitely there should be a clean way to do it, at least this can help make that happen. |
@vavakado Hey, I think the issue is not that It cannot find the nvenc, is that it was missing some cuda functionality that allowed it to encode the frame without going through RAM, as I understand. Do you get the
I don't rule out something weird in my config though: https://github.com/danilevy1212/nixos/blob/4afa71d6acd16ea3e292c9e7e6d26cdfad7450d5/hosts/bootse/default.nix#L150-L158 This was my setup when I noticed the issue, I could stream HDR AV1, encoded by nvenc, but it was much slower than other peoples results online with similar hardware, so it made me dig into the logs and that's when I noticed that warning that made me go into this rabbit hole. |
Essentially, you implement the same changes in nixpkgs' |
Just went back and checked, and oh yes, I missed this warning when I looked at the output and never noticed any issues with encoding because I only stream to my switch which is 720p. |
Describe the bug
Most of the sunshine versions posted on nixpkgs do not work with CUDA enabled.
I have tried manually to pin sunshine to each of the last 20 commits and only around 5 managed to detect my display/encoder at startup.
The nixpkgs revision that works with my machine is
56aeedf456e676d46af2595c3f66de9cf95f2cdd
.That is sunshine
v21.0
Steps To Reproduce
Steps to reproduce the behavior:
pkgs.sunshine.override { cudaSupport = true; };
Expected behavior
I would expect every version to work like the one from revision
56aeedf456e676d46af2595c3f66de9cf95f2cdd
where it would detect my gpu, my screen and codecs.Additional context
The errors I am getting on the homepage are:
Here are the full logs:
Notify maintainers
@devusb
Metadata
Add a 👍 reaction to issues you find important.
The text was updated successfully, but these errors were encountered: