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

rsx: Fixes #3638

Merged
merged 10 commits into from
Oct 24, 2017
Merged

rsx: Fixes #3638

merged 10 commits into from
Oct 24, 2017

Conversation

kd-11
Copy link
Contributor

@kd-11 kd-11 commented Oct 23, 2017

Fixes the remaining regressions with the new texture cache. Also adds a few improvements elsewhere

  • Fix clipping bug when using vulkan + gpu texture scaling
  • Restructures the texture cache to contain section manipulation to one function
  • Fix debug counters for texture cache. Also track texture memory usage
  • Fix some leaking memory sections
  • Fix surface subsection sampling ("Turbo: Super Stunt Squad)
  • Fix crashing due to 0 pitch (VirtualMemory.cpp crash)
  • Add buffer names to vulkan heaps to help debug OOM crashes ("Working buffer not enough" crash)
  • Better detection of situations that would require memory stitching (framebuffer blit operations). Should fix black screen regressions in some games

@greentop
Copy link

Ubuntu 16.04 / Nvidia 387.12 / LLVM 4 / (PR #3638)

RPCS3 GPU Additional Settings:
Enabled - Vulkan / Use GPU Texture Scaling / 16xAF

Game: ToCS2 BLUS31597

Log line: 18769

·F 0:01:10.914775 {rsx::thread} St13runtime_error thrown: Assertion Failed! Vulkan API call failed with unrecoverable error: Out of video memory (VRAM) (VK_ERROR_OUT_OF_DEVICE_MEMORY)
(in file /home/green/rpcs3/rpcs3/Emu/RSX/VK/VKHelpers.h:286)

RPCS3.log.gz

@kd-11
Copy link
Contributor Author

kd-11 commented Oct 23, 2017

@greentop What are the texture statistics shown if you enable the debug overlay? Log cant really show leaks. Enable the debugging tab by editing CurrentSettings.ini in GuConfigs and enable Debug Overlay. Or just set it to true in the config file manually

@aakh1361
Copy link

old build
image
this build
image

@kamer1337
Copy link

kamer1337 commented Oct 23, 2017

Tony Hawk's Pro Skater 5 Vulkan:

F {PPU[0x1000017] Thread (RenderingThread) [0x01fe37dc]} class std::runtime_error thrown: Verification failed (e=0x1e7):
(in file ..\Utilities\VirtualMemory.cpp:83)

OpenGL is broken
przechwytywanie
111

on videos

@Kravickas
Copy link
Contributor

VirtualMemory.cpp crash seems fixed in NHL 16 and Far cry 2

@Sandvichero
Copy link

Nier Replicant [BLJM602223]
Now has far worse framerate and spams this in the log:
E {rsx::thread} RSX: Unsupported RTT scaling factor: dst_pitch=5120 src_pitch=3072

@greentop
Copy link

screenshot from 2017-10-23 19-40-33
RPCS3.log.gz

The screenshot was taken at the point after the game freezes with the out of video memory error.

@kd-11
Copy link
Contributor Author

kd-11 commented Oct 24, 2017

That might be the cause. 157 large textures will easily consume alot of extra VRAM. On vulkan, objects are not released immediately due to frame synchronization, but on openGL they can be released back to the driver. I'll see about balancing the memory tracker for lower end GPUs with smaller memory pools

@Asinin3
Copy link
Contributor

Asinin3 commented Oct 24, 2017

Master (3 Unreleased textures)
rpcs3_2017-10-24_20-34-41
PR (476 Unreleased)
fixes_2017-10-24_20-36-37

@kd-11
Copy link
Contributor Author

kd-11 commented Oct 24, 2017

It should be improved now. There was unnecessary thrashing of texture memory due to an overzealous prepare memory blocks. Should also fix the broken bink videos for OpenGL

@greentop
Copy link

greentop commented Oct 24, 2017

As of (d865dec)
screenshot from 2017-10-24 07-21-12
RPCS3.log.gz
This screenshot was taken after reaching the out of video memory error. (game hanged)
The FPS performance did improve in some of the other title 'start/continue game' screens, to 30fps seen in areas that are not using weather visual effects.

@alex88510
Copy link

I'm also playing ToCS2 too but in chinese version (shouldn't matter right?).
I haven't had any freezeing/crashing so far and I am almost half way through the whole game, aside from random texture corruption as before (haven't tested with this PR).

The fps did drop a lot when I reached an area with weather visual effects just like @greentop mentioned.
Like from steady 30fps to 10fps.

I'm using GTX970 with vulkan.
@kd-11 do you need more info from mine?

@kd-11
Copy link
Contributor Author

kd-11 commented Oct 24, 2017

Check VRAM usage with this PR to see if its worse.

@alex88510
Copy link

alex88510 commented Oct 24, 2017

I'm not sure if I check it the correct way.
I used my desktop widget to track the vram usage.

On master:
old
old2
RPCS3_old.log.gz

On this PR:
new
new2
RPCS3_new.log.gz

P.S.
On idle before the game start, the vram usage is like this.
idle

