Opened 5 months ago

Last modified 5 months ago

#17606 assigned enhancement

Install Boltz with the correct CUDA version

Reported by: Tom Goddard Owned by: Tom Goddard
Priority: moderate Milestone:
Component: Structure Prediction Version:
Keywords: Cc:
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

Currently the Boltz tool installs the PyPi Boltz which on Windows includes torch with only CPU support. If the Windows machine has Nvidia graphics it will run 25x faster using the gpu so I want to install pytorch with cuda support. This is easy to do with a pip install from the pytorch repository as described at the pytorch install page

https://pytorch.org/get-started/locally/

for example

pip3 install torch --index-url https://download.pytorch.org/whl/cu126

The problem is there are 3 cuda versions 11.8, 12.6 and 12.8 to choose from. I can determine what cuda version is supported by the nvidia driver on the computer in a few ways, either using the gputils pypi package (probably best) or looking at the graphics driver version reported by ChimeraX. Once I know the system CUDA version, e.g. 12.4, I probably want to choose an older CUDA version of pytorch since CUDA is backward compatible. This isn't completely clear. On minsky in the vizvault on Linux the PyPi install of torch provides CUDA 12.6 but minsky has CUDA 12.4. It still works fine in Boltz, probably because torch checks if the CUDA version has the features it needs and it does. While pytorch cuda 11.8 might work it might not use some features that are in CUDA 12.4 that the 12.6 version will use. Still probably safest to go with 11.8. But a tricky problem is that 11.8, 12.6, and 12.8 are the currently supported pytorch versions, but 6 months from now they may have dropped 11.8 or changed the provided versions. If ChimeraX hard-codes the available versions it may fail in the future if the pytorch site removes old versions, and it may not use new versions which exactly match the user's system CUDA. So a problem is how I know programmatically which CUDA versions pytorch is distributing.

The same issues apply on Linux. While the default PyPi torch linux package includes cuda 12.6 support, it probably would be more sensible to choose a compatible cuda. If the Linux system appears to have no cuda I'm not sure I want a CPU torch because often linux nvidia drivers are not installed by mistake and later they get installed. Still probably best in that case to install cpu torch since I have no way to know what cuda version the future installed nvidia driver will have.

Change History (2)

comment:1 by Tom Goddard, 5 months ago

I think as a simple improvement I will install the cuda 12.6 windows torch if ChimeraX graphics is using an nvidia driver, or in nogui mode if we find nvidia-smi.exe. This will at least be consistent with Linux installation, although both will have problems if the system cuda is incompatible with 12.6.

comment:2 by Tom Goddard, 5 months ago

I made Boltz install on Windows with Nvidia graphics use CUDA 12.6 torch.

Note: See TracTickets for help on using tickets.