Opened 4 months ago

Closed 3 months ago

#17970 closed defect (fixed)

Windows PyPi OpenMM: no CUDA

Reported by: Tristan Croll Owned by: Zach Pearson
Priority: critical Milestone: 1.10
Component: Build System Version:
Keywords: Cc: chimera-programmers
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

The following bug report has been submitted:
Platform:        Windows-10-10.0.26100
ChimeraX Version: 1.10rc202505100155 (2025-05-10 01:55:54 UTC)
Description
Sorry for the very late report (given that the official 1.10 release is imminent): it turns out the Windows version of OpenMM-PyPI doesn't seem to come with the CUDA platform automatically installed. That appears to live in https://pypi.org/project/OpenMM-CUDA-12/... trying to install it after the fact puts it in the user site-packages space where it's not found... it also declares a bunch of NVidia CUDA PyPI packages as dependencies (to the tune of about 640 MB), but these don't seem to actually make it onto the DLL search path. Anyway, after updating my system to CUDA 12, manually copying the DLLs from the wheel into ChimeraX\bin\Lib\site-packages\OpenMM.libs\lib\plugins does get it working... all a bit painful, I know.

OpenGL version: 3.3.0 NVIDIA 576.57
OpenGL renderer: NVIDIA GeForce RTX 3070 Laptop GPU/PCIe/SSE2
OpenGL vendor: NVIDIA Corporation

Python: 3.11.4
Locale: en_GB.cp1252
Qt version: PyQt6 6.8.1, Qt 6.8.2
Qt runtime version: 6.8.2
Qt platform: windows

Manufacturer: HP
Model: HP ZBook Studio 15.6 inch G8 Mobile Workstation PC
OS: Microsoft Windows 11 Pro (Build 26100)
Memory: 34,007,068,672
MaxProcessMemory: 137,438,953,344
CPU: 16 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz
OSLanguage: en-GB

