Skip to content
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

RX 480 Encoding Overload w/ Specific Title #358

Closed
diagoon83 opened this issue Feb 9, 2019 · 10 comments
Closed

RX 480 Encoding Overload w/ Specific Title #358

diagoon83 opened this issue Feb 9, 2019 · 10 comments
Labels

Comments

@diagoon83
Copy link

@diagoon83 diagoon83 commented Feb 9, 2019

Hello, I've recently tried to record Subnautica (a game that's not nearly as GPU or CPU demanding as other games I've succesfully recorded with the same setup, such as Resident Evil 2 Remake, Hitman 2, etc.)

But, as I was recording the game, I noticed that from the menu onwards I had a strong encoding lag. Recently, I've even had some rendering lag. I've tried replicating my OBS profile without some configurations, but once I select AMF, the issue is present.

I've looked through other similar issues with AMD cards but nothing I've seen worked. Using Mirillis Action, with the same bitrate and GPU acceleration I've been able to record without problems.

This is a log showing some recordings I did and the problems I found with them:
2019-02-08 23-04-45.txt

My specifications are the following:
OS: Windows 10 64bit (updated)
CPU: i7 7700 3.6GHz
RAM: 16GB DDR4 2400MHz
Motherboard: ASRock B250M-HDV
GPU: Sapphire Radeon RX 480 Nitro +
HDD: Seagate ST2000DL003-9VT166

@Xaymar Xaymar added the type:support label Feb 9, 2019
@Xaymar
Copy link
Contributor

@Xaymar Xaymar commented Feb 9, 2019

I own Subnautica myself, and it is one of the GPU heaviest games I know - at least in the menu, which for some reason uses up to 99% of an RX 480 for no real reason, as the game itself only uses up to 80% of an RX 480. So there is next to no GPU time left for OBS Studio or the AMD Encoder to do any work - even with asynchronous transfer. In fact, this is even visible in the log file you provided:

23:20:24.889: Output 'adv_file_output': Total frames output: 8034
23:20:24.889: Output 'adv_file_output': Total drawn frames: 8907 (9600 attempted)
23:20:24.889: Output 'adv_file_output': Number of lagged frames due to rendering lag/stalls: 693 (7.2%)

23:21:06.630: Output 'adv_stream': Total frames output: 14814 (16813 attempted)
23:21:06.630: Output 'adv_stream': Total drawn frames: 16868 (17844 attempted)
23:21:06.630: Output 'adv_stream': Number of lagged frames due to rendering lag/stalls: 976 (5.5%)
23:21:06.630: Output 'adv_stream': Number of dropped frames due to insufficient bandwidth/connection stalls: 1999 (11.9%)
23:21:06.633: Video stopped, number of skipped frames due to encoding lag: 9190/17673 (52.0%)

You're "lagging" ~12%/~7% of frames due to insufficient GPU Time, and skipping over 50% of frames due to encoding lag - which is also due to insufficient GPU Time. These happen because OBS Studio first downloads the frame from the GPU, and the AMD Encoder then has to upload them back to the GPU asynchronously. Currently the only option is to just reduce the GPU Load of the game by either reducing resolution, quality settings or limiting game framerate further.

@diagoon83
Copy link
Author

@diagoon83 diagoon83 commented Feb 10, 2019

Thank you for the reply. I managed to "solve" the issue by starting the recording in an already loaded game (or a game where I've loaded for the first time, because apparently there's some weird code glitch going on in the game coding).

@Xaymar
Copy link
Contributor

@Xaymar Xaymar commented Feb 10, 2019

If Jim eventually merges the jim-nvenc stuff into master Edit: Jim merged the nvenc stuff, I can start implementing the same changes to the AMD Encoder and allow on-GPU encoding without the software path.

@meredith2u
Copy link

@meredith2u meredith2u commented Feb 12, 2019

I'm really excited to try the new way for AMD Encoder, Encoding Overload already harassment me for more than a year.

@meredith2u
Copy link

@meredith2u meredith2u commented Feb 17, 2019

I've tried to enabled OpenCL Transfer, encoding lag have been Improved a lot, It's not perfect but works.
Edit: Change Video API to Direct3D 9

@Benman2785
Copy link

@Benman2785 Benman2785 commented Feb 28, 2019

@meredith2u @diagoon83 as Xaymar said - REDUCE load on GPU
my tip: if you dont push your GPU to the limit with Ultra settings simply reduce load this way:
set FRTC (FrameRateTargetControl) to 65-75 Frames (usually mid-high settings should hit around 90-100fps for most games)

@meredith2u
Copy link

@meredith2u meredith2u commented Mar 3, 2019

@Benman2785 I tried that setting when I playing Subnautica, It's works and I know this setting will not works for all games, it's just a little bit improved for encoding.

@iGurkin
Copy link

@iGurkin iGurkin commented Mar 17, 2019

If Jim eventually merges the jim-nvenc stuff into master Edit: Jim merged the nvenc stuff, I can start implementing the same changes to the AMD Encoder and allow on-GPU encoding without the software path.

the result is not yet?

@YellowOnion
Copy link

@YellowOnion YellowOnion commented Apr 8, 2019

I'm getting this odd performance issue where my streams normally @ 720p60, on my 580, at random starts rendering at about 1-5fps for 30s with Apex Legends, the rest of the time it's doing a solid 60fps.

This sounds similar to this problem with the menu.

On my old GTX 760 it didn't have this issue, despite it being a substantially older card, pretty sure it could even do 1080p60, but this card refuses to. Is this AMD just being stupid with provisioning of resources? Surely with a hardware encoder it should make some realtime promises.

@Xaymar
Copy link
Contributor

@Xaymar Xaymar commented Jan 21, 2020

I have a work-in-progress integration of AMF using ffmpeg in StreamFX. This integration will likely replace this one as it means having to maintain less code overall, and probably a massive increase in performance as the AMF integration in ffmpeg is actively maintained by AMD since early to mid 2019-ish.

@Xaymar Xaymar closed this Jan 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.