Lightning chart application crash, when connected to app via RDP

A forum dedicated to WPF version of LightningChart Ultimate.

Moderator: Arction_LasseP

MirroZV
Posts: 15
Joined: Wed May 13, 2020 10:41 am

Lightning chart application crash, when connected to app via RDP

Post by MirroZV » Mon Jan 11, 2021 7:59 am

Hello,
we have problem, when somebody is connected via RDP (remote desktop) and uses our application (lightning chart is part of it), we get an application crash. After investigation we figured out, that it is related to lightning chart component. I attach log. Do you know, where the problem could be?

Many Thanks.
Arction.Wpf.SemibindableCharting.ChartException: Render device create failed.: Rendering engine initialization failed. None of the requested engines could be loaded.

For more information, use GetLastEngineInitResults() method. ---> SharpDX.SharpDXException: HRESULT: [0x88760870], Module: [Unknown], ApiCode: [Unknown/Unknown], Message: Unknown
at SharpDX.Result.CheckError()
at SharpDX.Direct3D9.Device.Reset(PresentParameters[] presentationParametersRef)
at Arction.RenderingEngine11.RenderingEngine11.ND()
at Arction.RenderingEngine11.RenderingEngine11.Dispose(Boolean disposing)
at Arction.Wpf.SemibindableCharting.LightningChartUltimate.RAD(Boolean A)
at Arction.Wpf.SemibindableCharting.LightningChartUltimate.HBD()
--- End of inner exception stack trace ---
at Arction.Wpf.SemibindableCharting.LightningChartUltimate.IIC(MessageSeverity A, MessageType C, Object F, String H, String I, Boolean J, Exception K)
at Arction.Wpf.SemibindableCharting.LightningChartUltimate.HBD()
at Arction.Wpf.SemibindableCharting.LightningChartUltimate.QOD(IntPtr A, Int32 C, IntPtr F, IntPtr H, Boolean& I)
at System.Windows.Interop.HwndSource.PublicHooksFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)

ArctionKestutis
Posts: 411
Joined: Mon Mar 14, 2016 9:22 am

Re: Lightning chart application crash, when connected to app via RDP

Post by ArctionKestutis » Tue Jan 12, 2021 10:12 am

Hello,

The problems with remote connection and LightningChart are very rare. It is probably something specific for user’s environment and/or hardware.
How reproducible is the crash? What is the sequence of steps? Is application crash only it was interrupted by RDP connection? Or app could not be started/run, if Remote connection is on?
Subscribe to _chart.ChartMessage event and log messages in event handler. This will test whatever LightningChart could handler error internally and provide more information about event preceding crush.

Hope this helps.

MirroZV
Posts: 15
Joined: Wed May 13, 2020 10:41 am

Re: Lightning chart application crash, when connected to app via RDP

Post by MirroZV » Tue Jan 12, 2021 11:48 am

The application is possible to run via RDP. It crashes only, when I display curves on lightning chart component and get attached error.

ArctionKestutis
Posts: 411
Joined: Mon Mar 14, 2016 9:22 am

Re: Lightning chart application crash, when connected to app via RDP

Post by ArctionKestutis » Thu Jan 14, 2021 10:27 am

Any update what ChartMessage tells? And whatever subscribing to event eliminated crashes?

MirroZV
Posts: 15
Joined: Wed May 13, 2020 10:41 am

Re: Lightning chart application crash, when connected to app via RDP

Post by MirroZV » Tue May 18, 2021 7:51 am

When I set property ChartRenderingOptions.DeviceType = SoftwareOnlyD11, I don't get error with engine. Before there was always Hardware11. Most probably, using RDP there is no HW rendering possibility.

ArctionKestutis
Posts: 411
Joined: Mon Mar 14, 2016 9:22 am

Re: Lightning chart application crash, when connected to app via RDP

Post by ArctionKestutis » Tue May 18, 2021 8:35 am

It is always good idea to keep DeviceType as 'Auto', 'AutoPreferd9' or 'AutoPreferD11' option. This allows some fall back handling in case of drivers problem. In general, LightningChart® .NET tries to keep rendering result between Rendering Engine 9 and 11 very similar. Unless you have very specific reason to go for DirectX 11 or DirectX 9 drivers only, you should use 'Auto*' option.
There are many different software to create remote connection or virtual machine. Typically each of them have display drivers of their own (not using computer's graphic drivers directly). Users should take care to verify that their system support GPU acceleration and DirectX. Without such support LightningChart® .NET will not work as it normally does.

MirroZV
Posts: 15
Joined: Wed May 13, 2020 10:41 am

Re: Lightning chart application crash, when connected to app via RDP

Post by MirroZV » Tue May 18, 2021 11:56 am

One thing I would like to clarify. When I subscribe on ChartMessage, than I don't get exception about rendering engine, application does not crash. But when I don't subscribe on it, and don't set SoftwareOnlyD11, I get error. Is it enough to be subscribed on the ChartMessage event to prevent engine exception?

ArctionKestutis
Posts: 411
Joined: Mon Mar 14, 2016 9:22 am

Re: Lightning chart application crash, when connected to app via RDP

Post by ArctionKestutis » Tue May 18, 2021 12:44 pm

If ChartMessage report message's MessageSeverity level as RecoverableError, then it is type of error chart could easily recover. However, it requires for user to listen for Chart.ChartMessage. Otherwise, chart will throw exception (to bring error to user's attention).
If reasons for RecoverableError are perfectly normal/understood, then user can ignore error. However, if it come in log file unexpectedly, then it may indicate that something is wrong with user's application code.