Installed Packages:
    alabaster: 1.0.0
    appdirs: 1.4.4
    asttokens: 3.0.0
    auditwheel: 6.3.0
    babel: 2.17.0
    beautifulsoup4: 4.13.3
    blockdiag: 3.0.0
    blosc2: 3.3.2
    build: 1.2.2.post1
    certifi: 2025.4.26
    cftime: 1.6.4.post1
    charset-normalizer: 3.4.2
    ChimeraX-AddCharge: 1.5.18
    ChimeraX-AddH: 2.2.7
    ChimeraX-AlignmentAlgorithms: 2.0.2
    ChimeraX-AlignmentHdrs: 3.6.1
    ChimeraX-AlignmentMatrices: 2.1
    ChimeraX-Alignments: 2.20.1
    ChimeraX-AlphaFold: 1.0.1
    ChimeraX-AltlocExplorer: 1.1.2
    ChimeraX-AmberInfo: 1.0
    ChimeraX-Aniso: 1.1.3
    ChimeraX-Arrays: 1.1
    ChimeraX-Atomic: 1.60.5
    ChimeraX-AtomicLibrary: 14.1.18
    ChimeraX-AtomSearch: 2.0.1
    ChimeraX-AxesPlanes: 2.4
    ChimeraX-BasicActions: 1.1.3
    ChimeraX-BILD: 1.0
    ChimeraX-BlastProtein: 3.0.0
    ChimeraX-Boltz: 1.0
    ChimeraX-BondRot: 2.0.4
    ChimeraX-BugReporter: 1.0.2
    ChimeraX-BuildStructure: 2.13.1
    ChimeraX-Bumps: 1.0
    ChimeraX-BundleBuilder: 1.5.1
    ChimeraX-ButtonPanel: 1.0.1
    ChimeraX-CageBuilder: 1.0.1
    ChimeraX-CellPack: 1.0
    ChimeraX-Centroids: 1.4
    ChimeraX-ChangeChains: 1.1
    ChimeraX-CheckWaters: 1.5
    ChimeraX-ChemGroup: 2.0.2
    ChimeraX-Clashes: 2.3
    ChimeraX-Clipper: 0.25.0
    ChimeraX-ColorActions: 1.0.5
    ChimeraX-ColorGlobe: 1.0
    ChimeraX-ColorKey: 1.5.8
    ChimeraX-CommandLine: 1.2.6
    ChimeraX-ConnectStructure: 2.0.1
    ChimeraX-Contacts: 1.0.1
    ChimeraX-Core: 1.10rc202505100155
    ChimeraX-CoreFormats: 1.2
    ChimeraX-coulombic: 1.4.5
    ChimeraX-Crosslinks: 1.0
    ChimeraX-Crystal: 1.0
    ChimeraX-CrystalContacts: 1.0.1
    ChimeraX-DataFormats: 1.2.4
    ChimeraX-Dicom: 1.2.7
    ChimeraX-DistMonitor: 1.4.2
    ChimeraX-DockPrep: 1.1.4
    ChimeraX-Dssp: 2.0
    ChimeraX-EMDB-SFF: 1.0
    ChimeraX-ESMFold: 1.0
    ChimeraX-FileHistory: 1.0.1
    ChimeraX-FunctionKey: 1.0.1
    ChimeraX-Geometry: 1.3
    ChimeraX-gltf: 1.0
    ChimeraX-Graphics: 1.4.1
    ChimeraX-Hbonds: 2.5.1
    ChimeraX-Help: 1.3
    ChimeraX-HKCage: 1.3
    ChimeraX-IHM: 1.1
    ChimeraX-ImageFormats: 1.2
    ChimeraX-IMOD: 1.0
    ChimeraX-IO: 1.0.3
    ChimeraX-ISOLDE: 1.10rc0
    ChimeraX-ItemsInspection: 1.0.1
    ChimeraX-IUPAC: 1.0
    ChimeraX-KVFinder: 1.6.2
    ChimeraX-Label: 1.1.14
    ChimeraX-ListInfo: 1.2.2
    ChimeraX-Log: 1.2
    ChimeraX-LookingGlass: 1.1
    ChimeraX-Maestro: 1.9.1
    ChimeraX-Map: 1.3
    ChimeraX-MapData: 2.0
    ChimeraX-MapEraser: 1.0.1
    ChimeraX-MapFilter: 2.0.1
    ChimeraX-MapFit: 2.0
    ChimeraX-MapSeries: 2.1.1
    ChimeraX-Markers: 1.0.1
    ChimeraX-Mask: 1.0.2
    ChimeraX-MatchMaker: 2.2.1
    ChimeraX-MCopy: 1.0
    ChimeraX-MDcrds: 2.10.1
    ChimeraX-MedicalToolbar: 1.1
    ChimeraX-Meeting: 1.0.1
    ChimeraX-MLP: 1.1.1
    ChimeraX-mmCIF: 2.16
    ChimeraX-MMTF: 2.2
    ChimeraX-ModelArchive: 1.0
    ChimeraX-Modeller: 1.5.19
    ChimeraX-ModelPanel: 1.5.1
    ChimeraX-ModelSeries: 1.0.1
    ChimeraX-Mol2: 2.0.3
    ChimeraX-Mole: 1.0
    ChimeraX-Morph: 1.0.2
    ChimeraX-MouseModes: 1.2
    ChimeraX-Movie: 1.0
    ChimeraX-MutationScores: 1.0
    ChimeraX-Neuron: 1.0
    ChimeraX-Nifti: 1.2
    ChimeraX-NMRSTAR: 1.0.2
    ChimeraX-NRRD: 1.2
    ChimeraX-Nucleotides: 2.0.3
    ChimeraX-OpenCommand: 1.14.1
    ChimeraX-OrthoPick: 1.0.1
    ChimeraX-PDB: 2.7.10
    ChimeraX-PDBBio: 1.0.1
    ChimeraX-PDBLibrary: 1.0.4
    ChimeraX-PDBMatrices: 1.0
    ChimeraX-PickBlobs: 1.0.1
    ChimeraX-Positions: 1.0
    ChimeraX-PresetMgr: 1.1.3
    ChimeraX-ProfileGrids: 1.1.2
    ChimeraX-PubChem: 2.2
    ChimeraX-ReadPbonds: 1.0.1
    ChimeraX-Registration: 1.1.2
    ChimeraX-RemoteControl: 1.0
    ChimeraX-RenderByAttr: 1.6.3
    ChimeraX-RenumberResidues: 1.1
    ChimeraX-ResidueFit: 1.0.1
    ChimeraX-RestServer: 1.3.1
    ChimeraX-RNALayout: 1.0
    ChimeraX-RotamerLibMgr: 4.0
    ChimeraX-RotamerLibsDunbrack: 2.0
    ChimeraX-RotamerLibsDynameomics: 2.0
    ChimeraX-RotamerLibsRichardson: 2.0
    ChimeraX-SaveCommand: 1.5.1
    ChimeraX-SchemeMgr: 1.0
    ChimeraX-SDF: 2.0.3
    ChimeraX-Segger: 1.0
    ChimeraX-Segment: 1.0.1
    ChimeraX-Segmentations: 3.5.7
    ChimeraX-SelInspector: 1.0
    ChimeraX-SeqView: 2.17.1
    ChimeraX-Shape: 1.1
    ChimeraX-Shell: 1.0.1
    ChimeraX-Shortcuts: 1.2.0
    ChimeraX-ShowSequences: 1.0.3
    ChimeraX-SideView: 1.0.1
    ChimeraX-SimilarStructures: 1.0.1
    ChimeraX-Smiles: 2.1.2
    ChimeraX-SmoothLines: 1.0
    ChimeraX-SpaceNavigator: 1.0
    ChimeraX-StdCommands: 1.19.1
    ChimeraX-STL: 1.0.1
    ChimeraX-Storm: 1.0
    ChimeraX-StructMeasure: 1.2.1
    ChimeraX-Struts: 1.0.1
    ChimeraX-Surface: 1.0.1
    ChimeraX-SwapAA: 2.0.1
    ChimeraX-SwapRes: 2.5.2
    ChimeraX-TapeMeasure: 1.0
    ChimeraX-TaskManager: 1.0
    ChimeraX-Test: 1.0
    ChimeraX-Toolbar: 1.2.3
    ChimeraX-ToolshedUtils: 1.2.4
    ChimeraX-Topography: 1.0
    ChimeraX-ToQuest: 1.0
    ChimeraX-Tug: 1.0.1
    ChimeraX-UI: 1.45.1
    ChimeraX-Umap: 1.0
    ChimeraX-uniprot: 2.3.1
    ChimeraX-UnitCell: 1.0.1
    ChimeraX-ViewDockX: 1.4.4
    ChimeraX-VIPERdb: 1.0
    ChimeraX-Vive: 1.1
    ChimeraX-VolumeMenu: 1.0.1
    ChimeraX-vrml: 1.0
    ChimeraX-VTK: 1.0
    ChimeraX-WavefrontOBJ: 1.0
    ChimeraX-WebCam: 1.0.2
    ChimeraX-WebServices: 1.1.5
    ChimeraX-Zone: 1.0.1
    colorama: 0.4.6
    comm: 0.2.2
    comtypes: 1.4.10
    contourpy: 1.3.2
    coverage: 7.8.0
    cxservices: 1.2.3
    cycler: 0.12.1
    Cython: 3.0.12
    debugpy: 1.8.14
    decorator: 5.2.1
    dlltracer: 1.0.3
    docutils: 0.21.2
    executing: 2.2.0
    filelock: 3.18.0
    fonttools: 4.58.0
    funcparserlib: 2.0.0a0
    glfw: 2.9.0
    grako: 3.16.5
    h5py: 3.13.0
    html2text: 2024.2.26
    idna: 3.10
    ihm: 2.2
    imagecodecs: 2024.6.1
    imagesize: 1.4.1
    iniconfig: 2.1.0
    ipykernel: 6.29.5
    ipython: 8.26.0
    ipywidgets: 8.1.7
    jedi: 0.19.1
    Jinja2: 3.1.6
    jupyter_client: 8.6.3
    jupyter_core: 5.7.2
    jupyterlab_widgets: 3.0.15
    kiwisolver: 1.4.8
    line_profiler: 4.2.0
    lxml: 5.3.1
    lz4: 4.4.4
    MarkupSafe: 3.0.2
    matplotlib: 3.10.1
    matplotlib-inline: 0.1.7
    msgpack: 1.1.0
    narwhals: 1.42.0
    ndindex: 1.9.2
    nest-asyncio: 1.6.0
    netCDF4: 1.6.5
    networkx: 3.3
    nibabel: 5.2.0
    nptyping: 2.5.0
    numexpr: 2.10.2
    numpy: 2.2.6
    numpy: 1.26.4
    nvidia-cuda-cupti-cu12: 12.9.79
    nvidia-cuda-nvcc-cu12: 12.9.86
    nvidia-cuda-nvrtc-cu12: 12.9.86
    nvidia-cuda-runtime-cu12: 12.9.79
    nvidia-cufft-cu12: 11.4.1.4
    nvidia-nvjitlink-cu12: 12.9.86
    OpenMM: 8.2.0
    OpenMM-CUDA-12: 8.2.0
    openvr: 1.26.701
    packaging: 24.2
    ParmEd: 4.2.2
    parso: 0.8.4
    pep517: 0.13.1
    pickleshare: 0.7.5
    pillow: 10.4.0
    pip: 25.0.1
    pkginfo: 1.11.1
    platformdirs: 4.3.8
    plotly: 6.0.1
    pluggy: 1.5.0
    prompt_toolkit: 3.0.51
    psutil: 7.0.0
    pure_eval: 0.2.3
    py-cpuinfo: 9.0.0
    pycollada: 0.8
    pydicom: 2.4.4
    pyelftools: 0.32
    Pygments: 2.18.0
    pyKVFinder: 0.8.1
    pynmrstar: 3.3.5
    pynrrd: 1.0.0
    PyOpenGL: 3.1.9
    PyOpenGL-accelerate: 3.1.9
    pyopenxr: 1.1.4501
    pyparsing: 3.2.3
    pyproject_hooks: 1.2.0
    PyQt6-commercial: 6.8.1
    PyQt6-Qt6: 6.8.2
    PyQt6-WebEngine-commercial: 6.8.0
    PyQt6-WebEngine-Qt6: 6.8.2
    PyQt6_sip: 13.10.0
    pytest: 8.3.5
    pytest-cov: 6.1.1
    python-dateutil: 2.9.0.post0
    pytz: 2025.2
    pywin32: 310
    pyzmq: 26.4.0
    qtconsole: 5.5.2
    QtPy: 2.4.3
    qtshim: 1.1
    RandomWords: 0.4.0
    requests: 2.32.3
    roman-numerals-py: 3.1.0
    scipy: 1.14.0
    setuptools: 78.1.0
    sfftk-rw: 0.8.1
    six: 1.16.0
    snowballstemmer: 3.0.1
    sortedcontainers: 2.4.0
    soupsieve: 2.7
    Sphinx: 8.2.3
    sphinx-autodoc-typehints: 3.1.0
    sphinxcontrib-applehelp: 2.0.0
    sphinxcontrib-blockdiag: 3.0.0
    sphinxcontrib-devhelp: 2.0.0
    sphinxcontrib-htmlhelp: 2.1.0
    sphinxcontrib-jsmath: 1.0.1
    sphinxcontrib-qthelp: 2.0.0
    sphinxcontrib-serializinghtml: 2.0.0
    stack-data: 0.6.3
    superqt: 0.7.1
    tables: 3.10.2
    tcia_utils: 1.5.1
    tifffile: 2025.3.13
    tinyarray: 1.2.4
    tomlkit: 0.13.2
    tornado: 6.4.2
    traitlets: 5.14.3
    typing_extensions: 4.13.2
    tzdata: 2025.2
    urllib3: 2.4.0
    wcwidth: 0.2.13
    webcolors: 24.11.1
    wheel: 0.45.1
    wheel-filename: 1.4.2
    widgetsnbextension: 4.0.14
    WMI: 1.5.1

