python312Packages.tinygrad: fix libnvrtc patching

This commit is contained in:
Gaetan Lepage
2024-10-05 22:45:29 +02:00
committed by Gaétan Lepage
parent 641e2640a7
commit a225c7d307
2 changed files with 14 additions and 2 deletions
@@ -36,6 +36,8 @@
torch,
tqdm,
transformers,
tinygrad,
}:
buildPythonPackage rec {
@@ -92,7 +94,13 @@ buildPythonPackage rec {
# pyobjc-framework-metal
];
pythonImportsCheck = [ "tinygrad" ];
pythonImportsCheck =
[
"tinygrad"
]
++ lib.optionals cudaSupport [
"tinygrad.runtime.ops_nv"
];
nativeCheckInputs = [
blobfile
@@ -175,6 +183,10 @@ buildPythonPackage rec {
"extra/"
];
passthru.tests = {
withCuda = tinygrad.override { cudaSupport = true; };
};
meta = {
description = "Simple and powerful neural network framework";
homepage = "https://github.com/tinygrad/tinygrad";
@@ -43,7 +43,7 @@ index 6af74187..c5a6c6c4 100644
+ pass
+if libnvrtc is None:
+ raise RuntimeError(f"`libnvrtc.so` not found")
+_libraries['libnvrtc.so'] = ctypes.CDLL(libnvrtc)
+_libraries['libnvrtc.so'] = libnvrtc
def string_cast(char_pointer, encoding='utf-8', errors='strict'):
value = ctypes.cast(char_pointer, ctypes.c_char_p).value
if value is not None and encoding is not None: