openstudiocoalition / OpenStudioApplication

The OpenStudio Application is a fully featured graphical interface to OpenStudio models including envelope, loads, schedules, and HVAC.
https://openstudiocoalition.org
Other
133 stars 25 forks source link

ucrtbase.dll Error on Windows 11 in Parallels #485

Open ed-p-may opened 2 years ago

ed-p-may commented 2 years ago

Issue


Trying to install OpenStudioApplication on Mac M1 running parallels and Windows 11, but receiving an error on attempted application startup?

Current Behavior

OS and OS application seem to install fine, but if I try and run OSApp I get the error and application requires force-quit to exit:

“Measure Manager has crashed, attempting to restart… unexpected ucrtbase.dll”

Screen Shot 2022-02-03 at 8 53 48 PM

What I have tried

Log:

I have run the app in DEBUG=1 mode, and generated the following log file, if that is helpful?: osapp.log

Environment

Solutions

Thank you very much in advance for any suggestions or recommendations. I am happy to provide more information if that is helpful. Thank you. -Ed May, @PH-Tools

macumber commented 2 years ago

Thanks for the excellent debugging and issue report Ed.

OpenStudioApp 3.3.0 does work on Windows 11, that is what I am using now. I would recommend trying to revert the dlls in your system directories back to what they were, I have never heard of regsvr32 either so I don't think you have to do that. The only ucrtbase.dll I see in the OS or OSApp installations is under EnergyPlus, maybe we need to ship that for the OSApp? Have you tried copying C:\openstudioapplication-1.3.0\EnergyPlus\ucrtbase.dll to C:\openstudioapplication-1.3.0\bin?

Can you run the command C:/openstudioapplication-1.3.0/bin/openstudio.exe measure -s 50211 in a cmd prompt and see what the output is? Also the command where ucrtbase.dll?

Running parallels on an M1 chip is a configuration I have not tried. The OS Coalition does have access to an M1 VM but I don't think we have a license for parallels. How did you get the Windows 11 image, is there a free or trial version that you can use? I imagine there are a lot of rough edges on virtualization with the M1 chips still, there might be some hints online, maybe https://www.parallels.com/blogs/windows-11-tpm/

ed-p-may commented 2 years ago

Hi Dan @macumber

Thank you for the response and the suggestions.




Perhaps all of this is actually an E+ issue, not an OSApp issue?

regardless - thanks so much for the response. -Ed @PH-Tools

macumber commented 2 years ago

Out of curiosity why do you want to run OSApp in parallels? Is there a problem running the Mac version of OSApp on your Mac? My understanding is that the Mac builds would work on an M1 machine, we may create a separate M1 build at some point.

ed-p-may commented 2 years ago

Ah - good question:

complicated, I know! And the answer might very well be: "Don't run OSApp on Windows 11, just rebuild these other plugins to run on Mac OS instead.", Which is possible, I think. But we were not sure what would work, and what would not work on these new systems. sorry for the complicated answer. Kind of nutty I know. thanks! -Ed

jmarrec commented 2 years ago

@PH-Tools Can you try to install the official energyplus EXE installer for EnergyPlus V22-1-0) on your machine, then retry running the App? direct link: https://github.com/NREL/EnergyPlus/releases/download/v22.1.0/EnergyPlus-22.1.0-ed759b17ee-Windows-x86_64.exe

You might ask "What the hell does that have to do with anything?" :) Well, the E+ IFW installer copies a bunch of dlls to the C:/Windows/SysWow64 and register them via regsvr32.exe, including that ucrt one, so I think it'll fix your issue... For reference, this is done in https://github.com/NREL/EnergyPlus/blob/develop/cmake/qtifw/install_win_copydll.qs


Edit: nevermind, ucrtbase.dll is actually supposed to be a plain windows DLL and there is no need to register it. I'm booting a clean windows 11 VM and will test.

jmarrec commented 2 years ago

I haven't been able to reproduce the issue on a clean windows 11 virtual machine (that I run on virtualbox with an Ubuntu 20.04 host).

Note that even if the measure manager worked, you actually wouldn't be able to run simulations in E+ since 9.6.0 is missing vcomp140.dll (for OpenMP), something I have (fixed recently in https://github.com/NREL/EnergyPlus/pull/9310 and is only included in enegyplus V22-1-0 (though by just placing vcomp140.dll in the openstudioapplication-1.3.0/EnergyPlus folder it would work). This is what you have reported above:

I get a different error when trying to install E+ 9.6: The code execution cannot proceed because MSVCP140.dll was not found.

Except apparnetly for some reason you installed the i386 (32 bit) version

The vcomp140.dll from the EnergyPlusV22-1-0 installer: vcomp140.zip

