-
Bug
-
Resolution: Fixed
-
P3
-
jfx17
-
b20
-
generic
-
generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8321175 | jfx21.0.2 | Kevin Rushforth | P3 | Resolved | Fixed | b05 |
ADDITIONAL SYSTEM INFORMATION :
JavaFX: tested with 17.0.8, but presumably also an issue in the newest version
OS: Windows 10
HW: Notebook with integrated Intel HD Graphics 520
A DESCRIPTION OF THE PROBLEM :
After a graphic card driver crash, in the Windows 10 event log is protocolled "Display driver igfx stopped responding and has successfully recovered.", yet the JavaFX application only continues to show a black screen. Input events are still registered, which indicates a Prism issue.
With prism.verbose debug output, the console shows "D3DContext::testLostStateAndReset : Unknown D3D error 0x88760874"
0x88760874 is the error code for D3DERR_DEVICEHUNG (D3D9_Ex_ (!)) which corresponds to the error in the Windows event log. In D3DContext.java#testLostStateAndReset this error is not specifically handled.
CUSTOMER SUBMITTED WORKAROUND :
A try-and-error approach with the following changes in D3DContext.java#testLostStateAndReset:
public static final int D3DERR_DEVICEHUNG = 0X88760874;
if (hr == D3DERR_DEVICEHUNG) {
setLost();
long retryMillis = TimeUnit.MINUTES.toMillis(5);
long sleepMillis = TimeUnit.SECONDS.toMillis(1);
for (int i = 0; i < retryMillis; i += sleepMillis) {
int cooperativeLevel = D3DResourceFactory.nTestCooperativeLevel(pContext);
System.err.println("Checking Cooperative Level: " + cooperativeLevel);
if (cooperativeLevel == D3D_OK) {
break;
} else {
try {
Thread.sleep(sleepMillis);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
// Reinitialize after 5 mins anyway, even if result is not OK.
// Reinitialize the D3DPipeline. This will dispose and recreate
// the resource factory and context for each adapter.
D3DPipeline.getInstance().reinitialize();
}
has been sucessful and rendering is working again. The System.err output generated inside the loop only showed again 21 times the D3DERR_DEVICEHUNG error code (equals to 20 seconds in the retry loop), and after that it showed the D3D initialization output. This indicates, that the pd3dDeviceEx->CheckDeviceState returns D3D_OK at some point, but this maybe only apply to the HAL-adapter state, but imho the D3D9(Ex) state has actually been corrupted. As documented here https://learn.microsoft.com/en-us/windows/win32/direct3d9/dx9lh#device-behavior-changes ("If hardware hangs, texture memory is lost. After a driver is stopped, the IDirect9Ex object must be recreated to resume rendering."), it seems that D3DPipeline.getInstance().reinitialize() does the trick.
JavaFX: tested with 17.0.8, but presumably also an issue in the newest version
OS: Windows 10
HW: Notebook with integrated Intel HD Graphics 520
A DESCRIPTION OF THE PROBLEM :
After a graphic card driver crash, in the Windows 10 event log is protocolled "Display driver igfx stopped responding and has successfully recovered.", yet the JavaFX application only continues to show a black screen. Input events are still registered, which indicates a Prism issue.
With prism.verbose debug output, the console shows "D3DContext::testLostStateAndReset : Unknown D3D error 0x88760874"
0x88760874 is the error code for D3DERR_DEVICEHUNG (D3D9_Ex_ (!)) which corresponds to the error in the Windows event log. In D3DContext.java#testLostStateAndReset this error is not specifically handled.
CUSTOMER SUBMITTED WORKAROUND :
A try-and-error approach with the following changes in D3DContext.java#testLostStateAndReset:
public static final int D3DERR_DEVICEHUNG = 0X88760874;
if (hr == D3DERR_DEVICEHUNG) {
setLost();
long retryMillis = TimeUnit.MINUTES.toMillis(5);
long sleepMillis = TimeUnit.SECONDS.toMillis(1);
for (int i = 0; i < retryMillis; i += sleepMillis) {
int cooperativeLevel = D3DResourceFactory.nTestCooperativeLevel(pContext);
System.err.println("Checking Cooperative Level: " + cooperativeLevel);
if (cooperativeLevel == D3D_OK) {
break;
} else {
try {
Thread.sleep(sleepMillis);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
// Reinitialize after 5 mins anyway, even if result is not OK.
// Reinitialize the D3DPipeline. This will dispose and recreate
// the resource factory and context for each adapter.
D3DPipeline.getInstance().reinitialize();
}
has been sucessful and rendering is working again. The System.err output generated inside the loop only showed again 21 times the D3DERR_DEVICEHUNG error code (equals to 20 seconds in the retry loop), and after that it showed the D3D initialization output. This indicates, that the pd3dDeviceEx->CheckDeviceState returns D3D_OK at some point, but this maybe only apply to the HAL-adapter state, but imho the D3D9(Ex) state has actually been corrupted. As documented here https://learn.microsoft.com/en-us/windows/win32/direct3d9/dx9lh#device-behavior-changes ("If hardware hangs, texture memory is lost. After a driver is stopped, the IDirect9Ex object must be recreated to resume rendering."), it seems that D3DPipeline.getInstance().reinitialize() does the trick.
- backported by
-
JDK-8321175 JavaFX application continues to show a black screen after graphic card driver crash
- Resolved
- relates to
-
JDK-8239589 JavaFX UI will not repaint after reconnecting via Remote Desktop
- Resolved
- links to
-
Commit openjdk/jfx21u/18fef3f2
-
Commit openjdk/jfx/b80ec391
-
Review openjdk/jfx21u/37
-
Review openjdk/jfx/1199
(1 links to)