Change History (29)

comment:1 by pett, 4 months ago

Cc: chimera-programmers added
Component: UnassignedBuild System
Owner: set to Zach Pearson
Platform: all
Priority: normalhigh
Project: ChimeraX
Status: newassigned
Summary: ChimeraX bug report submissionWindows PyPi OpenMM: no CUDA

comment:2 by pett, 4 months ago

Milestone: 1.10
Priority: highcritical

Seems like the lack of CUDA support is a dealbreaker. We don't want ISOLDE crippled in the 1.10 release.

comment:3 by Zach Pearson, 4 months ago

How did you get this to work in your personal testing? Did you also copy DLLs from the nVidia packages to OpenMM.libs/libs/plugins? I'll have to add whatever DLL directory is necessary somewhere in ChimeraX; I installed the openmm-cuda-12 package into a build's internal site-packages directory and still don't see the CUDA platform using your test code. I'd also like to experiment with deleting some of the unnecessary ones (if there are any) so we don't have to ship another 300mb of dependencies. It's confusing to me why the Conda package doesn't need external libraries, but it's only ~100mb uncompressed.

comment:4 by Tristan Croll, 4 months ago

No - I *only* copied in the openmm plugin DLLs, and otherwise just relied
on my system CUDA installation.

On Sat, 21 Jun 2025 at 00:57, ChimeraX <ChimeraX-bugs-admin@cgl.ucsf.edu>
wrote:

