Project

General

Profile

Actions

Emulator Issues #6951

closed

ShaderCache causes Dolphin to crash upon opening games ONLY with OpenGL. (Intel HD)

Added by c.ed.mead almost 11 years ago.

Status:
Fixed
Priority:
Urgent
Assignee:
% Done:

0%

Operating system:
N/A
Issue type:
Bug
Milestone:
Current
Regression:
No
Relates to usability:
No
Relates to performance:
No
Easy:
No
Relates to maintainability:
No
Regression start:
Fixed in:

Description

[READ THIS: https://forums.dolphin-emu.org/showthread.php?pid=276132 <<<
Your answers are there!]
[Leave the questions as they are and answer them in the next line]
[Remove lines written inside brackets [], but nothing else]

Game Name?
Any Wii or Gamecube game

Game ID?
Any

What's the problem? Describe what went wrong in few words.
Launching a game with the OpenGL back end crashes from the second launch onward (runs fine the first time).

What did you expect to happen instead?
Game to launch normally

What steps will reproduce the problem?
[Don't assume we have ever played the game and know any level names. Be as
specific as possible.]

  1. Select OpenGL
  2. Launch an ISO that has never been launched
  3. Stop the emulation
  4. Launch the game again; it will crash.

Dolphin 3.5 and 3.5-367 are old versions of Dolphin that have
known issues and bugs, so don't report issues about them and test the
latest Dolphin version first.
Which versions of Dolphin did you test on?
4.0.2

Does using an older version of Dolphin solve your issue? If yes, which
versions of Dolphin used to work?
No, I updated to 4.0.2 in hopes this might be fixed.

What are your PC specifications? (including, but not limited to: Operating
System, CPU and GPU)
Intel i7 4700MQ
NVIDIA GeForce 770M
8 GB RAM
Windows 8.1

Are you using the 32 or the 64 bit version of Dolphin?
64

Is there any other relevant information? (e.g. logs, screenshots,
configuration files)
[Upload big files to a hosting service and post links here!]
I know the file that causes the issue! Specifically, deleting the folder "C:/Users/<User>/Dolphin Emulator/ShaderCache" WILL result in a successful launch next time Dolphin is started. Dolphin writes this file upon opening the ROM. I must delete it before trying to launch the game again.

[Do not attach files to this issue. Upload them to another site and
link here. Use imgur.com for images and pastie.org for logs.]


Related issues 2 (0 open2 closed)

Has duplicate Emulator - Emulator Issues #7802: Black Screen with Metroid Prime, any version of dolphinDuplicate

Actions
Has duplicate Emulator - Emulator Issues #7833: F-Zero GX hangs when starting or stopping while using OpenGL backendDuplicate

Actions
Actions #1

Updated by NeoBrainX almost 11 years ago

Does the issue persist if you force Dolphin to be put into high performance mode in the nvidia control panel?

Actions #2

Updated by c.ed.mead almost 11 years ago

@NeoBrainX, manually selecting the high performance dedicated graphics option in the NVIDIA control panel for dolphin.exe did indeed resolve the issue. Thanks for the suggestion.

Actions #3

Updated by JMC4789 almost 11 years ago

This has been happening to me as well; it seems to be very, very recent though.

Actions #4

Updated by JMC4789 almost 11 years ago

Oh, this may be a result of the new NVIDIA drivers rather than dolphin, perhaps?

Actions #5

Updated by JMC4789 almost 11 years ago

  • Status changed from New to Questionable

Eh, I'm unable to confirm now. I was having strange crashes when opening up a second game in a variety of builds, though. I can't pin down how exactly to reproduce it.

Actions #6

Updated by hesham1441999 almost 11 years ago

It does happen to me too, while I don't have NVIDIA. I'm having Intel(R) HD Graphics 4000

Actions #7

Updated by johncroft2580 almost 11 years ago

iv got a nvidia card gtx 760, the only game i get crash straight away when using opengl is with CRASH NITRO KART, i get a popup saying dolphin.exe has stopped responding, if i use direct3d the game will run without crashes, i hope someone can look into this game

Actions #8

Updated by JMC4789 almost 11 years ago

I don't have crash nitro kart, but I do have a GTX 760. I don't know what else to say though. There's no games that crash for me, and I haven't found a reasonably priced crash nitro kart locally.

Actions #9

Updated by rpjohnst over 10 years ago

Not just NVIDIA- Happens for me on an AMD R9 270X with OpenGL backend on Linux with open source radeon drivers.

Actions #10

Updated by JMC4789 about 10 years ago

Issue 7802 has been merged into this issue.

Actions #11

Updated by JMC4789 about 10 years ago

  • Status changed from Questionable to Accepted
  • Priority set to Urgent
  • Milestone set to Current

The crash nitrokart stuff is unrelated, and I have no idea what's going on there, but the original issue is obviously true.

Something needs to be done about this.

Actions #12

Updated by segadult about 10 years ago

I'm running into this as well. I have an Intel(R) HD Graphics 4400 and an Nvidia GT 740m 2GB dual GPU setup. I can run games fine the first time, but then any time after crashes. I have tried specifically running the emulator on the Intel and the Nvidia chipsets, but both crash.

Actions #13

Updated by JMC4789 about 10 years ago

You need to set your Optimus stuff to be in high performance; they won't let us select the Graphics Card in those situations.

Actions #15

Updated by degasus almost 10 years ago

I think we should try to add the gl_rederer string within this cache and to only load them, if this string matches.

Actions #16

Updated by RioverSpear almost 10 years ago

