wqmeng 0 Posted January 29 FMX app hanging at start after Windows 11 run for a long time(a few hours). Anybody here notice that when the Windows 11 runs for a while such as a few hours, And my FMX app will be hanging at startup, but I tried to start other apps, there is no such problem. I tested use delphi to create a empty form FMX app, it is still hang when startup, but VCL app will run fine. In this case, the Delphi IDE also has many problems, such the form design window will not load the fmx form and show it, the Object explore and the properties of the form element also do not shows anything, And the popup menu of Delphi IDE will not show the mouse highlight background, and some dialog form of Delphi IDE will not accept mouse click, but if you move keyboard to the buttons on the form, it may(or not) works. I try to open the tools option and User interface and form designer, High DPI, the listbox do not show any listitems in it, and the checkbox show white blank, can not see any words in the text area. And the checkbox could not click/ select or deselect by mouse click. And there seems more problem. But the mostly problem is the FMX app can not run at start up, If I try to start the FMX app repeated by shutdown it in the task manager, After a few retries such as 5 - 20 times, it may startup without any change of the OS. When the problem happens, My Memory shows about 45% (48G total) use, and CPU about 50%( I5 13400F ) usage. Other strange problem the Firefox browser can not copy any text in the web page, and the popup menu of taskbar could not response to mouse too, but you can move up/down button of keyboard to select the popupmenu item and click it to call the command. I am not very sure what's cause this, the probem effect the FMX apps and Delphi IDE, but seems not effect VCL apps. It is worse that the problem happens every day on my PC. Anybody with advice or have a solution? Thank you. Share this post Link to post
Cristian Peța 108 Posted January 31 It would be better to debug. I do not see this behavior. Delphi 12.2, Windows 11 Version 10.0.26100 Build 26100 Share this post Link to post
Brian Evans 111 Posted January 31 No solution but some thoughts. FMX forms use GPU resources including when designing in the IDE which is not the case for most VCL forms/components. Perhaps re-install / upgrade to the latest graphics drivers with whatever 'clean install' option is available selected in the installer. Share this post Link to post
wqmeng 0 Posted yesterday at 08:34 AM Hello, Thank you all for your replies, Now I check the output in the IDE with a FMX form with a few buttons on it, and find out if the app hangs up, it will stop at Module Load: d2d1.dll. No Debug Info. Base Address: $78970000. Process TestWin11HangUp.exe (40248) Module Load: DWrite.dll. No Debug Info. Base Address: $5B760000. Process TestWin11HangUp.exe (40248) Debug Output: Cannot get DirectX SharedMultithread object. Process TestWin11HangUp.exe (40248) Debug Output: Cannot get DirectX SharedMultithread object. Process TestWin11HangUp.exe (40248) Debug Output: Cannot get DirectX SharedMultithread object. Process TestWin11HangUp.exe (40248) Debug Output: Cannot get DirectX SharedMultithread object. Process TestWin11HangUp.exe (40248) Thread Exit: Thread ID: 81372. Process TestWin11HangUp.exe (40248) If the App start correctly, Module Load: d2d1.dll. No Debug Info. Base Address: $78970000. Process TestWin11HangUp.exe (42448) Module Load: DWrite.dll. No Debug Info. Base Address: $5B760000. Process TestWin11HangUp.exe (42448) Debug Output: Cannot get DirectX SharedMultithread object. Process TestWin11HangUp.exe (42448) Debug Output: Cannot get DirectX SharedMultithread object. Process TestWin11HangUp.exe (42448) Module Load: igdumdim32.dll. No Debug Info. Base Address: $78E90000. Process TestWin11HangUp.exe (42448) Module Load: igd9trinity32.dll. No Debug Info. Base Address: $79150000. Process TestWin11HangUp.exe (42448) Module Load: igd9dxva32.dll. No Debug Info. Base Address: $7A840000. Process TestWin11HangUp.exe (42448) The different is that the failed app try to get DirectX SharedMultithread object 4 times and without success? Finally, the app form do not shows up correctly. Debug Output: Cannot get DirectX SharedMultithread object. Process TestWin11HangUp.exe (40248) Try to find more information about 'Cannot get DirectX SharedMultithread object', cound not find any useful results. Thank you. Share this post Link to post
wqmeng 0 Posted yesterday at 08:54 AM After seach, Find this 'Cannot get DirectX SharedMultithread object.' is defined in FMX.Canvas.D2D, const SID_ID2D1Multithread = '{31e6e7bc-e0ff-4d46-8c64-a0a8c41c15d3}'; IID_ID2D1Multithread: TGUID = SID_ID2D1Multithread; SCannotGetSharedMultithreadObject = 'Cannot get DirectX SharedMultithread object.'; The only codes not Succeeded(SharedFactory.QueryInterface(IID_ID2D1Multithread, FSharedMultithread)). Try to query an interface, and failled? class procedure TCanvasD2D.CreateSharedResources; var Prop: TD2D1RenderTargetProperties; Desc: TD3D10_Texture2DDesc; begin inherited; if (FSharedMultithread = nil) and not Succeeded(SharedFactory.QueryInterface(IID_ID2D1Multithread, FSharedMultithread)) then FSharedMultithread := nil; MultithreadEnter; try if FSharedRenderTarget = nil then begin FillChar(Desc, SizeOf(D3D10_TEXTURE2D_DESC), 0); Desc.Format := DXGI_FORMAT_B8G8R8A8_UNORM; Desc.Width := 1; Desc.Height := 1; Desc.MipLevels := 1; Desc.ArraySize := 1; Desc.SampleDesc.Count := 1; Desc.SampleDesc.Quality := 0; Desc.Usage := D3D10_USAGE_DEFAULT; Desc.BindFlags := D3D10_BIND_RENDER_TARGET or D3D10_BIND_SHADER_RESOURCE; if Failed(SharedDevice.CreateTexture2D(Desc, nil, FSharedTexture)) then raise ECannotCreateTexture.CreateFmt(SCannotCreateTexture, [ClassName]); Prop := D2D1RenderTargetProperties(DefaultRenderTargetMode, D2D1PixelFormat(DXGI_FORMAT_UNKNOWN, D2D1_ALPHA_MODE_PREMULTIPLIED)); if Failed(SharedFactory.CreateDxgiSurfaceRenderTarget(FSharedTexture as IDXGISurface, Prop, FSharedRenderTarget)) then raise ECannotCreateRenderTarget.CreateFmt(SCannotCreateRenderTarget, [ClassName]); end; finally MultithreadLeave; end; end; Share this post Link to post
wqmeng 0 Posted yesterday at 08:59 AM This codes, When FSharedMultithread is nil, it will not lock the thread, so that may cause a conflict? Then the app is hangs out? But why the QueryInterface is fail still not known the reason, an OS problem? Share this post Link to post
fisipjm 0 Posted yesterday at 11:12 AM Any Antivirus software Installed? That feels more than an external Problem than a Internal one. Share this post Link to post
wqmeng 0 Posted yesterday at 02:28 PM There is no other antivirus installed. This problem will disappear after the windows11 restart, but it will happen again once the OS run a few hours. Share this post Link to post
Brian Evans 111 Posted yesterday at 04:25 PM (edited) Instead of rebooting try Win+Ctrl+Shift+B shortcut to reset/restart the graphics driver. Not a solution but might point to what is causing problems. Edited yesterday at 04:33 PM by Brian Evans Share this post Link to post
wqmeng 0 Posted yesterday at 06:09 PM Have tried Win+Ctrl+Shift+B, could see the graphics driver was reloaded, the screen got black and then light again, but then try to start the app, still not work. Same hanging at report the above error 4 times. BTW, the app UI is hanging, but other thread in my app still work. So the main thread to fresh and display the UI should be hang out. Share this post Link to post
Brian Evans 111 Posted yesterday at 09:25 PM How about fully logging/signing out then back in (so it resets the Window session)? Very odd such basic functionality is failing. Share this post Link to post
wqmeng 0 Posted 22 hours ago Hello Brian Try log out and sign in windows again, and this time the problem get fixed, the app could start correctly, I tried many times. But a few days before I also do the same test (logout and sign in windows), I could remember that it not work. I will try again, but It needs to restart the windows, and waiting until the problem happen, it will take about a few hours, I will report here tomorrow when I do the logout and sign in next time. Thank you very much. Share this post Link to post
wqmeng 0 Posted 3 hours ago Hello, Yes, Logout and Sign in windows again, will help to get the problem fixed. I tried twice today once the problem happen I log out, and sign in, wait until the problem happen again it does not have to wait so long sometimes just 2~3 hours, it will happen again, try logout and sign in again, the problem gets fixed also, But still do not know what's the matter cause this problem. Share this post Link to post