>
>

comment:5 by Tristan Croll, 4 months ago

Should add that I had to update my system CUDA to the latest version.

On Sat, 21 Jun 2025 at 03:46, ChimeraX <ChimeraX-bugs-admin@cgl.ucsf.edu>
wrote:

>
>
>
>

comment:6 by Zach Pearson, 4 months ago

I had to update my system CUDA *and* copy CUDA libraries from C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA to the OpenMM plugins folder (or alternatively, from $site_dir/nvidia/cuffi and $site_dir/nvidia/cuda_nvrtc) to get the OpenMM CUDA platform to load. Which is strange. I only had to do those two. I didn't have to copy nvcuda.dll into that directory.

Trying to add those directories to the DLL search path with os.add_dll_directory does not seem to work

comment:7 by Zach Pearson, 4 months ago

IMO the way forward seems to be to just modify the build to copy those libs into OpenMM.libs/lib/plugins. Who has the time to screw around with Windows DLL loading rules?

comment:8 by Tristan Croll, 4 months ago

I didn't have to do that... but I did find I had to actively uninstall my
old CUDA version before installing the new one. When I *just* installed the
new version it failed to update some environment variables (and iirc also
left the old nvcuda.dll in windows\system32). After I uninstalled and
reinstalled CUDA, then it worked with *just* the OpenMM plugin libraries
copied into the ChimeraX tree.

