Closed toojays closed 2 years ago
so still only support for nvidia for encoding. software encoding KILLS game performance, and is such a waste of gpu or quicksync acceleration support on the hardware
With Steam Link Anywhere, this issue becomes even more relevant. Would be nice with hardware encoding support!
@kisak-valve or anyone else able to comment on if this is being worked on or not?
Software encoding is such a huge drain of my resources [currently using 4/8 cores for it] which are better used to run the game itself. There is also the extra latency which software encoding adds which arguably is the bigger issue for many games.
Also, is there any way we can help? Is there an API or something in steam we can use to hack our own solution together?
I would love to have hardware encoding for amd, currently losing a lot of performance when streaming to my laptop
I recently tried out hardware encoding on an RX 470 via FFmpeg and tried recording gameplay using OBS (which uses VAAPI via FFmpeg). TL;DR: AMD's hardware encoder is not very useful on Linux because when the GPU is near 100% utilisation, the encoder chokes and drops 99% of frames, resulting in a slideshow recording. The cause is most likely that the ability to control the speed/compression tradeoff is either not implemented or not functional on Linux and the encoder defaults to the maximum compression ratio, which for whatever reason craps out when other parts of the GPU are under intense load.
This has also been documented to happen on Windows in a hardware encoder investigation done by GameSpot's Tim Schiessert:
AMD’s encoder is even worse in that when your GPU utilization is up near 100%, the encoder completely craps its dacks and can’t render more than about 1 frame per second, which wasn’t an issue with the Nvidia cards.
I was able to get the encoder working with a frame limiter enabled, which brought GPU utilization down to around 60% in Forza Horizon 4, but even with the ‘Quality’ encoding preset, the quality Vega 64 produced was worse than with even Nvidia’s Pascal cards.
I also saw a user report about this on Reddit. Apparently OBS has an option on Windows to change the compression efficiency from "best quality" (which is the default) to "balanced" which fixes the framedrop issue, so the feature definitely does exist. It's just not available on Linux for whatever reason. Not even FFmpeg is able to use the feature: it would evoked with the -compression_level
switch, but this shows the error [h264_vaapi @ 0x5642618e45c0] Quality attribute is not supported: will use default quality level.
This is probably why AMD's hardware encoding isn't yet supported for In-Home Streaming on Linux. It's not very useful to add even preliminary support when you can't guarantee it's going to work properly.
If anyone knows or has suggestion as to where the root cause of this bug should be reported to (or if it has been already), please tell so we can track it.
[h264_vaapi @ 0x5642618e45c0] Quality attribute is not supported: will use default quality level.
This is probably why AMD's hardware encoding isn't yet supported for In-Home Streaming on Linux. It's not very useful to add even preliminary support when you can't guarantee it's going to work properly.
If anyone knows or has suggestion as to where the root cause of this bug should be reported to (or if it has been already), please tell so we can track it.
The AMD va-api driver is part of Mesa. Maybe start with the Mesa users mailing list.
This is probably why AMD's hardware encoding isn't yet supported for In-Home Streaming on Linux. It's not very useful to add even preliminary support when you can't guarantee it's going to work properly.
Since when was everything in Steam guaranteed to work properly? ;) There's already a check-box for hardware encoding in the GUI, just leave it disabled by default if it's flakey.
It's been widely reported that Google's new game streaming service is running AMD GPUs on Linux, so the capability exists in some form, somewhere.
Valve has AMD driver developers on staff. They have made other improvements in AMD drivers, and I expect they could implement the necessary quality preset code as well if it were a blocker to getting hardware encoding working.
IMO AMD has more to gain than Valve from Steam supporting their GPUs for hardware encoding (how many people on this thread will buy Nvidia next time?) and should work together with Valve to get this feature implemented.
@veikk0 and @toojays : Apparently it works through gstreamer, but not through FFmpeg.
The test didn't bother testing more than one game on AMD, plus someone in the comments mentioned it: Why not use the Vendor-specific tools to test this too? I'd blame it on driver issues or OBS not doing the right thing. That aside: That was Windows, not Linux, so almost entirely a different thing.
It might be that on Linux the driver, MESA or VAAPI is not yet up to snuff, but I'd just call it a beta, add a disclaimer and be done with it.
@kisak-valve Any news on this ?
After over two years with no action on this bug, I've finally gone with the expensive workaround of swapping out my RX480 for an Nvidia card (GTX 2060). I'm now comfortably streaming the Witcher 3 (under Proton) to my Steam Link at 1080p, with the streaming frame rate between 45-60 FPS, and my i5 CPU showing about 30% idle. I would much prefer using an AMD card due to the free drivers, but in this one area it just can't meet my requirements. Hopefully the situation is different by the next time I need to buy or recommend a GPU.
As far as I can tell, even with Nvidia, Steam's in-home streaming still copies each frame from the card over the PCI bus to the CPU, then sends it back to the card for encoding. I.e. the Nvidia technologies which are supposed to avoid this (NVFBC and NVIFR) aren't wired up to Steam on Linux. This suggests to me that there should be no disadvantage to @HorstBaerbel's suggestion of dropping in an older Nvidia card and doing the rendering on the AMD card but the encoding on the Nvidia card. Assuming it works. Sorry, I've already packed up my RX480 to sell, so will not be trying this experiment.
@slouken any update?
@kisak-valve Hi guys, thanks for all your work.
I'm a new AMD GPU owner and would like to know if VAAPI hardware encoding is anything to hope for sooner rather than later?
Oh look now I can remote stream and yet I still can't encode or decode with VAAPI. Hurts performance on both ends.
Seriously, is this never going to be fixed?
I'm fortunate enough as to where I only need video decoding from amdgpu since I'm using a Windows host, and my CPU can easily decode a 1080p stream for now. I'll add myself to the list of people wanting this since it has helped my display latency in the past
Kudos to Valves commitment to OS OSes <3. Why not celebrate that by implementing an VA-API hardware encoding backend? ;P
Very annoying that the do not support this! Come on Valve!
Pretty please!
Is there an ETA, is it at least on the roadmap? I'd like to get an AMD card for my new build, not least because Valve has done so much work on them (ACO etc.), but I don't want to risk a hit on in-home streaming performance, as I play most games on the projector.
The Android Steamlink App seems to have problems with libx264 encoded streams on certain devices. On my device connected to the TV, I have an unusable experience when streaming from AMD based Linux host using libx264 ("slow decoding" errors). Hardware accelerated h264 or h265 streams are working fine. Thus I would be extremely happy, if Valve could implement VAAPI :)
+1 for VAAPI encoding support
At least support AMF on amdgpu-pro for play games with encoding in linux
So we are few days ahead of the third birthday of this issue, it would be a great gift if we get a fix for hardware encoding in AMD hardware 😃
My CPU is still crying
TFW VA-API is 12 years old, but you backed the wrong horse
I can confirm that sticking in an additional, nvidia-based gpu enables NVENC right out of the box. Quality is awesome and latency seems fine for a phone.
Obviously, I support this issue and would rather not do this... However, this is pretty much the last thing I need Windows for. If I was desperate to make the switch this would be a solution, but I will probably stick with Windows for now as running another gpu seems absurd.
Continue to using Windows as primary desktop by this issue, pls support vaapi on amd encoding.
Any updates on that topic? Hardware encoding works very well as you could see by trying either ffmpeg manually to convert videos or use recent versions of OBS. Quality is fine and CPU load is very low. Any updates on that topic?
For some games my 3570K@4,4Ghz + RX480 8GB is very fine playing directly on the desktop but the performance gets abysmal while using inhome streaming due to missing hw encoding.
PS: Is it possible to use the HD4000 of the processor for encoding and the RX 480 to render the game?
+1 from me too to please support this. OBS, for example, can use the hardware encoder on my RX580 on Linux just fine.
I mean, isn't Steam already using ffmpeg/libav for this? If so, then... How is it much more code than this, for example? https://github.com/obsproject/obs-studio/blob/master/plugins/obs-ffmpeg/obs-ffmpeg-vaapi.c Someone, please, just shovel this in there somewhere, and let us be finally happy... I personally wouldn't even mind if it wouldn't be adaptive, or configurable, or anything like that, I'd like to just have it work in any way at all...
Fun fact: Valve is pushing the FOSS Mesa driver stack for AMD/Intel but does not make us of it's capabilities aka hardware encoding.
Maybe you can snatch some implementation details from Mozilla / Firefox. They finally have decoding running on X11. Yay.
The decoding is already accelerated by VA-API in Steam, as far as I can tell. But that's only one half (and the less useful one If you ask me) of the story...
The decoding is already accelerated by VA-API in Steam, as far as I can tell. But that's only one half (and the less useful one If you ask me) of the story...
Yes, I know. It was more of a tounge-in-cheek comment. Else than that it is probably the more useful half, because more people use it.
The decoding is already accelerated by VA-API in Steam, as far as I can tell. But that's only one half (and the less useful one If you ask me) of the story...
Yes, I know. It was more of a tounge-in-cheek comment. Else than that it is probably the more useful half, because more people use it.
Not sure about the "more useful", since if a system is only decoding it will most likely not be limited by the CPU. If you play a game and encode some stream having 50% CPU usage just for encoding is too much.
This is the only thing keeping me on Windows for my gaming PC. I often stream to my loungeroom tv and my old quad core CPU can't handle it. On Windows my Radeon 7970 handles the encoding and it works perfectly. Valve, what can we do to help bump up the priority of this? With all of the great Linux work you have done this is a critical feature to overlook for so long
@Plagman
We don't currently support VA-API for encoding, but it's a valid feature request, thanks.
looks around nervously soooo... does this GitHub issue count as said feature request, or is there somewhere more formal that it should be submitted?
Just wanna make sure we're on the same page here.
Make sure you give the first post a thumbs-up.
From the latest beta update:
pressure-vessel: bring host VDPAU and VA-API drivers into the container
pressure-vessel is an opt-in containerization system for Steam games with advantages for host isolation and dependency management.
This must just be for VA-API's decoding features, then?
Yeah, that's just for games running in the Steam Linux Runtime. It's for keeping older games running on modern systems.
I think the biggest problem here, is that libav h264_vaapi
encoder does not support the same set of option as the libx264
encoder. It might be extremely tricky to adapt existing code to such a radical change. That being said, I would not expect this to happen at all.
I disagree, but obviously none of us outsiders sees what's really the issue, since all this is closed-source. :)
I disagree
... because?
Stop spamming, you're not helping. If you care about this issue, subscribe and vote with a thumbs up on the first post. This is not a discussion forum, stop the chat.
I have a RX5700XT, and hw encoding still doesn't work. If i enable it in steam, my phone shows nothing but a black screen for a few seconds and exits. Now I'm forced to use cpu encoding, and it hurts a lot when playing proton games. vote for HW encoding
I have a RX 5500 XT 8GB and hw encoding isn't working for me here, either. It was working fine for some years with the old 2GB NVidia GTX 650 Ti "BOOST" that I was using prior, so I must confess to being greatly disappointed by this as well. So disappointed in fact, that I signed up to github just to report this.
How is 2021 looking for this issue? Is VA-API on the roadmap?
Crazy that they're rolling out new features like remote play together: invite anyone which pretty much requires this bug to be fixed to work properly for many of us, but they do seemingly nothing on this bug and give us radio silence here for literally years now.
Looks like they've been working on using VA-API decoding on Linux clients, I'm really hoping they also are working on the Linux host encoding as well.
https://steamcommunity.com/groups/SteamClientBeta/announcements/detail/3050602228716269850
https://www.phoronix.com/scan.php?page=news_item&px=H264-SVC-Mesa-AMD-VCN
Good times to implement AMD linux encoding? :)
The issue was brought up back in 2017 (!). Valve's silence on this deafening. Would it be possible to get at least some form of communication on this issue? I think the most important questions are:
Any sort of information regarding this issue would be much appreciated, so we don't have to go by hope.
Yes it would be nice to get some feedback here. Nvidia owners could rely on NVENC since forever for hosting games over steam remoteplay. Not everyone owns a CPU that has the performance needed for hosting a game via steam remoteplay in way that results in a stable performance and decent quality. H.264 encoding is supported by a huge amount of AMD GPU's. Every GPU utilizing the AMDGPU kernelmodule should be able to make use of it. I have used VAAPI encoding for H.264 with OBS and Shotcut for a while now and it works great. Since steam uses ffmpeg just like these two apps, it should be doable with steam remoteplay too.
It is really quite unbelievable that this feature has not been implemented yet. Take a look at https://github.com/loki-47-6F-64/sunshine for example, which makes Gamestream possible via VAAPI for AMD GPUs. With the Steamdeck coming, this issue is probably going to be fixed sooner or later - or should Steam rely on CPU encoding for Valve's own console as well? It makes absolutely no sense to leave this issue open, if only for that.
My GPU is an RX 480. When streaming to the steam link from Linux, my streaming_log.txt shows:
Whereas from Windows, I get:
Unsurprisingly, I get a better picture, and smoother performance when streaming from Windows.
Recent versions of Mesa support hardware encoding of H264 on this GPU:
Please enhance the Steam Linux client to take advantage of this for streaming to the Steam Link.