I don't know if this will affect the performance of the game (I encounter same levels of performance when I do this or run a fresh install) but, when I make 3 notepad files in the "C:/Users//Dolphin Emulator/ShaderCache" directory and rename them (Along with their filetypes) to the names of the files already IN that folder, I can run OpenGL any number of times without a crash.

Actions #17

Updated by JMC4789 almost 10 years ago

Issue 7833 has been merged into this issue.

Actions #18

Updated by fallaha56 almost 10 years ago

Hi am getting this issue on a GTX970 desktop with no Intel HD graphics onboard

I initially thought OpenGL was crashing but in fact it's writing a 5GB(!) file

Actions #19

Updated by fallaha56 almost 10 years ago

Hi just tried again and allowed Dolphin to run after trying to exit -now an 11GB(!!) file

Tried with driver shadercache on and off -no difference

Actions #20

Updated by JMC4789 almost 10 years ago

Issue 8138 has been merged into this issue.

Actions #21

Updated by xresusx almost 10 years ago

I have to bring this important issue up, when playing "Baten Kaitos: Eternal Wings and the Lost Ocean" the game creates a file named "ogl-GKBEAF-shaders.cache" inside the "ShaderCache" folder and the file takes a lot of space, last time i checked it had 17GB!!!

This issue needs some attention, hope the developers take a look at this.

This was tested on the latest Dolphin revisions "4.0-4969" and "4.0-5328".

Sorry to bring the topic here but this thread is closely related to this issue, i also have a GTX 970.

Actions #22

Updated by JMC4789 almost 10 years ago

Pinging this again. We don't know what's going wrong exactly. Something to do with asynchronous shutdown causes this to be able to happen. We don't know what or how, and I don't think it's Armada's bug, as much as one uncovered.

Actions #23

Updated by JMC4789 almost 10 years ago

Pinging this again. We don't know what's going wrong exactly. Something to do with asynchronous shutdown causes this to be able to happen. We don't know what or how, and I don't think it's Armada's bug, as much as one uncovered.

Actions #24

Updated by Armada over 9 years ago

To fix this issue we really need to know what kind of shaders (if any) are taking up so much space. Can anyone with such a huge shader file compress it and upload it somewhere? (Assuming it compresses well)

Actions #25

Updated by fallaha56 over 9 years ago

Luckily it does! 4Gb->600kb(!) lol

Actions #26

Updated by muz.jls over 9 years ago

I worked around this by symlinking the cache file to a 128MB partition, it keeps the load/close time down and doesn't seem to do anything else weird. It just fills the whole partition.

When I open Baten Kaitos and then close it as the intro cinematic starts, it seems to add around 1.4GB to the file each time(in a large partition). I did that a couple times and have a 6GB file. I'll go ahead and upload both since they compress so well.

Actions #27

Updated by Armada over 9 years ago

As expected the cache is just full of zeros. Maybe it keeps caching failed compilations?

Actions #28

Updated by Armada over 9 years ago

Does this only happen with OGL or also with D3D?

Actions #29

Updated by muz.jls over 9 years ago

Only happens with OGL, the dx11 files are all below 12KB

Actions #30

Updated by Armada over 9 years ago

If you enable the Side-by-Side stereoscopy mode, does it work or does it give you a warning that it is unsupported?

Actions #31

Updated by metafalica over 9 years ago

Could you also have a look at my ticket more closely to mark it as not dupe (the one that were merged with this)?
https://code.google.com/p/dolphin-emu/issues/detail?id=8138

I think this is different issues.
No crash for me, no 16 GB shaders cache and I run games that does not apply to this ticket starter requirements "2. Launch an ISO that has never been launched
"

Actions #32

Updated by muz.jls over 9 years ago

It works, but with the same huge file writing behavior.

Actions #34

Updated by muz.jls over 9 years ago

That build seems to have fixed it, there's no huge file anymore.

Actions #35

Updated by Armada over 9 years ago

Ok, that means that either one of these 3 cases apply that cause huge shaders to be written to the disk:

  1. Shaders that have been deleted are being written to disk.
  2. Shaders that have failed to link are being written to disk.
  3. Non-existant shaders are being written to disk.

Are any such shaders ever supposed to be part of the cache?

Actions #36

Updated by degasus over 9 years ago

  1. We don't delete shaders at all.
  2. Would result in a panic alert, but maybe they are disabled by the user. We don't delete them as we don't them to be recompiled that often.
  3. I have no idea what this could be.
  4. Driver issue ;)
Actions #37

Updated by JMC4789 over 9 years ago

It's happened on my NVIDIA in F-Zero GX before.

Actions #38

Updated by Armada over 9 years ago

  • Status changed from Accepted to Fix pending

I'll clean up the PR and attempt to merge that one. I'd still like to know the root cause, but since this issue is critical I'll make do with proper error handling for now.

Actions #39

Updated by JMC4789 over 9 years ago

Question: Does this allow Intel HD to boot OpenGL multiple times without crashing now?

Actions #40

Updated by Armada over 9 years ago

Also, does using that build actually reduce the size of cache files that are already huge? We might have to implement a method to clean up those shader caches.

Actions #41

Updated by degasus over 9 years ago

using a new build (with a new git hash) should clear this cache, so this
issue will be solved by itself

2015-03-02 17:08 GMT+01:00 :

Actions #42

Updated by degasus over 9 years ago

  • Status changed from Fix pending to Fixed
Actions #43

Updated by gmendoza678 over 9 years ago

I'm getting this error on 4.0-5991 and 5993, same scenario as described above.

Actions

Also available in: Atom PDF