Looking at my Windows environment variables now, I see:

CUDA_PATH="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.9"
CUDA_PATH_V12.9="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.9"
NVTOOLSEXT_PATH="C:\Program Files\NVIDIA Corporation\NvToolsExt\"
PATH="C:\Program Files\NVIDIA Corporation\NvToolsExt\";"C:\Program
Files\NVIDIA GPU Computing Toolkit\CUDA\v12.9\libnvvp"; ...



On Mon, Jun 23, 2025 at 7:56 AM ChimeraX <ChimeraX-bugs-admin@cgl.ucsf.edu>
wrote:

>
>

comment:9 by Zach Pearson, 4 months ago

OK. I had to restart my machine I guess, but now when I start up ChimeraX it is working. Builds will be ready to try tomorrow

comment:10 by pett, 4 months ago

Tristan, have you had a chance to check if CUDA is working on Windows for you in the current release candidate?

comment:11 by Tristan Croll, 4 months ago

Just did - working fine now!

On Wed, Jun 25, 2025 at 9:23 PM ChimeraX <ChimeraX-bugs-admin@cgl.ucsf.edu>
wrote:

>
>

comment:12 by Zach Pearson, 4 months ago

Great! The release is ready then IMO

\u2014 Zach

>> 
>> 

comment:13 by pett, 4 months ago

