Skip to content

Commit 6542229

Browse files
committed
try again with 2.6.0 and cuda 12.4
1 parent 48593c4 commit 6542229

File tree

5 files changed

+51
-18
lines changed

5 files changed

+51
-18
lines changed

.github/workflows/publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@ jobs:
1212
fail-fast: false
1313
matrix:
1414
os: [ubuntu-latest, ubuntu-24.04-arm, windows-2022, macos-latest]
15-
accelerator: [cpu, cu118, cu126] #, cu128]
15+
accelerator: [cpu, cu118, cu124] #, cu128]
1616
exclude:
1717
- os: ubuntu-24.04-arm
1818
accelerator: cu118
1919
- os: ubuntu-24.04-arm
20-
accelerator: cu126
20+
accelerator: cu124
2121
# - os: ubuntu-24.04-arm
2222
# accelerator: cu128
2323
- os: macos-latest
2424
accelerator: cu118
2525
- os: macos-latest
26-
accelerator: cu126
26+
accelerator: cu124
2727
# - os: macos-latest
2828
# accelerator: cu128
2929

@@ -93,7 +93,7 @@ jobs:
9393
strategy:
9494
fail-fast: false
9595
matrix:
96-
accelerator: [cpu, cu118, cu126] #, hip, cu124, cu126, cu128]
96+
accelerator: [cpu, cu118, cu124] #, hip, cu124, cu126, cu128]
9797

9898
steps:
9999
- name: Download all the dists

python/cibuildwheel_support/before_all_linux.sh

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,29 @@ if [ "$ACCELERATOR" == "cu118" ]; then
3838
echo "[global]
3939
extra-index-url = https://download.pytorch.org/whl/cu118" > $HOME/.config/pip/pip.conf
4040

41-
pip install openmm-unofficial-cu11 torch==2.7.1
41+
pip install openmm-unofficial-cu11 torch==2.6.0
42+
elif [ "$ACCELERATOR" == "cu124" ]; then
43+
# Install CUDA 12.4
44+
dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/cuda-rhel8.repo
45+
46+
dnf install --setopt=obsoletes=0 -y \
47+
cuda-compiler-12-4 \
48+
cuda-libraries-12-4 \
49+
cuda-libraries-devel-12-4 \
50+
cuda-toolkit-12-4 \
51+
gcc-toolset-13
52+
53+
ln -s cuda-12.4 /usr/local/cuda
54+
ln -s /opt/rh/gcc-toolset-13/root/usr/bin/gcc /usr/local/cuda/bin/gcc
55+
ln -s /opt/rh/gcc-toolset-13/root/usr/bin/g++ /usr/local/cuda/bin/g++
56+
ln -s /usr/local/cuda/targets/x86_64-linux/lib/stubs/libcuda.so /usr/lib/libcuda.so.1
57+
58+
# Configure pip to use PyTorch extra-index-url
59+
mkdir -p $HOME/.config/pip
60+
echo "[global]
61+
extra-index-url = https://download.pytorch.org/whl/cu124" > $HOME/.config/pip/pip.conf
62+
63+
pip install openmm-unofficial-cu12 torch==2.6.0
4264
elif [ "$ACCELERATOR" == "cu126" ]; then
4365
# Install CUDA 12.6
4466
dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/cuda-rhel8.repo
@@ -60,21 +82,21 @@ elif [ "$ACCELERATOR" == "cu126" ]; then
6082
echo "[global]
6183
extra-index-url = https://download.pytorch.org/whl/cu126" > $HOME/.config/pip/pip.conf
6284

63-
pip install openmm-unofficial-cu12 torch==2.7.1
85+
pip install openmm-unofficial-cu12 torch==2.6.0
6486
elif [ "$ACCELERATOR" == "hip" ]; then
6587
# Install HIP 6.2
6688
dnf install -y https://repo.radeon.com/amdgpu-install/6.2.2/el/8.10/amdgpu-install-6.2.60202-1.el8.noarch.rpm
6789
dnf install -y rocm-device-libs hip-devel hip-runtime-amd hipcc
68-
pip install openmm-unofficial-cpu torch==2.7.1
90+
pip install openmm-unofficial-cpu torch==2.6.0
6991
else
70-
pip install openmm-unofficial-cpu torch==2.7.1
92+
pip install openmm-unofficial-cpu torch==2.6.0
7193
fi
7294

7395
#################
7496
SITE_PACKAGES=$(python -c 'import site; print(site.getsitepackages()[0])')
7597

7698
CMAKE_FLAGS=""
77-
if [ "$ACCELERATOR" == "cu118" ] || [ "$ACCELERATOR" == "cu126" ]; then
99+
if [ "$ACCELERATOR" == "cu"* ]; then
78100
ARCH_LIST=$(python -c "import torch; print(';'.join([f'{y[:-1]}.{y[-1]}' for y in [x[3:] for x in torch._C._cuda_getArchFlags().split() if x.startswith('sm_')]]))")
79101
# CMakeLists.txt seems to ignore the CMAKE_CUDA_ARCHITECTURES variable, instead, it is overwritten by TORCH_CUDA_ARCH_LIST
80102
ARCH_LIST_FMT=$(python -c "import torch; print(';'.join([y for y in [x[3:] for x in torch._C._cuda_getArchFlags().split() if x.startswith('sm_')]]))")

