Opened 6 months ago

Closed 6 months ago

#17572 closed enhancement (fixed)

Make Boltz use Nvidia GPU on Windows if available

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

If Boltz has torch installed with cuda support and the user has Nvidia graphics then make the "default" device in the Boltz tool run predictions on the GPU. Tests showed that if the predicted structure is too large to run on the GPU it seems to fallback to the CPU instead of running out of memory. (Oddly Linux behaves differently and runs out of memory.) So it always appears advantageous to try to run predictions with the Nvidia GPU.

Currently the Boltz tool is always running with the CPU only on Windows.

Change History (1)

comment:1 by Tom Goddard, 6 months ago

Resolution: fixed
Status: assignedclosed

Done.

I made the boltz predict command check that torch has cuda support and that the computer has the nvidia driver installed. It would probably be more robust to simply ask torch if cuda support is available, but that requires running a subprocess python virtual environment to import torch. So instead I just looked for the torch cuda dll in the boltz venv (boltz/Libs/site-packages/torch/lib/torch_cuda.dll) to check that torch has cuda support, and looked for the nvidia-smi executable (C:/Windows/System32/nvidia-smi.exe) to check if the nvidia driver is installed. If so then the default device will be gpu, otherwise cpu on Windows.

Note: See TracTickets for help on using tickets.