Okay by me too.

--Eric

comment:14 by Zach Pearson, 4 months ago

Resolution: fixed
Status: assignedclosed

comment:15 by Tom Goddard, 4 months ago

OpenMM does not have working CUDA support in ChimeraX 1.10 on Windows.

from openmm import Platform

[Platform.getPlatform(i).getName() for i in range(Platform.getNumPlatforms())]

['Reference', 'CPU', 'OpenCL']

ChimeraX 1.10 does include the 640 Mbytes of nvidia cuda libraries from the openmm-cuda-12 PyPi package but as Tristan notes openmm does not find them unless they are moved to the plugins directory. This doubles the size of the ChimeraX 1.10 distribution (560 MB) compared to the 1.9 distribution (290 MB). So even if it was working it does not make sense to double the distribution size since most users do not use ISOLDE. Also ChimeraX 1.9 does not have CUDA support in OpenMM on Windows, it uses OpenCL.

If we have a ChimeraX 1.10.1 release we should remove openmm-cuda-12 to make the distribution half as large. If ISOLDE wants that package it should install it.

comment:16 by Tom Goddard, 4 months ago

Resolution: fixed
Status: closedreopened

comment:17 by Tristan Croll, 4 months ago

Hi Tom,

ChimeraX 1.9 *does* have OpenMM support for CUDA in Windows - it just
requires the user to have a matching version of the CUDA toolkit installed
in their system. Failing that, ISOLDE does fall back to using the OpenCL
platform - still usable, but not ideal given that it’s close to 50% slower
for the same hardware these days.

To reiterate, the *only* bit of the current OpenMM-CUDA wheel that actually
seems necessary is the contents of the OpenMM.libs/lib/plugins directory -
but that *has* to go into the main ChimeraX site-packages tree for OpenMM
to find and load the plugin. As long as the user has a system-wide CUDA
installation, the contents of the nvidia directories don’t need to be there
*at all*.

On Fri, 4 Jul 2025 at 01:26, ChimeraX <ChimeraX-bugs-admin@cgl.ucsf.edu>
wrote:

>
>
>
>
>
>
>

comment:18 by Zach Pearson, 4 months ago

Works on my machine in 1.10:

from openmm import Platform

[Platform.getPlatform(i).getName() for i in range(Platform.getNumPlatforms())]
Out[2]: ['Reference', 'CPU', 'CUDA', 'OpenCL']

Ensure you have the latest version of CUDA installed https://developer.nvidia.com/cuda-downloads and log out and back in or restart your machine, whichever action updates the Windows environment variables.

comment:19 by Tom Goddard, 4 months ago

What version of CUDA is required on Windows for ChimeraX 1.10 openmm? I believe the machine I tested on (vizvault.cgl.ucsf.edu) has either CUDA 12.6 or 12.8 and ChimeraX 1.10 openmm does not list CUDA as a platform.

So it sounds like we still want openmm-cuda-12 installed by the side-packages/nvidia directory with 640 MB of libraries can be deleted from the distribution.

comment:20 by Zach Pearson, 4 months ago

It should work with CUDA 12.x, as peastman claims here https://github.com/openmm/openmm/issues/4763

I have CUDA 12.6 and 12.9 on my system, but my CUDA_PATH points to 12.6 and 12.6 is the first CUDA in my PATH. I changed CUDA_PATH to v12.9 and moved 12.9 to the front of my PATH, then tried getting the platform names again. I was still able to see CUDA in the list.

What is the version of the nVidia driver on the lab Windows machine? It needs to be higher than 528.33 for CUDA 12

