Integrate native Strata runtime, profiles and reproducible restore
This commit is contained in:
1 parent
4485b62774
commit
e48ad9564f
29 files changed
+2164
-15
No files matched your search
@@ -0,0 +1,97 @@
|
||||
# Strata in Athena Deck
|
||||
|
||||
Strata 0.1.42, Commit `61b3fb5dd3f1e8ec09cf7e4e05208bc6d3c46406`, ist eine
|
||||
zweite Chat-Laufzeit. Deck startet das unveränderte `serve/server.py` und dessen
|
||||
Engine als eigene Prozessgruppe auf einem zufälligen Loopback-Port mit einem
|
||||
zufälligen, nur lokal gespeicherten Token. Clients verwenden weiterhin den
|
||||
Athena-Endpunkt und dessen Zugangsschutz. Kein separater Strata-Container oder
|
||||
öffentlicher Strata-Port ist im Produkt erforderlich.
|
||||
|
||||
## Nativer Aufbau
|
||||
|
||||
Debian 12/13 x86_64, AVX2, NVIDIA-Treiber kompatibel mit CUDA 13 (>=580), zwei
|
||||
NVIDIA-GPUs, Python >=3.12 samt venv, git, g++, make, CA-Zertifikate. Debian 12
|
||||
benötigt eine separat provisionierte unterstützte Python-3.12-Version; kein
|
||||
unbeaufsichtigter Austausch des System-Python. Als Administrator auf Debian 13:
|
||||
|
||||
```sh
|
||||
apt-get install python3 python3-venv git g++ make ca-certificates
|
||||
```
|
||||
|
||||
Deck-Dienstbenutzer muss die Zustands- und Modellverzeichnisse schreiben sowie
|
||||
beide GPU-Geräte verwenden dürfen. Auf Athena sind die Architekturen 86 (3060)
|
||||
und 120 (5080) qualifiziert. Keine automatischen Treiberänderungen oder Reboots.
|
||||
|
||||
```sh
|
||||
python3 deploy/install_strata.py --destination /var/lib/athena-deck/strata-runtime
|
||||
```
|
||||
|
||||
Das Rezept lädt einen festen Strata-Commit, dessen gepinnte Python-Abhängigkeiten
|
||||
und dessen festes llama.cpp-Unterprojekt. Es baut mit zwei Compilerjobs. Wenn
|
||||
kein CUDA-13.0-Compiler vorhanden ist, wird ausschließlich ein **privates Toolkit**
|
||||
unter `strata-runtime/cuda` installiert, aus NVIDIA-Redistributables mit festen
|
||||
SHA-256-Werten in `strata-cuda13.lock.json`. Kein Treiber und keine Systempakete
|
||||
werden dabei ersetzt. NVIDIA-Lizenzbedingungen gelten. Für andere GPU-Architekturen
|
||||
`--architectures` explizit anpassen; das heutige Rezept ist nicht universell.
|
||||
|
||||
Unter Laufzeiten → Strata kann die identische Installation gestartet werden.
|
||||
Installationsausgabe liegt im privaten Runtime-Verzeichnis. Worker-Protokolle
|
||||
können Nutzertexte enthalten und gehören nicht ins Git oder Konfigurationsbackup.
|
||||
|
||||
## Speicher, Modelle und Profile
|
||||
|
||||
`DECK_STATE_DIR` enthält Code, Installation, Profile und temporäre Worker-Zugänge.
|
||||
`DECK_STRATA_DATA_DIR` ist ein beschreibbarer absoluter Pfad auf der Daten-SSD;
|
||||
ohne Variable: `DECK_STATE_DIR/strata-runtime/data`. In einer nativen systemd-Unit
|
||||
beide als `Environment=` setzen und die Verzeichnisse dem Dienstbenutzer geben.
|
||||
Die heutige Docker-Testinstallation übernimmt `strata_storage` aus ihrer
|
||||
`installation.json` als expliziten Bind-Mount samt Umgebungsvariable. Das ist nur
|
||||
der aktuelle Transport; der Worker selbst ruft Docker niemals auf.
|
||||
|
||||
Die Bibliothek (`DECK_STATE_DIR/models`) und der Strata-Datenbereich sollten auf
|
||||
derselben großen Datenpartition liegen, damit Hardlinks zusätzliche GGUF-Kopien
|
||||
vermeiden. Bei einer Zustandswurzel auf der Systempartition muss das native
|
||||
Provisioning das Modellverzeichnis ausdrücklich auf die Datenpartition legen
|
||||
(z. B. als dokumentierte Verzeichnisverknüpfung). Für beide Quants inklusive
|
||||
PLE und Paketen mindestens rund 200 GiB einplanen; getrennte Dateisysteme brauchen
|
||||
zusätzliche Kopien und vorübergehenden Downloadplatz.
|
||||
|
||||
Die Bibliothek enthält das Haupt-GGUF mit originaler, gepinnter HF-Quelle und
|
||||
SHA-256 aus `strata_sources.json`. „Expertenpaket vorbereiten“ prüft das GGUF,
|
||||
verknüpft/kopiert es in den Strata-Datenbereich, lädt die zweite PLE-Teildatei aus
|
||||
der festen Originalquelle und prüft deren Hash. Dann erzeugt das Original-Setup
|
||||
Expertenpaket und MTP. Es startet dabei keine Inferenz. Es benötigt vorübergehend
|
||||
bis etwa 120 GiB freie Daten-SSD; bestehende qualifizierte Pakete werden wiederverwendet.
|
||||
IQ2/IQ3 können die identische PLE-Datei als Hardlink teilen. Für die Vorbereitung
|
||||
müssen beide GPUs sichtbar sein. Erst Textbetrieb ist angebunden, kein Vision.
|
||||
|
||||
Profil: Laufzeit Strata, ein Slot, Kontext bis 262144, explizit zwei GPU-UUIDs,
|
||||
Layer-Schnitt 16, KV int8 mit 32768 Tokens GPU-resident, Experten resident oder
|
||||
mmap. Auf Athena zuerst 3060, danach 5080: 32 restliche Layer, Kopf und MTP liegen
|
||||
auf der 5080. Die erste Karte ist hier **nicht** die priorisierte Ausgabekarte.
|
||||
Reserve 768 MiB je Karte ist die qualifizierte Einstellung nahe am Speicherlimit.
|
||||
Ungeeignete llama.cpp-Felder sind im Profil ausgegraut. Tail-Skip ist 0; es werden
|
||||
keine Experten absichtlich ausgelassen. Laufzeitwechsel beendet nur Deck-eigene
|
||||
Worker; laufende Anfragen bleiben über den bestehenden Scheduler serialisiert.
|
||||
TTS kann bei dieser Vollbelegung entladen werden und wird durch Decks bestehende
|
||||
Audiopolitik erneut geladen, sobald Platz verfügbar ist.
|
||||
|
||||
## Backup und Restore
|
||||
|
||||
Das verschlüsselte Deck-Konfigurationsbackup enthält Strata-Laufzeitrevision,
|
||||
Profile, API-IDs/Freigaben und Originalquellen samt Modellhash. Es enthält keine
|
||||
öffentlichen Gewichte, gebauten Binaries, Expertenpakete oder temporären Keys.
|
||||
Restore baut zuerst die native Runtime, lädt Hauptgewichte über die Bibliothek
|
||||
und rekonstruiert danach PLE, Expertenpaket und MTP, bevor Profile angewendet
|
||||
werden. Dafür sind Internet, Platz, Compiler und passende GPUs erforderlich.
|
||||
Ein abweichender Strata-Commit wird beim Restore-Plan blockiert.
|
||||
|
||||
Der absolute Speicherpfad ist eine **Zielhost-Installationsentscheidung** und
|
||||
wird nicht aus einem fremden Backup ungeprüft übernommen. Zielverzeichnis vor
|
||||
Restore einrichten. Wer offline wiederherstellen will, muss zusätzlich die
|
||||
öffentlichen Gewichte und Pakete sichern und auf dem Ziel qualifizieren.
|
||||
|
||||
Die vollständige native Deck-Erstinstallation bleibt gemäß
|
||||
`NATIVE_INSTALL_REQUIREMENTS.md` eine getrennte offene Aufgabe. Das Strata-Rezept
|
||||
hat keine Docker-Voraussetzung; ein Test innerhalb des heutigen Deck-Containers
|
||||
ersetzt nicht die vollständige Abnahme auf einem frischen Debian-Host.
|
||||
+6
-2
@@ -22,7 +22,7 @@ FILES += ['soulx_singer.py','soulx_singer_runtime.py','soulx-singer-ui.js','depl
|
||||
FILES += sorted(str(p.relative_to(ROOT)) for folder in ('soulx-singer-web','soulx-singer-svc') for p in (ROOT/'deploy'/folder).rglob('*') if p.is_file() and '__pycache__' not in p.parts)
|
||||
FILES += ['xvc.py','xvc_runtime.py','xvc_sources.json','xvc-ui.js','deploy/xvc-requirements.lock','deploy/prepare_xvc.py']
|
||||
FILES += ['cuda_overlay.py','remix.py','remix_runtime.py','remix_worker.py','remix_sources.json','clearvoice_worker.py','deploy/ladypoly/patch_remix.py']
|
||||
FILES += ['speech_text.py']
|
||||
FILES += ['speech_text.py','strata_runtime.py','strata_worker.py','strata-ui.js','strata_sources.json','deploy/install_strata.py','deploy/strata_toolkit.py','deploy/strata-cuda13.lock.json','deploy/STRATA_NATIVE.md']
|
||||
FILES += sorted(str(p.relative_to(ROOT)) for p in (ROOT/'deploy/xvc-web').rglob('*') if p.is_file() and not {'__pycache__','.pytest_cache'} & set(p.parts))
|
||||
FILES += sorted(str(p.relative_to(ROOT)) for p in (ROOT/'deploy/applio-web').rglob('*') if p.is_file() and not {'__pycache__','.pytest_cache'} & set(p.parts))
|
||||
|
||||
@@ -147,6 +147,10 @@ def launch(config):
|
||||
'-p','127.0.0.1:'+str(config['port'])+':8108',
|
||||
'--health-cmd', 'python3 -c "import urllib.request,json; assert json.load(urllib.request.urlopen(\'http://127.0.0.1:8108/api/v1/auth/status\',timeout=3))[\'initialized\']"',
|
||||
'--health-interval','30s','--health-timeout','5s','--health-retries','3']
|
||||
if config.get('strata_storage'):
|
||||
path=Path(config['strata_storage'])
|
||||
if not path.is_absolute() or not path.is_dir() or ',' in str(path):raise RuntimeError('Ungültiger Strata-Datenpfad.')
|
||||
args+=['--mount',f'type=bind,src={path},dst={path}', '-e','DECK_STRATA_DATA_DIR='+str(path)]
|
||||
if config.get('memory_swap_limit'):args+=['--memory-swap',str(config['memory_swap_limit'])]
|
||||
for external in config.get('external_model_roots',[]):
|
||||
path=Path(external)
|
||||
@@ -260,7 +264,7 @@ def update(base, rollback=False, force=False, api_ports=None, reuse_runtime=Fals
|
||||
backup_name=config['name']+'-previous'
|
||||
if inspect(backup_name):raise RuntimeError('Rückfall-Containername belegt. Keine Änderung ausgeführt.')
|
||||
stamp=str(time.time_ns())
|
||||
shutil.copytree(base/'state',base/'backups'/stamp,ignore=shutil.ignore_patterns('soulx_singer-runtime','soulx_singer-data','seed_vc-runtime','seed_vc-data','seed_vc-prepare','reference-models','xvc-runtime','xvc-data','xvc-prepare','cache','omni-reference-check.py','omni-cache-clean.py','applio-runtime','applio-data','applio-checkout','applio-runtime.py','import_applio.py','applio-migration.log','acestep-runtime','acestep-jobs','acestep-setup-code','acestep-checkout','acestep-source-files','acestep-test-tmp','music-verification','music-test-temp','music-jobs','music-remix-runtime','separator-runtime','separator-tests','voxcpm-runtime','omnivoice-runtime','voice-worker-check','voice-integration-check','voice-setup-code','audio-cpp-runtime','ltx-original-runtime','original-work','tts-runtime','tts-tests','voice-tests','models','runtime','runtime-verification','image-tests','image-verification','image-verification-*','image-runtime','video-runtime','video-verification','video-verification-*','comfy-work','router-verification-*'))
|
||||
shutil.copytree(base/'state',base/'backups'/stamp,ignore=shutil.ignore_patterns('strata-runtime','strata-worker','strata-data','strata-install-src','soulx_singer-runtime','soulx_singer-data','seed_vc-runtime','seed_vc-data','seed_vc-prepare','reference-models','xvc-runtime','xvc-data','xvc-prepare','cache','omni-reference-check.py','omni-cache-clean.py','applio-runtime','applio-data','applio-checkout','applio-runtime.py','import_applio.py','applio-migration.log','acestep-runtime','acestep-jobs','acestep-setup-code','acestep-checkout','acestep-source-files','acestep-test-tmp','music-verification','music-test-temp','music-jobs','music-remix-runtime','separator-runtime','separator-tests','voxcpm-runtime','omnivoice-runtime','voice-worker-check','voice-integration-check','voice-setup-code','audio-cpp-runtime','ltx-original-runtime','original-work','tts-runtime','tts-tests','voice-tests','models','runtime','runtime-verification','image-tests','image-verification','image-verification-*','image-runtime','video-runtime','video-verification','video-verification-*','comfy-work','router-verification-*'))
|
||||
was_running=previous['State']['Running']
|
||||
if was_running:run('docker','stop','--time','15',config['name'])
|
||||
run('docker','rename',config['name'],backup_name)
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Native Strata build. No Docker, driver changes, root requirement or service restart."""
|
||||
import argparse,json,os,re,shutil,subprocess,sys
|
||||
from pathlib import Path
|
||||
ROOT=Path(__file__).resolve().parent.parent
|
||||
RECIPE=json.loads((ROOT/'strata_sources.json').read_text())
|
||||
def run(args,cwd=None,env=None):subprocess.run([str(x) for x in args],cwd=cwd,env=env,check=True)
|
||||
def install(destination,nvcc=None,architectures='86;120'):
|
||||
destination=Path(destination).resolve()
|
||||
nvcc=nvcc or os.environ.get('STRATA_NVCC') or shutil.which('nvcc')
|
||||
if not nvcc or not re.search(r'release 13\.0\b',subprocess.check_output([nvcc,'--version'],text=True)):
|
||||
from strata_toolkit import toolkit
|
||||
nvcc=str(toolkit(destination/'cuda'))
|
||||
version=subprocess.check_output([nvcc,'--version'],text=True)
|
||||
if not re.search(r'release 13\.0\b',version):raise ValueError('Strata-Rezept benötigt CUDA Toolkit 13.0; vorhandene andere Toolkits bleiben unverändert.')
|
||||
for tool in ('git','g++','make'):
|
||||
if not shutil.which(tool):raise ValueError('Native Build-Abhängigkeit fehlt: '+tool)
|
||||
if not re.fullmatch(r'\d+(;\d+)*',architectures):raise ValueError('Ungültige CUDA-Architekturen.')
|
||||
destination.mkdir(parents=True,exist_ok=True)
|
||||
source=destination/'source'
|
||||
if not source.exists():
|
||||
run(['git','init',source]);run(['git','-C',source,'fetch','--depth','1','https://github.com/Niko1221/Strata.git',RECIPE['code']]);run(['git','-C',source,'checkout','--detach','FETCH_HEAD'])
|
||||
if subprocess.check_output(['git','-C',source,'rev-parse','HEAD'],text=True).strip()!=RECIPE['code']:raise ValueError('Strata-Quellversion stimmt nicht mit Rezept überein.')
|
||||
python=source/'.venv/bin/python'
|
||||
if not python.is_file():run([sys.executable,'-m','venv',source/'.venv'])
|
||||
run([python,'-m','pip','install','--no-cache-dir','-r',source/'requirements.txt'])
|
||||
env=dict(os.environ,PATH=str(python.parent)+os.pathsep+str(Path(nvcc).parent)+os.pathsep+os.environ.get('PATH',''),CUDAToolkit_ROOT=str(Path(nvcc).parent.parent),LD_LIBRARY_PATH=str(Path(nvcc).parent.parent/'lib')+os.pathsep+str(Path(nvcc).parent.parent/'lib64')+os.pathsep+os.environ.get('LD_LIBRARY_PATH',''),STRATA_NVCC=str(nvcc),CMAKE_BUILD_PARALLEL_LEVEL='2')
|
||||
run([python,'-c','import setup;setup.get_llama_cpp()'],source,env)
|
||||
cmake=python.parent/'cmake'
|
||||
run([cmake,'-S',source,'-B',source/'build','-G','Ninja','-DCMAKE_BUILD_TYPE=Release','-DSTRATA_ENABLE_CUDA=ON','-DSTRATA_BUILD_TESTS=OFF','-DSTRATA_GGML_DIR='+str(source/'third_party/llama.cpp'),'-DCMAKE_CUDA_ARCHITECTURES='+architectures,'-DCMAKE_CUDA_COMPILER='+str(nvcc)],env=env)
|
||||
run([cmake,'--build',source/'build','--target','strata','-j','2'],env=env)
|
||||
(source/'engine').mkdir(exist_ok=True);shutil.copy2(source/'build/strata',source/'engine/strata')
|
||||
(source/'engine/BUILD.json').write_text(json.dumps(dict(source='local',version=RECIPE['version'],cuda_architectures=architectures,vision=False)))
|
||||
(destination/'ready.json').write_text(json.dumps(dict(commit=RECIPE['code'],cuda='13.0',architectures=architectures,origin='native-build')))
|
||||
if __name__=='__main__':
|
||||
p=argparse.ArgumentParser();p.add_argument('--destination',required=True);p.add_argument('--nvcc');p.add_argument('--architectures',default='86;120');a=p.parse_args();install(a.destination,a.nvcc,a.architectures)
|
||||
@@ -1,11 +1,13 @@
|
||||
"""Read-only host maintenance export using Deck's existing backup schema.
|
||||
No Server construction, worker startup, installation or state write.
|
||||
Run inside the installed Deck container, with passphrase on stdin.
|
||||
Run as the native Deck user (or in the current container), passphrase on stdin.
|
||||
"""
|
||||
import hashlib,json,sqlite3,sys,threading
|
||||
import hashlib,json,os,sqlite3,sys,threading
|
||||
from pathlib import Path
|
||||
from types import SimpleNamespace
|
||||
sys.path.insert(0,'/app')
|
||||
app=Path(os.environ.get('DECK_APP_DIR',str(Path(__file__).resolve().parent.parent)))
|
||||
if not (app/'backup.py').is_file() and Path('/app/backup.py').is_file():app=Path('/app')
|
||||
sys.path.insert(0,str(app))
|
||||
from backup import Backup,SETTINGS,validate
|
||||
from backup_codec import seal,open_backup
|
||||
from auth import CredentialStore
|
||||
@@ -33,6 +35,8 @@ def snapshot(root):
|
||||
state=json.loads((root/'runtime/state.json').read_text())
|
||||
s=SimpleNamespace(catalog=catalog,profiles=SimpleNamespace(lock=threading.RLock()),endpoint=SimpleNamespace(lock=threading.RLock()),runtime=SimpleNamespace(status=lambda:state),image_runtime=image,tts_runtime=reader(TTSRuntime,'tts-runtime'),docker=DockerSupport(),network=NetworkClient(),credentials=CredentialStore(root/'auth.json'))
|
||||
s.prompt_enhancer=PromptEnhancer(root/'prompt-enhancers',catalog,s.profiles,image)
|
||||
from strata_runtime import StrataRuntime
|
||||
s.strata_runtime=StrataRuntime(root/'strata-runtime',catalog)
|
||||
from audio_cpp_runtime import AudioCppRuntime
|
||||
from ltx_original_runtime import LTXOriginalRuntime
|
||||
from separator_runtime import SeparatorRuntime
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"cuda_cccl": {
|
||||
"relative_path": "cuda_cccl/linux-x86_64/cuda_cccl-linux-x86_64-13.0.50-archive.tar.xz",
|
||||
"sha256": "1aa6df471ee885f04aa3920d467395b5e5f665a53d206e74b10bb45abe92f3bc",
|
||||
"md5": "29ab64e3caaea423d140945d0c054032",
|
||||
"size": "987548"
|
||||
},
|
||||
"cuda_crt": {
|
||||
"relative_path": "cuda_crt/linux-x86_64/cuda_crt-linux-x86_64-13.0.48-archive.tar.xz",
|
||||
"sha256": "ac444278c0f9d72b4a1b26c3bd9c694f07e1dbdc1e309aac9fd668378692e3e4",
|
||||
"md5": "fd40064b3d8cc3b6f8d5257bdcaf4da1",
|
||||
"size": "79960"
|
||||
},
|
||||
"cuda_cudart": {
|
||||
"relative_path": "cuda_cudart/linux-x86_64/cuda_cudart-linux-x86_64-13.0.48-archive.tar.xz",
|
||||
"sha256": "30ffafae23833dafc965cf4e4d034f8553805586959328c64e2c47b3ef3bcd55",
|
||||
"md5": "f9cf6a9ffedec20950621abb71693d2f",
|
||||
"size": "1487372"
|
||||
},
|
||||
"cuda_culibos": {
|
||||
"relative_path": "cuda_culibos/linux-x86_64/cuda_culibos-linux-x86_64-13.0.39-archive.tar.xz",
|
||||
"sha256": "a31ee11b8bf482d12b35ab9b5e805521a7539b345a45f95aaa32cf02a12e1e27",
|
||||
"md5": "fbdedfa4429e77b8d189808ae9355e05",
|
||||
"size": "21428"
|
||||
},
|
||||
"cuda_nvcc": {
|
||||
"relative_path": "cuda_nvcc/linux-x86_64/cuda_nvcc-linux-x86_64-13.0.48-archive.tar.xz",
|
||||
"sha256": "cc5ff4a00d3be7c6c86ff740de7672e142ec87fea74e7e46b1b142b59fd2ac51",
|
||||
"md5": "dcbdda434b28b33a2f94a179f6ddca80",
|
||||
"size": "26732376"
|
||||
},
|
||||
"libcublas": {
|
||||
"relative_path": "libcublas/linux-x86_64/libcublas-linux-x86_64-13.0.0.19-archive.tar.xz",
|
||||
"sha256": "0abd3f4d4e8104e6cb8364ae0b264bc8b326db6af53e5c1aa0d288b55bc6f181",
|
||||
"md5": "85155a4ab8803e04e25267cce271e0a4",
|
||||
"size": "797380780"
|
||||
},
|
||||
"libnvvm": {
|
||||
"relative_path": "libnvvm/linux-x86_64/libnvvm-linux-x86_64-13.0.48-archive.tar.xz",
|
||||
"sha256": "8c5676a65a2e6d13e3c229f025af18677de46c220d77992fe932200fa798b19b",
|
||||
"md5": "4d05337e466fe5154f2a07079366191e",
|
||||
"size": "43941232"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
"""Install a private, hash-pinned CUDA 13 toolkit. Never installs a driver."""
|
||||
import hashlib,json,os,shutil,tarfile,urllib.request
|
||||
from pathlib import Path
|
||||
BASE='https://developer.download.nvidia.com/compute/cuda/redist/'
|
||||
def toolkit(root):
|
||||
root=Path(root);lock=json.loads((Path(__file__).parent/'strata-cuda13.lock.json').read_text());identity=hashlib.sha256(json.dumps(lock,sort_keys=True).encode()).hexdigest()
|
||||
nested=root/'nvvm/nvvm'
|
||||
if nested.is_dir():
|
||||
shutil.copytree(nested,root/'nvvm',dirs_exist_ok=True,symlinks=True);shutil.rmtree(nested)
|
||||
if (root/'lib').is_dir() and not (root/'lib64').exists():(root/'lib64').symlink_to('lib',target_is_directory=True)
|
||||
if (root/'ready').is_file() and (root/'ready').read_text()==identity:return root/'bin/nvcc'
|
||||
root.mkdir(parents=True,exist_ok=True)
|
||||
for name,item in lock.items():
|
||||
archive=root/(name+'.tar.xz');h=hashlib.sha256()
|
||||
with urllib.request.urlopen(BASE+item['relative_path'],timeout=60) as r,archive.open('wb') as f:
|
||||
while block:=r.read(4*1024**2):h.update(block);f.write(block)
|
||||
if h.hexdigest()!=item['sha256']:raise ValueError('CUDA-Komponente hat falsche Prüfsumme: '+name)
|
||||
temp=root/('extract-'+name);temp.mkdir(exist_ok=True)
|
||||
with tarfile.open(archive) as t:t.extractall(temp,filter='data')
|
||||
component=next(temp.iterdir())
|
||||
# NVIDIA redist archives already preserve toolkit-relative directories,
|
||||
target=root
|
||||
shutil.copytree(component,target,dirs_exist_ok=True,symlinks=True)
|
||||
shutil.rmtree(temp);archive.unlink()
|
||||
if (root/'lib').is_dir() and not (root/'lib64').exists():(root/'lib64').symlink_to('lib',target_is_directory=True)
|
||||
(root/'ready').write_text(identity)
|
||||
if not (root/'bin/nvcc').is_file():raise ValueError('CUDA nvcc fehlt nach Installation.')
|
||||
return root/'bin/nvcc'
|
||||
Reference in new issue
Block a user