<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 10pt'>
<p>Yes, this is a current limitation. At the moment, if ISOLDE is installed then everything gets set up automatically when ChimeraX starts. Essentially, the environment variable OPENMM_PLUGIN_DIR needs to be set before you `import openmm` for the first time. The easiest way to ensure this happens is to put the necessary code into your bundle's `initialize` method (which is guaranteed to be called on ChimeraX startup if you set `custom_init=true` in the BundleInfo tag in your bundle_info.xml). To see an example of this in ISOLDE:</p>
<p>initialize_openmm() method: <a href="https://github.com/tristanic/isolde/blob/a9f976c34affbe917de9e1f6a6062ea423e49054/isolde/src/__init__.py#L10">https://github.com/tristanic/isolde/blob/a9f976c34affbe917de9e1f6a6062ea423e49054/isolde/src/__init__.py#L10</a></p>
<p>... gets called by BundleAPI.initialize(): <a href="https://github.com/tristanic/isolde/blob/a9f976c34affbe917de9e1f6a6062ea423e49054/isolde/src/__init__.py#L44">https://github.com/tristanic/isolde/blob/a9f976c34affbe917de9e1f6a6062ea423e49054/isolde/src/__init__.py#L44</a></p>
<p>... which is called because of the property set in bundle_info.xml: <a href="https://github.com/tristanic/isolde/blob/a9f976c34affbe917de9e1f6a6062ea423e49054/isolde/bundle_info.xml#L14">https://github.com/tristanic/isolde/blob/a9f976c34affbe917de9e1f6a6062ea423e49054/isolde/bundle_info.xml#L14</a>. </p>
<p>Feel free to get in touch if you want any other tips about working with OpenMM in ChimeraX.</p>
<div id="signature"> </div>
<p><br /></p>
<p id="reply-intro">On 2020-09-15 11:28, Thomas Mulvaney wrote:</p>
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0">
<div id="replybody1">
<div dir="ltr">
<div><span style="font-family: arial,sans-serif;">Hi,<br /><br /></span></div>
<div><span style="font-family: arial,sans-serif;">I've been having fun developing a plugin for ChimeraX and want to firstly thank</span></div>
<div><span style="font-family: arial,sans-serif;">everyone involved for such a great platform to build upon.<br /><br /></span></div>
<div><span style="font-family: arial,sans-serif;">I'm starting to introduce a molecular dynamics component and was excited to see that<br /></span></div>
<div><span style="font-family: arial,sans-serif;">ChimeraX ships with OpenMM support.<br /><br /></span></div>
<div><span style="font-family: arial,sans-serif;">Unfortunately, the OpenMM Platform plugins (which add CPU, CUDA, OpenCL etc) functionality, do<br /></span></div>
<div><span style="font-family: arial,sans-serif;">not seem to be loaded by default at least in ChimeraX 1.1 on macOS.<br /><br /></span></div>
<div><span style="font-family: arial,sans-serif;">I couldn't see any documentation about how to load these plugins, <br />but for anyone running into this issue, the following code got things working for me:</span></div>
<div><span style="font-family: arial,sans-serif;"> </span></div>
<div><span style="font-family: monospace;">------<br /></span></div>
<div><span style="font-family: monospace;">import chimerax</span></div>
<div><span style="font-family: monospace;">openmm_plugins_dir = os.path.join(chimerax.app_lib_dir, 'plugins')</span></div>
<div><span style="font-family: monospace;">Platform.loadPluginsFromDirectory(openmm_plugins_dir)</span></div>
<div><span style="font-family: arial,sans-serif;"><span style="font-family: monospace;">------</span><br /><br /></span></div>
<div><span style="font-family: arial,sans-serif;"> </span></div>
<div><span style="font-family: monospace;"><span style="font-family: arial,sans-serif;">Kind regards,<br /></span><br /></span></div>
<div><span style="font-family: arial,sans-serif;">Tom</span>
<div class="v1gmail-adL"><br /><br /></div>
</div>
</div>
</div>
<br />
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">_______________________________________________<br />ChimeraX-users mailing list<br /><a href="mailto:ChimeraX-users@cgl.ucsf.edu">ChimeraX-users@cgl.ucsf.edu</a><br />Manage subscription:<br /><a href="https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users" target="_blank" rel="noopener noreferrer">https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users</a></div>
</blockquote>
</body></html>