https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html#cuda-driver

comment:21 by Zach Pearson, 4 months ago

I modified the build system so that it would remove the unused nvidia-cuda packages and patch them out of openmm-cuda-12's .dist-info/METADATA. I also opened a ticket on the openmm repo to let them know that their openmm-cuda-12 package isn't finding the nVidia packages they depend on so they can either fix it or stop requiring them.

comment:22 by Tristan Croll, 3 months ago

We finally got our new ChimeraX license sorted out here so I just updated
my Linux system to the final 1.10 release. Strangely enough that's now
missing the CUDA libraries as well... I guess I must have installed them in
the rc build and then forgot? Anyway, it turns out this isn't as big an
issue as with Windows, for two reasons:
- Running some profiling using "isolde report" on the demo models,
surprisingly in Linux (at least on my RTX3080) it seems the performance
difference between CUDA and OpenCL is currently negligible - totally lost
in the noise, for simulation sizes from a few hundred to 23k atoms. On my
RTX3070 Windows machine, on the other hand, the CUDA platform is a very
noticeable ~45% faster.
- For people that *really* want the CUDA platform anyway, `sudo
/usr/lib/ucsf-chimerax/bin/python3.11 -m pip install OpenMM-CUDA-12` is all
it took for me.

On Mon, Jul 7, 2025 at 11:03 PM ChimeraX <ChimeraX-bugs-admin@cgl.ucsf.edu>
wrote:

>
>

comment:23 by Tom Goddard, 3 months ago

We plan on making a ChimeraX 1.10.1 release soon. So we could try fixing the Linux OpenMM cuda problem. But if the openmm-cuda-12 PyPi package doubles the size of ChimeraX as it did on Windows then we probably would not include that. Maybe like on Windows it does not need (or even use) the nvidia PyPi packages that openmm-cuda-12 depends on that are very large.

comment:24 by Tristan Croll, 3 months ago

In Linux the libraries *do* link correctly (as long as they’re all in the
main ChimeraX site-packages tree - the OpenMM libraries have rpath entries
relative to their installed location). Will have to experiment to see how
that plays out with the nvidia PyPI packages removed.

On Mon, 21 Jul 2025 at 20:38, ChimeraX <ChimeraX-bugs-admin@cgl.ucsf.edu>
wrote:

>
>

comment:25 by Tom Goddard, 3 months ago

The openmm-cuda-12 PyPi package depends on 5 nvidia PyPi packages totaling 350 Mbytes (for x86):

Requires-Dist: nvidia-cuda-runtime-cu12 3 MB
Requires-Dist: nvidia-cuda-nvcc-cu12 40 MB
Requires-Dist: nvidia-cuda-nvrtc-cu12 90 MB
Requires-Dist: nvidia-cuda-cupti-cu12 11 MB
Requires-Dist: nvidia-cufft-cu12 201 MB

Although there are many ISOLDE users who might use ISOLDE on Linux with CUDA I don't think we can ship 350 MB in the base ChimeraX distribution and make all the other users wait for that when they have no use for it.

Tristan, can you check if CUDA works without those? Zach removed the nvidia packages on Windows and OpenMM worked fine. But maybe it won't on linux if their are rpaths that point to the removed nvidia packages. At any rate previous OpenMM distributions in ChimeraX taken from Conda didn't need those nvidia packages to use CUDA. So I don't understand why OpenMM is shipping them.

Since you say OpenCL is running as fast as CUDA on Linux maybe we don't need CUDA. Another options is that the Linux ISOLDE bundle could depend on openmm-cuda-12.

comment:26 by Tristan Croll, 3 months ago

So the Conda version of OpenMM *did* specify CUDA dependencies - but in the
conda system those were handled outside of the Python framework (by just
copying the necessary libraries into the main conda lib directory). So the
issue never really came up for ChimeraX.

Anyway... a few different approaches work:

