https://bugs.winehq.org/show_bug.cgi?id=47592
Bug ID: 47592 Summary: HFSS antenna modelling software running but erroneous output ! Product: Wine Version: 3.0.2 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: friedtj@free.fr Distribution: ---
I wanted to share with this community a rather amazing observation that has been baffling me for the last week: ANSYS HFSS 13.02 is running with Wine, but the output is erroneous ! I can hardly imagine how a calculation can be completed but yield incorrect results: my understanding is that a library (or API implementation) either works or does not -- and to tell the truth I did not expect such a complex piece of software as HFSS to run on Wine -- but it does and rather nicely except to the point of analyzing the results.
Being new to HFSS but quite familiar with antenna design, I started with the trivial test case of the dipole antenna: resonance frequency was close to the expected value considering the dimensions, so the software must be working properly since it computes admittances (see http://jmfriedt.org/S11both.pdf, green curve) which are consistent with the values given by (FOSS) NEC2 and GPRMax3D. However all attempts to plot the radiation pattern failed (no plot at all, or sometimes inconsistent results of an isotropic radiator with no null), and radiation efficiency was consistently 0 (a poor result for a classical antenna), so I was of course questioning my ability to understand the proper operation of the software. After attempting all possible solutions, I ended up installing a Win7 system on VirtualBox for testing, and to my amazement the software yields the proper radiation diagram (http://jmfriedt.org/diagramme_3D.png) and slightly different reflection coefficients (http://jmfriedt.org/S11both.pdf, purple curve), the difference being emphasized on the impedance curve (http://jmfriedt.org/Z11_both.pdf).
I am of course not blaming the amazing emulator on this difference, but with this post 1/ may point out a subtle misbehavior of one of the computation library used by Wine 2/ help others attempting to run HFSS on Wine question the results they achieve.
These tests were completed with wine-3.0.2 as provided by Debian GNU/Linux Unstable at the time of writing this post, configured (winecfg) either as Win10 or Win7, fresh install with no other MS-Windows or proprietary library installed prior to HFSS (clean $HOME/.wine directory).
Not sure how I can help debug, best wishes, Jean-Michel
https://bugs.winehq.org/show_bug.cgi?id=47592
--- Comment #1 from Jean-Michel Friedt friedtj@free.fr --- Created attachment 64999 --> https://bugs.winehq.org/attachment.cgi?id=64999 HFSS configuration file for dipole simulation (3D pattern plot is empty with Wine)
https://bugs.winehq.org/show_bug.cgi?id=47592
Zebediah Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |z.figura12@gmail.com
--- Comment #2 from Zebediah Figura z.figura12@gmail.com --- Hello, thanks for the bug report.
I don't know anything about antenna design or anything that this software is doing, so I might have to ask you to simplify a bit. As far as I can tell there are two different bugs you're seeing:
1. one or more calculations done by the program produces slightly inaccurate results under Wine,
2. the radiation pattern plot doesn't appear.
(1) is tricky, because Wine does little to no math itself, instead relying on the host C library. Presumably the code is calling into some C library, and there are some floating point inaccuracies? The first thing I'd try is to replace that C library with the native version to see if that is indeed the problem, but first we need to know which one it is. Can you attach a log when running the program (and doing whatever actions lead to this inaccuracy being visible) with WINEDEBUG=+loaddll?
(2) I may need more information for. Is this potentially a graphical failure? e.g. is the plot blank, or are there axes or something similar but no data? Screenshots may be helpful here.
https://bugs.winehq.org/show_bug.cgi?id=47592
--- Comment #3 from Jean-Michel Friedt friedtj@free.fr --- Created attachment 65003 --> https://bugs.winehq.org/attachment.cgi?id=65003 radiation report, MS-Windows
https://bugs.winehq.org/show_bug.cgi?id=47592
--- Comment #4 from Jean-Michel Friedt friedtj@free.fr --- Created attachment 65004 --> https://bugs.winehq.org/attachment.cgi?id=65004 radiation report, Wine
https://bugs.winehq.org/show_bug.cgi?id=47592
--- Comment #5 from Jean-Michel Friedt friedtj@free.fr --- Created attachment 65005 --> https://bugs.winehq.org/attachment.cgi?id=65005 radiation report, MS-Windows (text file)
https://bugs.winehq.org/show_bug.cgi?id=47592
--- Comment #6 from Jean-Michel Friedt friedtj@free.fr --- Created attachment 65006 --> https://bugs.winehq.org/attachment.cgi?id=65006 radiation report, Wine (text file)
https://bugs.winehq.org/show_bug.cgi?id=47592
--- Comment #7 from Jean-Michel Friedt friedtj@free.fr --- Created attachment 65007 --> https://bugs.winehq.org/attachment.cgi?id=65007 HFSS execution output under Wine, NO debug (simulation & display)
https://bugs.winehq.org/show_bug.cgi?id=47592
--- Comment #8 from Jean-Michel Friedt friedtj@free.fr --- Created attachment 65008 --> https://bugs.winehq.org/attachment.cgi?id=65008 HFSS execution output under Wine, with debug (startup, loading model, simulation & display)
https://bugs.winehq.org/show_bug.cgi?id=47592
--- Comment #9 from Jean-Michel Friedt friedtj@free.fr --- Thank you for your reply. Indeed I was not clear about the 3D radiation pattern issue which I try to describe better below:
- one or more calculations done by the program produces slightly inaccurate
results under Wine,
- the radiation pattern plot doesn't appear.
(1) is tricky, because Wine does little to no math itself, instead relying on the host C library. Presumably the code is calling into some C library, and there are some floating point inaccuracies? The first thing I'd try is to replace that C library with the native version to see if that is indeed the problem, but first we need to know which one it is. Can you attach a log when running the program (and doing whatever actions lead to this inaccuracy being visible) with WINEDEBUG=+loaddll?
Please find attached screenlog_nodebug.0 the output of running HFSS simulation with NO debug information (just program output with mostly genuine messages but a few Wine warning it seems) and screenlog_withdebug.0 the full output with loaddll option enabled, from starting the software to displaying the result. The log file is annotated with 3 breakpoints manually inserted and prefixed with ## JMF: 1/ loading dynamic libraries all the way to displaying an empty graphical user interface at "JMF: END OF OPENING SOFTWARE GUI". Then I File -> Open the model which hardly leads to additional messages up to "JMF: END OF LOADING MODEL". I then run the simulation all the way to "JMF: END OF COMPUTATION". I then plot the reflection coefficient (the curve that is not wrong but slightly different from the MS-Windows output) all the way to "JMF: END OF PLOTTING 2D S11". Finally I compute the 3D radiation pattern which does provide a graphical window but no relevant content (see below) all the way to the end of the log. I stopped the log before quitting HFSS.
(2) I may need more information for. Is this potentially a graphical failure? e.g. is the plot blank, or are there axes or something similar but no data? Screenshots may be helpful here.
My mistake in describing the issue: the graphical interface opens fine and displays a chart axis and labels, but no curve. My understand is that the lack of curve is due to erroneous computations which this time are not "slightly" wrong but so wrong that the displayed parameters are all 0. Attached is the antenna parameters (the output which would be plotted on the 3D graph) computed from MS-Windows (radiation_report_MSWindows.png) with reasonable values (radiation efficiency close to 1, gain close to 1.8 dB) as opposed to the Wine outptu (radiation_report_Wine.png) which shows an efficiency of 0 and a gain of 0 (stating that the antenna is radiating no energy at all, hence the inexistent radiation pattern in the plot). The same information is provided as exportparams*.txt file although I don't think the detailed content is relevant to the bug report.
Thank you, Jean-Michel
https://bugs.winehq.org/show_bug.cgi?id=47592
--- Comment #10 from Zebediah Figura z.figura12@gmail.com --- Okay, thanks, I think I understand better now.
From the log I see msvcr71, msvcr90, vcomp90, so can you please try installing
the native 2003 and 2008 MSVC runtimes, e.g. `winetricks -q vcrun2003` and `winetricks -q vcrun2008`? Hopefully that'll fix whatever's wrong with the computation; if not, this will probably get much harder to debug...
https://bugs.winehq.org/show_bug.cgi?id=47592
--- Comment #11 from Jean-Michel Friedt friedtj@free.fr --- Amazing, that was it, the simulation is now working properly with the same result as found when running under genuine MS-Windows7 OS. I had indeed seen that HFSS was installing some Microsoft C Runtime libraries but believed that had been done during the Wine install as well. Would you mind explaining how the software was running without the liobraries in the first place ? Or how manually installing the libs solved the issue ? Anyway thanks a lot, excellent result, Jean-Michel
https://bugs.winehq.org/show_bug.cgi?id=47592
Zebediah Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|-unknown |msvcrt
--- Comment #12 from Zebediah Figura z.figura12@gmail.com --- (In reply to Jean-Michel Friedt from comment #11)
Amazing, that was it, the simulation is now working properly with the same result as found when running under genuine MS-Windows7 OS. I had indeed seen that HFSS was installing some Microsoft C Runtime libraries but believed that had been done during the Wine install as well. Would you mind explaining how the software was running without the liobraries in the first place ? Or how manually installing the libs solved the issue ?
It's using Wine's own implementation of these libraries by default. There are some components, like the MSVC runtime, that we can drop in the native versions of, to see if they fix a bug. So that proves there's a bug somewhere in our native components.
Of course we'd like to be able to fix whatever's broken with our builtin libraries, since relying on Microsoft redistributables is not great for several reasons. If you have the time, then, could you please reset the libraries back to builtin (open winecfg and remove overrides from the "libraries" tab), and then take a log with WINEDEBUG=+relay,+msvcrt,+vcomp? It'll probably take a lot longer, and produce a large output file, if it doesn't get prohibitively large you can compress and attach it here, or upload it elsewhere if it's too large even then.
https://bugs.winehq.org/show_bug.cgi?id=47592
--- Comment #13 from Jean-Michel Friedt friedtj@free.fr ---
So that proves there's a bug somewhere in our native components.
I'd love to help correcting this issue. At least I can confirm that disabling the MS libraries and getting back to the Wine libraries produced the initial effect, namely a slight error on the antenna reflection coefficient and a completely erroneous calculation on the radiation pattern and radiation efficiency (which I believe to be post-processing steps).
Of course we'd like to be able to fix whatever's broken with our builtin libraries, since relying on Microsoft redistributables is not great for several reasons. If you have the time, then, could you please reset the libraries back to builtin (open winecfg and remove overrides from the "libraries" tab), and then take a log with WINEDEBUG=+relay,+msvcrt,+vcomp? It'll probably take a lot longer, and produce a large output file, if it doesn't get prohibitively large you can compress and attach it here, or upload it elsewhere if it's too large even then.
12 GB is as prohibitively large as I can consider a dump, and the calculation was only starting so I am not even sure the erroneous part of the computation was reached (I am not well aware of the details of HFSS but my understanding is that is starts meshing space to prepare the simulation ... the log file ended up filling the space left on my hard disk by that time -- meaning we did not even get started with actually solving the problem yet). I am putting the part of the dump file that I could save (compressed 12 GB) at https://filesender.renater.fr/?s=download&token=7cd7d4f6-fbe2-432d-b2b5-... although the compressed log is only 250 MB large. Ideally I could try to simplify the problem to help isolate the computational error, but I am not sure I understand HFSS well enough not to simplify the model beyond reasonable.
I don't mind running the dump further on an external hard disk with more space available if it can be of any use -- if you have time answering my requests, I of course have time generating dump files -- but I am not sure such huge files can be of any use. If they can, I'll be happy generating more of them ! Also if there is an iterative way of testing one library after another rather than all at the same time, maybe we could converge faster.
Thanks, Jean-Michel
https://bugs.winehq.org/show_bug.cgi?id=47592
--- Comment #14 from Zebediah Figura z.figura12@gmail.com --- Ergh, yes, I was afraid of something like that.
Let's try a different idea. Can you please attach a log with WINEDEBUG=+module,+imports?
https://bugs.winehq.org/show_bug.cgi?id=47592
--- Comment #15 from Jean-Michel Friedt friedtj@free.fr ---
Let's try a different idea. Can you please attach a log with WINEDEBUG=+module,+imports?
that makes a more reasonable log file, hardly affecting the execution time. Here I launched the software, loaded the model, ran the simulation, displayed the reflection coefficient to make sure the result was slightly erroneous, and displayed the antenna radiation parameter which are completely wrong, before quitting the software. Full log is attached.
Thanks, Jean-Michel
https://bugs.winehq.org/show_bug.cgi?id=47592
--- Comment #16 from Jean-Michel Friedt friedtj@free.fr --- Created attachment 65021 --> https://bugs.winehq.org/attachment.cgi?id=65021 WINEDEBUG=+module,+imports log
https://bugs.winehq.org/show_bug.cgi?id=47592
Piotr Caban piotr.caban@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |piotr.caban@gmail.com
--- Comment #17 from Piotr Caban piotr.caban@gmail.com --- It's a long shot but it might be related to https://bugs.winehq.org/show_bug.cgi?id=37149