Skip to content

Commit

Permalink
Fixed:
Browse files Browse the repository at this point in the history
    - CUDA and Vulkan detection.
  • Loading branch information
mtasic85 committed Aug 16, 2024
1 parent ba5a3a9 commit ac7e5ea
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# CHANGELOG

## v0.1.13

Fixed:
- CUDA and Vulkan detection.

## v0.1.12

Added:
Expand Down
4 changes: 2 additions & 2 deletions llama/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

try:
from numba import cuda
except ImportError:
except Exception:
pass

try:
import vulkan as vk
except ImportError:
except Exception:
pass


Expand Down
18 changes: 11 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "llama-cpp-cffi"
version = "0.1.12"
version = "0.1.13"
description = "Python binding for llama.cpp using cffi"
homepage = "https://github.com/tangledgroup/llama-cpp-cffi"
repository = "https://github.com/tangledgroup/llama-cpp-cffi"
Expand Down Expand Up @@ -49,6 +49,7 @@ script = "scripts/build.py"
[tool.cibuildwheel.linux]
build-frontend = "build"
before-build = """
ARCH=$(uname -m)
pip install poetry
if [[ $AUDITWHEEL_PLAT == manylinux* ]]; then
Expand All @@ -57,20 +58,23 @@ if [[ $AUDITWHEEL_PLAT == manylinux* ]]; then
dnf update -y
dnf install -y unzip p7zip p7zip-plugins upx
# Check architecture
ARCH=$(uname -m)
# vulkan
if [[ "$ARCH" == "x86_64" ]]; then
# vulkan packages only on x86_64
dnf install -y vulkan-tools vulkan-headers vulkan-loader vulkan-loader-devel vulkan-validation-layers spirv-tools
dnf install -y https://pkgs.sysadmins.ws/el8/extras/x86_64/glslc-2023.1-3.el8.x86_64.rpm https://pkgs.sysadmins.ws/el8/extras/x86_64/glslang-12.0.0-1.el8.x86_64.rpm
fi
else
apk -U add unzip 7zip upx vulkan-dev shaderc spirv-tools
apk -U add unzip 7zip upx
# vulkan
if [[ "$ARCH" == "x86_64" ]]; then
apk -U add mesa-vulkan-ati mesa-vulkan-intel mesa-vulkan-layers mesa-vulkan-swrast vulkan-headers vulkan-loader vulkan-loader-dev vulkan-tools vulkan-validation-layers vulkan-validation-layers-dev vulkan-validation-layers-static shaderc glslang glslang-dev glslang-libs glslang-static
fi
fi
"""
skip = ["cp36-*", "cp37-*", "cp38-*", "cp39-*", "pp37-*", "pp38-*", "pp39-*", "*i686"]
# skip = ["cp36-*", "cp37-*", "cp38-*", "cp39-*", "pp37-*", "pp38-*", "pp39-*", "*i686", "*manylinux*"]
# skip = ["cp36-*", "cp37-*", "cp38-*", "cp39-*", "pp37-*", "pp38-*", "pp39-*", "*i686"]
skip = ["cp36-*", "cp37-*", "cp38-*", "cp39-*", "pp37-*", "pp38-*", "pp39-*", "*i686", "*manylinux*"]
# skip = ["cp36-*", "cp37-*", "cp38-*", "cp39-*", "cp310-*", "cp311-*", "pp37-*", "pp38-*", "pp39-*", "pp310-*", "*i686"]
# skip = ["cp36-*", "cp37-*", "cp38-*", "cp39-*", "cp310-*", "cp311-*", "pp37-*", "pp38-*", "pp39-*", "pp310-*", "*i686", "*musllinux*"]
# skip = ["cp36-*", "cp37-*", "cp38-*", "cp39-*", "cp310-*", "cp311-*", "cp313-*", "pp37-*", "pp38-*", "pp39-*", "pp310-*", "*i686", "*musllinux*"]
Expand Down
2 changes: 1 addition & 1 deletion scripts/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ def build(*args, **kwargs):
# build_cpu_openblas(*args, **kwargs)

# vulkan 1.x
if env.get('GGML_VULKAN', '1') != '0' and env.get('AUDITWHEEL_ARCH') in ('x86_64', None)::
if env.get('GGML_VULKAN', '1') != '0' and env.get('AUDITWHEEL_ARCH') in ('x86_64', None):
clean_llama_cpp()
build_vulkan_1_x(*args, **kwargs)

Expand Down

0 comments on commit ac7e5ea

Please sign in to comment.