1. As long as the CUDA 12.8 toolkit is installed system-wide, then the
bundled-in nvidia libraries are unnecessary:
- renamed site-packages/nvidia to site-packages/nvidia.tmp
- confirmed that the OpenMM CUDA platform failed to load
- installed CUDA 12.8 from the Nvidia repo
- rebooted
- Googled to refresh my memory on how to fix my Nvidia video driver in
Ubuntu after Gnome failed to start because updating CUDA broke it. Again.
Seriously, how is this *still* a thing?
- Rebooted into a working Gnome session (hooray). Started ChimeraX and
confirmed that the CUDA platform is now available and working.

Upside: reduced ChimeraX bundle size
Downside: the full CUDA toolkit is 7.1 GB (about 20x bigger than the full
OpenMM-CUDA-12); as per the above, installing CUDA on a Linux machine can
be a terrifying affair for the neophyte

2. If the CUDA platform doesn't appear, I could just add a message
providing the "sudo /path/to/chimerax/bin/python3.11 -m pip install..."
command needed to install it into the main ChimeraX site-packages (I guess
with a note that it probably won't make much difference to performance).
Advantage: minimal new code needed. Disadvantage: a bit clunky, will
require IT support for people without sudo rights.

3. If I install OpenMM-CUDA-12 into the user site-packages directory,
OpenMM won't *automatically* find and load it. *But* it turns out that
multiple calls to OpenMM's `Platform.loadPluginsFromDirectory()` are now
possible (I'm pretty sure that wasn't the case in the past). It has no
built-in safety net (have to check that the plugin isn't already loaded,
otherwise it will link everything again and shenanigans will probably
ensue)... but if I call it with the absolute path to the user-space plugins
directory things work:
{{{
from openmm import Platform

Platform.getNumPlatforms()
Out[2]: 3

Platform.loadPluginsFromDirectory('/home/tcroll/.local/share/ChimeraX/1.10/lib/python3.11/site-packages/OpenMM.libs/lib/plugins')
Out[3]:
('/home/tcroll/.local/share/ChimeraX/1.10/lib/python3.11/site-packages/OpenMM.libs/lib/plugins/libOpenMMCUDA.so',
 '/home/tcroll/.local/share/ChimeraX/1.10/lib/python3.11/site-packages/OpenMM.libs/lib/plugins/libOpenMMRPMDCUDA.so',
 '/home/tcroll/.local/share/ChimeraX/1.10/lib/python3.11/site-packages/OpenMM.libs/lib/plugins/libOpenMMDrudeCUDA.so',
 '/home/tcroll/.local/share/ChimeraX/1.10/lib/python3.11/site-packages/OpenMM.libs/lib/plugins/libOpenMMAmoebaCUDA.so')

Platform.getNumPlatforms()
Out[4]: 4
}}}

Upside: no change needed to the ChimeraX distribution. Downside: a little
extra (careful) coding needed in ISOLDE to support the new arrangement;
installing all that into multiple user spaces on a multi-use machine would
annoy a lot of sysadmins.

On Tue, Jul 22, 2025 at 12:56 AM ChimeraX <ChimeraX-bugs-admin@cgl.ucsf.edu>
wrote:

>
>
>
>
>
>

comment:27 by Tristan Croll, 3 months ago

... and just for added peace of mind: if both the system-wide CUDA-12.8
*and* the OpenMM-CUDA-12 packages are correctly installed and findable,
everything still works happily.

On Tue, Jul 22, 2025 at 12:14 PM ChimeraX <ChimeraX-bugs-admin@cgl.ucsf.edu>
wrote:

>
>
>
>
>
>
>
>
>
>
>
>
>
>

comment:28 by Zach Pearson, 3 months ago

We should keep the platforms as equal as possible. I can get openmm-cuda-12 installed in the Linux ChimeraX and patch out the nvidia dependencies like we do for Windows.

comment:29 by Zach Pearson, 3 months ago

Resolution: fixed
Status: reopenedclosed

1.10.1 is out sans nvidia libraries on Linux, but with the OpenMM-Cuda-12 dependency.

Note: See TracTickets for help on using tickets.