Fabric icon indicating copy to clipboard operation
Fabric copied to clipboard

[Bug]: An error after fabric execution.

Open razvanab opened this issue 1 year ago • 6 comments

What happened?

PS H:\DEV\REPOS\LLMs\fabric> fabric --pattern ai Enter Question: hello Hello there! How can I assist you today? Exception ignored in: <function _ProactorBasePipeTransport.del at 0x00000180A2822A70> Traceback (most recent call last): File "H:\DEV\Conda\envs\temp\lib\asyncio\proactor_events.py", line 116, in del self.close() File "H:\DEV\Conda\envs\temp\lib\asyncio\proactor_events.py", line 108, in close self._loop.call_soon(self._call_connection_lost, None) File "H:\DEV\Conda\envs\temp\lib\asyncio\base_events.py", line 745, in call_soon self._check_closed() File "H:\DEV\Conda\envs\temp\lib\asyncio\base_events.py", line 510, in _check_closed raise RuntimeError('Event loop is closed') RuntimeError: Event loop is closed

Version check

  • [X] Yes I was.

Relevant log output

No response

Relevant screenshots (optional)

No response

razvanab avatar Jun 30 '24 11:06 razvanab

It looks like it's actually stuck within SDL_GL_DeleteContext. I imagine if you enabled showing external code in the stack trace that you'd see it's stuck in your graphics driver. You should try updating it. It'd also be helpful to know what GPU you have

PathogenDavid avatar Jun 20 '24 21:06 PathogenDavid

You are right! image So, I have a Radeon RX 5500M and an Integrated AMD Ryzen 7 4800H with Radeon graphics (I assume that means it's just an integrated card. Sad to say I don't know much about Graphic card numbers or types. Also, aren't both cards integrated when they are inside a laptop?). The drivers are up to date.

Just for curiosity's sake, I tried to force the example to use the dedicated card. This seems to take care of the issue for some reason. Although the problem persists on the integrated graphics card. extern "C" { __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1; }

nobledemon avatar Jun 20 '24 22:06 nobledemon

I use neither SDL nor OpenGL, but this sounds a lot like the backend trying to release resources that are still in use by the graphics hardware. Basically a synchronization issue, which means that the crash depends on timing and GPU load. In that case it should happen even with VSync enabled if you saturate your GPU with work and it didn't have enough time to catch up yet when destroying the context. Depending on the guarantees OpenGL makes this could be an error in the backend implementation (improper synchronization) or a driver bug.

GamingMinds-DanielC avatar Jun 21 '24 08:06 GamingMinds-DanielC

I assume that means it's just an integrated card.

Correct. The Ryzen GPU is your iGPU and the Radeon one is your dGPU.

Also, aren't both cards integrated when they are inside a laptop?

In modern times "integrated GPUs" refers to GPUs integrated with the CPU. (As opposed to GPUs integrated into the motherboard like you used to see on desktops eons ago.)

The drivers are up to date.

That is unfortunate because this smells like a driver bug.

Could you see if the issue happens with example_glfw_opengl3? I imagine it does, but in the off chance it doesn't that might mean a workaround exists for us.

Just for curiosity's sake, I tried to force the example to use the dedicated card. This seems to take care of the issue for some reason. Although the problem persists on the integrated graphics card.

Good test!

Yeah, the issue applying specifically to the iGPU probably part of the bug from AMD's perspective.


this sounds a lot like the backend trying to release resources that are still in use by the graphics hardware.

@GamingMinds-DanielC Good theory, but in OpenGL object lifetimes are managed by the driver so even if this is the case it's still a driver bug.

PathogenDavid avatar Jun 21 '24 23:06 PathogenDavid

I just tried on opengl3 + glfw, the problem doesn't seem to happen. Neither it seems to happen with sdl2 + dx11 example, although I have not checked which graphic cards are being picked in these examples now that I think about it.

For now, manually picking the working card is enough for me, although if you want me to do more tests, I can try to find more time on the following weeks.

nobledemon avatar Jul 03 '24 18:07 nobledemon

Thanks for reporting back!

I just tried on opengl3 + glfw, the problem doesn't seem to happen.

That's quite surprising. If you could verify that it's running on the iGPU when you get a chance that'd definitely be great, but if you're happy there's no rush.

(With vsync off you'd probably be able to tell which GPU is being used just by looking at which one is busy in Task Manager. You can also enable the GPU engine column in the details tab and check it.)

PathogenDavid avatar Jul 03 '24 20:07 PathogenDavid