RMResearch / OpenMPD

11 stars 8 forks source link

Unable to run tutorial 1, DllNotFoundException #4

Open ramashwin opened 1 year ago

ramashwin commented 1 year ago

Hi, I'm trying to run the OpenMPD tutorial example 1. I do not have a real MPD device to connect to.

I set the board IDs to 26 (bottom) and 24 (top) to understand how the code runs. However, I keep getting this error. Unity version: 2021.3.30f1

DllNotFoundException: \Assets\Plugins\OpenMPD.dll assembly:<unknown assembly> type:<unknown type> member:(null)
OpenMPD_PresentationManager.SetupEngine () (at Assets/OpenMPD_UnityWrapper/OpenMPD_RenderingManager/OpenMPD_PresentationManager.cs:148)
OpenMPD_PresentationManager.Instance () (at Assets/OpenMPD_UnityWrapper/OpenMPD_RenderingManager/OpenMPD_PresentationManager.cs:176)
Primitive.Setup () (at Assets/OpenMPD_UnityWrapper/OpenMPD_ContextManager/Primitive/Primitive.cs:90)
Primitive.Update () (at Assets/OpenMPD_UnityWrapper/OpenMPD_ContextManager/Primitive/Primitive.cs:141)

Based on similar errors online, I think this happens because some sub-dependencies of OpenMPD.dll are not being recognized. On checking with dependencies tool, I found that some dlls (in OpenMPD_Libs) such as AsierInho_V2.dll, GSPAT_SolverNaive.dll etc. are not able to be referenced (tool say not found on disk anymore).

I have tried the following but the error persists.

Edit: The dependencies are being found when I added the OpenMPD_Client as part of the PATH variable (and restarted the computer). But the error still persists!!

Any thoughts of how I can get this code to run (or do i need an MPD device to use board IDs other than 0) ?

cabezabuque commented 11 months ago

Hi! Sorry, I missed this post. I am a bit surprised by that. The libraries you are mentioning (Asierinho.dll, GSPAT.dll) are already in your "libs" folder. Are you executing from Visual Studio? Sometimes the project does not store the "Working Directory" for debugging properly. Could you go to Properties->Debugging->Working Environment, and check that it is set to "$(LIBS_HOME)\bin\$(Platform)"? Let me know! Diego

cabezabuque commented 11 months ago

Oh! Sorry, I just realised that you are trying to run the Unity client, instead of the C++ one. In any case, the DLLs should be present in your OpenMPD_Client folder... This should work, even if you do not have the LIBS_HOME folder at all (and you would not need absolute paths, as they are in your project already...).

LordMelman commented 9 months ago

Commenting as I am running into this same issue trying to use the Unity client. I opened a discussion thread on this subject before noticing this issue: https://github.com/RMResearch/OpenMPD/discussions/5

Has a solution come to light on this issue? I've been trying to debug with no luck

cabezabuque commented 9 months ago

Hi all, I have downloaded the current version of OpenMPD and it all seems to work in my computer (and in many others in the lab). Could you maybe provide details on the setup you have (GPU, Unity version, CUDA SDK, etc.). I will then try to reproduce your error and figure out what is going on... Diego

LordMelman commented 9 months ago

Thanks for the reply! Sure thing:

Unity: 2019.4.40f1 GPU: NVIDIA RTX 3050 CUDA Version: 12.4

I installed MyBox from here: https://github.com/Deadcows/MyBox/wiki/Installation and the error updated to : Plugins: Failed to load 'Assets/Plugins/OpenMPD.dll' because one or more of its dependencies could not be loaded.

I'm currently most suspicious of me not installing the correct visual studio addons for vs2019 or maybe some variable issues

If possible can you see if anything glaring is missing from my vs packages:

image path/environmental

image

image

image

MichaelLaFramboise commented 9 months ago

Hi all, I'm having a similar issue to @LordMelman,but I seem to get past the DLL error stage and am able to play the simulation

image

Does this look like correct behavior??

cabezabuque commented 9 months ago

@MichaelLaFramboise Yes, that is the expected output. You have the base OpenMPD library working and the OpenGL extension to project onto the moving particles (the white dots).

@LordMelman Your configuration seems to be correct (CUDA, GPU, etc). It seems to be a problem with the dependencies required by 'Assets/Plugins/OpenMPD.dll'. You could try and re-generate the 'OpenMPD.dll' library. To do this, you should re-compile the OpenMPD project from Visual Studio 2019 (in /OpenMPD/OpenMPD.sln). Build the OpenMPD project and copy the 'OpenMPD.dll' from the output folder (%LIBS_HOME%/bin/x64/OpenMPD.dll) to your Unity project (/OpenMPD_Client/Assets/Clients). You could also rebuild GL_RenderingPlugin and copy it to Assets/Clients, just to be sure. Let me know how that goes... Diego

MichaelLaFramboise commented 9 months ago

Thank you, @cabezabuque - I don't have the hardware connected at the moment, will I be able to run simulations and visualize the particle movement this way, or is it necessary to have the hardware developed and connected

cabezabuque commented 8 months ago

Yes! You do not need to have any hardware to run the demos/tutorials. The system will simply not connect to the hardware, but everything else will run as usual. The unity scene replicates the behaviour of the real system, so what you see there is what you would be getting. That is, assuming the device can actually do what you are asking (i.e., deliver those speeds/accelerations, levitate those many particles, etc). The software will try and do what you are asking of it, but it is up to you to define behaviours that are feasible. Hope that helps, Diego