ed-p-may commented 2 years ago

Hi @jmarrec Thanks for taking a look at this!

I tried installing E+ v22-1-0 as you suggested. I tried it two ways (To see if that mattered):

1) Install E+ v22-1-0 first, then install OpenStudio-3.3.0 and OpenStudioApplication-1.3.1 2) Install OpenStudio-3.3.0 and OpenStudioApplication-1.3.1 first, and then E+ v22-1-0 second

I made sure to copy/paste that vcomp140.dll into C:\openstudioappliocation-1.3.1\EnergyPlus... as well

They all install successfully (including E+ v9.6.0, so that is great), it seems: Screen Shot 2022-05-04 at 9 07 53 AM

and I can run EPLaunch v9.6.0 or 22.1.00 without issue.

But unfortunately still when I try and run the OpenStudioApplication from the toolbar, I get the same error about 'ucrtbase.dll' as soon as it opens, and I have to ctrl-alt-delete to close. Screen Shot 2022-05-04 at 9 07 30 AM

Thanks so much for the suggestion though. FWIW we have two machines in the office, both the new M1 Mac running the same Windows-11 Screen Shot 2022-05-04 at 9 14 20 AM

and both have this same issue. If you have any other thoughts though I'd be happy to test it out! best, Ed @PH-Tools

jmarrec commented 2 years ago

I'm kinda out of ideas, let's hope your post at https://forum.parallels.com/threads/ucrtbase-dll-errors-running-application.356598/ pans out.

jmarrec commented 2 years ago

wait, your windows 11 VM is an arm64 one and not an x86_64 / arm64 isn't it? @PH-Tools

ed-p-may commented 2 years ago

Hi @jmarrec

I'm not sure I know the difference between an arm64 and an x86_64/arm64 I'm afraid? But my environment is currently:

Screen Shot 2022-05-04 at 1 51 09 PM

Screen Shot 2022-05-04 at 1 51 59 PM

Screen Shot 2022-05-04 at 1 54 05 PM

I'm not sure if that makes sense? Happy to provide more details if that is helpful.

thanks! @PH-Tools

jmarrec commented 2 years ago

I'm 99% sure what you have is windows on arm: https://kb.parallels.com/125375

Can you try this in cmd.exe:

wmic os get osarchitecture
echo %PROCESSOR_ARCHITECTURE%

Short story: everything in that stack (E+, OS CLI and OpenStudioApplication) has been compiled on on a x86_64 (also called amd64) platform. The system DLLs the CLI tools expect are for that architecture. If you are running Windows on arm, then the architecture is different and would explain the issue you're seeing.

The difference between architectures are the set of instructions these will run.

Can you also try running this?

C:\EnergyPlusV22-1-0\energyplus.exe --version

I'm afraid there will be a need to recompile everything, or at least the energyplus and openstudio CLI.

jmarrec commented 2 years ago

https://www.windowsdigitals.com/check-windows-11-64-bit-32-bit-or-arm/

ed-p-may commented 2 years ago

Hi @jmarrec

Ah - that makes sense, thanks. And yes you bet - here is what I get:

Screen Shot 2022-05-04 at 2 25 06 PM


Screen Shot 2022-05-04 at 3 06 48 PM

So yes: looks like it is? I suppose that would be the issue then?

macumber commented 2 years ago

Oh wow, I did not even know that was a possibility. I think Windows on ARM is going to become more of a thing: https://www.zdnet.com/article/first-windows-11-on-arm-laptops-arrive-with-microsofts-pluton-chip-heres-why-it-matters/. Probably need to put a Windows ARM build on the roadmap

jmarrec commented 2 years ago

The issue is that there are no runners available for it... if we need to buy an m1 mac to run windows on it, I'll be damned :) So short term I'd say this is too niche (even m1 macos are kinda niche at this point honestly), but longer term that's going to be a thing

jmarrec commented 2 years ago

The only reason I thought of it is because I do have an m1 mac and I have briefly toyed with the trial version of parallels desktop

macumber commented 2 years ago

Should be able to cross compile

https://devblogs.microsoft.com/cppblog/windows-arm64-support-for-cmake-projects-in-visual-studio/

jmarrec commented 2 years ago

Expect massive pain in the beginning especially with regards to conan packages... and we would need to get clang working on windows first. Fun stuff :)!

ed-p-may commented 2 years ago

Thanks @jmarrec @macumber - appreciate your weighing in! Good to that at least it wasn't something that I was doing terribly wrong.

Understood on the Window on ARM support side. Yes - only a small group right now I'd imagine (it mainly has to do with other plugins that work alongside OSApp but are windows-only)? The one thing I might suggest is just that having some note on the webpage / documentation that ARM Windows installation is not supported? That would be plenty for folks at the moment I think?