From what I see, it seems the same.
All screenshots are taken right after the game finished loading the save file.

EDIT:
as of 01b19d3, it seems the vram usage dropped to 712MB and the unreleased texture drop to 22.

@kd-11
Copy link
Contributor Author

kd-11 commented Oct 24, 2017

It seems the game is using some large textures if 22 textures can fill 64MB. As long as performance is stable then it should not be too much of an issue. @greentop Any improvement on your end?

@alex88510
Copy link

Will this improve the fps on weather effect intensive area(snowing, fog...)? I have yet to try that.

@greentop
Copy link

greentop commented Oct 24, 2017

(As of 01b19d3)
screenshot from 2017-10-24 09-25-43
RPCS3.log.gz
The above screenshot was taken after encountering the out of video memory error. (game hanged)

For comparison, below is another map area that doesn't have a weather effect present.
screenshot from 2017-10-24 09-40-50

Edit:
OpenGL comparison for the same area below. (No game hang for in OpenGL observed.)
screenshot from 2017-10-24 10-11-55
RPCS3.log.gz
The low FPS in OpenGL here is likely the result of the 100% GPU usage as observed in the 'Nvidia X Server Settings' control panel. (Other faster GPU's should be seeing better FPS performance for this map area.) Vulkan renderer for the same area though peaks out at 39% GPU usage just before the game hangs with the out of video memory error.

@kd-11
Copy link
Contributor Author

kd-11 commented Oct 24, 2017

@alex88510 Idk. I don't run these games myself which is why I rely on testers to assist
@greentop Looks like an issue on linux? The vram usage on windows seems fair, but no way to be sure without direct comparison. Maybe someone with more graphics memory can check what is happening on linux version.

@alex88510
Copy link

alex88510 commented Oct 24, 2017

Maybe I'll go test out the weather effect intensive area and see how much vram it used for that(although it doesn't crash on me before), after the new build is complete.

UPDATE:
As of 5b7717d, I see no performance degradation on one of the weather effect intensive area(the forest) that used to have huge performance drop.
All remains at 30fps, nice and smooth.
capture
capture2

UPDATE2:
Tried another map which previously have huge performance drop, but right now it is still nice and smooth.
capture3

I noticed the flying snow effect was gone, not sure if it is because of my game progress.
Maybe @greentop can share the save file so that I can test it at the same spot?

@kamer1337
Copy link

Tony Hawk's Proving Ground still have black screen with gpu texture scalling or wcb

on OGL with wcb and cpu blit you can see very small part all other is black

thpg

@greentop
Copy link

greentop commented Oct 24, 2017

(As of 5b7717d)
screenshot from 2017-10-24 10-56-43
No game hang observed. FPS holding at a steady 30fps. 'Nvidia X Server Settings' reported memory usage peaks out at 50%.
RPCS3.log.gz
GPU usage peaks out at 59% throughout the other areas of the map.

@alex88510
Copy link

I guess the only issue left for ToCS2 is the random texture corruption, which can be annoying sometimes (when you are playing the mini card game - BLADE and can't see the card properly...).

@greentop
Copy link

The "S {rsx::thread} RSX: New program compiled successfully" lines are observed working much faster now. (Far less noticeable game pauses upon camera rotation.)
Addition 4de31dc stability & performance for ToCS2 remains in a great state for the Vulkan render.

kd-11 added 10 commits October 24, 2017 18:49
- Refactor invalidate memory functions into one function
- Add cached object rebuilding functionality to avoid throwing away useful memory on an invalidate
- Added debug monitoring of texture unit VRAM usage
- Fix buffer invalidate behaviour (wcb)
- Disable auto rebuild with only framebuffer storage getting rebuilt
- Fix vulkan subresource sampling
- Fix subresource sampling
- Invalidate memory range before uploading textures to prevent hangs
- Should these be ignored? Needs investigation
- Optimizes search functionality and avoids thrashing valid sections
- Still requires texture stitching to work correctly, but matching dimensions works well for now
@Kojikun1
Copy link

This PR Fixed Soul Calibur II HD online black screen, now works good

@Asinin3
Copy link
Contributor

Asinin3 commented Oct 24, 2017

Fixed for windows too:
image

@kd-11 kd-11 merged commit 882e949 into RPCS3:master Oct 24, 2017
@Zangetsu38
Copy link
Contributor

rgression for lbp karting, now game crash before show menu pod
image

@Kravickas
Copy link
Contributor

Kravickas commented Oct 24, 2017

lbp karting working same for me

@joshuacode751
Copy link

can you add borderless window? Fullscreen mode wont show trophies

@toccata10
Copy link
Contributor

Dengeki_Bunko_FightingClimaxIgnition[BLJM61322] now freezes on the sega logo.
I join 2 logs: one working on rpcs3-v0.0.3-2017-10-21-96fd855-8454_linux64:
RPCS3.log-96fd855.gz
the other one which freezes on rpcs3-v0.0.3-2017-10-24-882e949-8502_linux64:
RPCS3.log-882e949.zip

@Asinin3 Asinin3 mentioned this pull request Oct 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.