fangq / mcx

Monte Carlo eXtreme (MCX) - GPU-accelerated photon transport simulator
http://mcx.space
Other
133 stars 73 forks source link

MCX Studio build not working on MacOS Montery 12.4 #184

Closed PyMarc2 closed 1 year ago

PyMarc2 commented 1 year ago

Downloaded the MCXStudio from the Nightly-Build. The build seems recent (2023-09-09), so I expected it to work on recent version of OSX.

This is what is showing:

Screen Shot 2023-09-09 at 3 29 14 PM

The 'MAC_USER_PLEASE_RUN_THIS_COMMAND_FIRST.command' has been run and sucessfully executed.

The computer is a Macbook Air 2020, Intel CPU, MacOS Montery 12.4

fangq commented 1 year ago

can you try downloading the package again? for some reason, the mcx zip file does not contain mcxstudio executable. I just manually reran the nightly build script and the file is updated.

fangq commented 1 year ago

also, just a word of warning - because Apple stopped supporting CUDA, we are depreciating the support for running mcx on MacOS. Please consider migrating to other operating platforms, or using cloud based solutions, such as

http://mcx.space/cloud/ and https://colab.research.google.com/github/fangq/mcx/blob/master/mcxlab/tutorials/mcxlab_getting_started.ipynb

also, in the past, mcxstudio was almost entirely developed and tested on Linux and Windows. From my limited experience, it does not work well on MacOS even you are able to launch it. If you are just starting using mcx, please consider using the google colab link above to learn how to run mcx (you can run it even without an NVIDIA GPU).

fangq commented 1 year ago

I looked into this further - and attempted to fix the issue, but I don't have a solution yet.

a more detailed discussion can be found here https://forum.lazarus.freepascal.org/index.php/topic,64661.0.html

basically, MacOS-10.15 or newer no longer supports 32 bit applications. I tried to migrate the mcxstudio GUI to 64bit, but the OpenGL library I used for 3D rendering in MCXStudio, GLScene, does not currently work on 64bit Cocoa widgetset. It only works on Carbon, which is 32bit only.

Even I force to build mcxstudio with Cocoa and 64bit, it won't run and give an OpenGL error. cocoa_error

I will keep this ticket open, but whether I can migrate to 64bit app on Mac depends on whether GLScene supports Cocoa on the Mac.

fangq commented 1 year ago

please see my update after investigation: https://forum.lazarus.freepascal.org/index.php/topic,64661.msg491970.html#msg491970

the issue is currently not fixable because the OpenGL component I used for 3D rendering (GLScene_LCL) in mcxstudio does not support 64bit widgetset (Cocoa) on the Mac. Unless GLScene_LCL adds this support (which will not be trivial), mcxstudio won't be able to do 3D rendering in 64bit-only Mac.

As a workaround, I committed the above change (https://github.com/fangq/mcx/commit/1adb6c6a02a3205349e5bb11fabe2e82fd750fe7) to disable any OpenGL functionalities in mcxstudio. This allows it to build on 64bit Mac - and run only the configuration windows (without any 3D rendering windows). However, the compiled mcxstudio-lite GUI, while it can run, still give a few errors when creating new sessions. I will try to sort it out and provide this 64bit mcxstudio-lite interface in the upcoming new release.

fangq commented 1 year ago

@PyMarc2, please download the v2023 mcx package in the nightly build folder and run open mcxstudio_x64.app inside the bin folder and see if it works for you.

As I mentioned above, the OpenGL rendering functions are removed for 64bit Mac, but other configuration and execution functions should still work.

All function should work on MacOS 10.13 or older versions by running the mcxstudio executable.

fangq commented 1 year ago

FYI, the updated mcxstudio_x64 for 64bit-only macos has been included in the latest release v2023.

here is my test on macos-12.6. it does not have 3D visualization feature (plot menu, preview of domain), although other functionalities should be intact.

mcxstudio_macos12
PyMarc2 commented 1 year ago

@fangq, thank you for the update!