python/cibuildwheel_support/before_all_windows.sh

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,18 @@ if [ "$ACCELERATOR" == "cu118" ]; then
2222
echo "[global]
2323
extra-index-url = https://download.pytorch.org/whl/cu118" > "C:\ProgramData\pip\pip.ini"
2424

25-
pip install openmm-unofficial-cu11 torch==2.7.1
25+
pip install openmm-unofficial-cu11 torch==2.6.0
26+
elif [ "$ACCELERATOR" == "cu124" ]; then
27+
curl --netrc-optional -L -nv -o cuda.exe https://developer.download.nvidia.com/compute/cuda/12.4.0/local_installers/cuda_12.4.0_551.61_windows.exe
28+
./cuda.exe -s nvcc_12.4 nvrtc_12.4 nvrtc_dev_12.4 cudart_12.4 cufft_12.4 cufft_dev_12.4 cuda_profiler_api_12.4 nvtx_12.4
29+
rm cuda.exe
30+
# Move CUDA folder to a path without spaces
31+
mv "/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.4" /d/cuda
32+
# Create pip.ini file with PyTorch CUDA 12.4 index
33+
echo "[global]
34+
extra-index-url = https://download.pytorch.org/whl/cu124" > "C:\ProgramData\pip\pip.ini"
35+
36+
pip install openmm-unofficial-cu12 torch==2.6.0
2637
elif [ "$ACCELERATOR" == "cu126" ]; then
2738
curl --netrc-optional -L -nv -o cuda.exe https://developer.download.nvidia.com/compute/cuda/12.6.0/local_installers/cuda_12.6.0_560.76_windows.exe
2839
./cuda.exe -s nvcc_12.6 nvrtc_12.6 nvrtc_dev_12.6 cudart_12.6 cufft_12.6 cufft_dev_12.6 cuda_profiler_api_12.6 nvtx_12.6
@@ -33,14 +44,14 @@ elif [ "$ACCELERATOR" == "cu126" ]; then
3344
echo "[global]
3445
extra-index-url = https://download.pytorch.org/whl/cu126" > "C:\ProgramData\pip\pip.ini"
3546

36-
pip install openmm-unofficial-cu12 torch==2.7.1
47+
pip install openmm-unofficial-cu12 torch==2.6.0
3748
elif [ "$ACCELERATOR" == "hip" ]; then
3849
curl.exe --output HIP.exe --url https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-24.Q3-Win10-Win11-For-HIP.exe
3950
./HIP.exe -install
4051
rm HIP.exe
41-
pip install openmm-unofficial-cpu torch==2.7.1
52+
pip install openmm-unofficial-cpu torch==2.6.0
4253
else
43-
pip install openmm-unofficial-cpu torch==2.7.1
54+
pip install openmm-unofficial-cpu torch==2.6.0
4455
fi
4556

4657
# Download and extract OpenCL
@@ -55,7 +66,7 @@ PYTHONPREFIX=$(python -c 'import site; print(site.getsitepackages()[0])')
5566
SITE_PACKAGES="$PYTHONPREFIX/Lib/site-packages/"
5667

5768
CMAKE_FLAGS="-DENABLE_CUDA=OFF"
58-
if [ "$ACCELERATOR" == "cu118" ] || [ "$ACCELERATOR" == "cu126" ]; then
69+
if [ "$ACCELERATOR" == "cu"* ]; then
5970
ARCH_LIST=$(python -c "import torch; print(';'.join([f'{y[:-1]}.{y[-1]}' for y in [x[3:] for x in torch._C._cuda_getArchFlags().split() if x.startswith('sm_')]]))")
6071
# CMakeLists.txt seems to ignore the CMAKE_CUDA_ARCHITECTURES variable, instead, it is overwritten by TORCH_CUDA_ARCH_LIST
6172
ARCH_LIST_FMT=$(python -c "import torch; print(';'.join([y for y in [x[3:] for x in torch._C._cuda_getArchFlags().split() if x.startswith('sm_')]]))")

python/cibuildwheel_support/before_build_osx.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ rm -rf python/openmm/
1111
rm -rf python/openmmtorch/include
1212

1313
# Install dependencies with pip
14-
pip uninstall torch==2.7.1 openmm-unofficial-cpu -y
15-
pip install torch==2.7.1 openmm-unofficial-cpu
14+
pip uninstall torch==2.6.0 openmm-unofficial-cpu -y
15+
pip install torch==2.6.0 openmm-unofficial-cpu
1616
unset SITE_PACKAGES
1717
SITE_PACKAGES=$(python -c 'import site; print(site.getsitepackages()[0])')
1818

python/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "PLACEHOLDER"
3-
description = "Python wrapper for OpenMM (a C++ MD package)"
3+
description = "OpenMM PyTorch Plugin"
44
authors = [{ name = "Peter Eastman", email = "peastman@stanford.edu" }]
55
readme = "README.md"
66
license = "PSF-2.0"
@@ -41,7 +41,7 @@ skip = [
4141
"*_universal2",
4242
"*-musllinux_*",
4343
]
44-
test-requires = ["pytest", "openmm-unofficial-cpu", "torch==2.7.1"]
44+
test-requires = ["pytest", "openmm-unofficial-cpu", "torch==2.6.0"]
4545
test-command = "pytest {project}/python/tests --ignore={project}/python/tests/TestInteroperability.py"
4646
manylinux-x86_64-image = "manylinux_2_28"
4747
manylinux-aarch64-image = "manylinux_2_28"

0 commit comments

Comments
 (0)