Regardless: thanks again for taking a look at this! Really appreciate it. @PH-Tools

Nathhier commented 1 year ago

Hello, I am facing the same issue

Screenshot 2023-07-08 at 11 16 26

and have tried most things which @PH-Tools also listed "running srf/scannow Following all the steps outlined in this article: Link Copy/Pasting the OSApp ucrtbase.dll to C:\Windows\System32 Copy/Pasting the C:\Windows\System32 ucrtbase.dll to the OSApp directory Copy/Pasting the OSApp ucrtbase.dll to C:\Windows\SysWOW64 Copy/Pasting the C:\Windows\SysWOW64 ucrtbase.dll to the OSApp directory Registering the uctrbase.dll using regsvr32 Note: when I attempt to register the dll using the regsvr32, I get the error: "The module "ucrtbase.dll" was loaded but the entry-point DLLRegisterServer was not found. Make sure that "ucrtbase.dll" is a valid DLL or OCX file and then try again"

I also downloaded "ARM64 |https://aka.ms/vs/17/release/vc_redist.arm64.exe" hoping that it might solve the Windows on ARM 64 issue. But it didn't. Probably this is not even the way to go about it. I am a novice with all of it.

Screenshot 2023-07-08 at 11 37 36

Was there a solution which I couldn't understand?

My divide specifications are:

Screenshot 2023-07-08 at 11 17 02
macumber commented 1 year ago

Hi @Nathhier I think that unfortunately we are not able to support running Windows ARM under Parallels on Mac M1 processors right now. Are you able to run the Mac M1 release https://github.com/openstudiocoalition/OpenStudioApplication/releases/download/v1.6.0/OpenStudioApplication-1.6.0+53c249a897-macOS12.1-arm64.dmg directly under your Mac?

jmarrec commented 1 year ago

The issue is on the OpenStudio.exe, probably due to the embedded ruby, not the OpenStudioApp.

Running Windows 11 21H2 on arm:

$ openstudio.exe --help
unexpected ucrtbase.dll

I also tried to install the RubyInstaller https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.2.2-1/rubyinstaller-devkit-3.2.2-1-x64.exe

$ ruby --version
unexpected ucrtbase.dll
MOLd57 commented 1 year ago

out of curiosity, was there ever any resolution to this thread. I just ran into the same exact situation on my mac running parallels. my main reason for wanting to run this on my windows side is that thats where im running my Revit / Rhino.inside/ ladybug and honeybee tools.

image

Nathhier commented 1 year ago

Hi @MOLd57 Unfortunately not (at least not for me). I am now using Rhino/Grasshopper only on Mac

ed-p-may commented 1 year ago

@MOLd57

Not to my knowledge. I have not tried to do this install in some time though. My use-case was similar, but I had to give up as I could not find any solution that worked for me. Sorry. @PH-Tools

macumber commented 9 months ago

I just tried running OpenStudioApplication on a Windows ARM64 dev machine and ran into this same issue. I believe this might be related to https://github.com/oneclick/rubyinstaller2/issues/308

kinimodM commented 7 months ago

Hi there,

it's been a while, I wanted to ask if a solution/workaround has already been found for the problem for Mac m2, with parallels 19 windows ? I have installed the latest versions of Ladybug/radiance/Openstudio and still get the error message "unexpected ucrtbase.dll".

Thanks a lot!

macumber commented 7 months ago

Hi @Reflaxface, I don't have any updates right now. We have purchased an ARM Windows development machine and hope to start work on a package for ARM Windows. My hope is that would work for your case (Windows running in Parallels on ARM processor).

kinimodM commented 7 months ago

Hey @macumber,

alright, thanks a lot for letting me know! Would be awesome, though!

macumber commented 7 months ago

@Reflaxface @ed-p-may I just saw this https://github.com/oneclick/rubyinstaller2/issues/308#issuecomment-2021482030 post by a Windows developer that an issue with Ruby on Windows ARM has just been released in 2024-03 Cumulative Update Preview for Windows 11 Version 23H2 for arm64-based Systems (KB5035942). I updated my Windows ARM dev machine to the latest release and now OpenStudio Application is working on that machine. Would either of you be able to try updating your Windows installs in Parallels to this latest version of Windows 11 and try OpenStudio Application out again? While you are at it, we are testing a 1.7.1-rc1 installer that has some bug fixes relative to 1.7.0. The issue for providing feedback on the 1.7.1-rc1 release is https://github.com/openstudiocoalition/OpenStudioApplication/issues/706 and the installers are available at https://github.com/openstudiocoalition/OpenStudioApplication/releases/tag/v1.7.1-rc1