zluda v3.7

This commit is contained in:
Seunghoon Lee
2024-04-10 16:16:00 +09:00
parent 25ff623f50
commit 8f601f852c
+5 -10
View File
@@ -501,16 +501,11 @@ def check_torch():
zluda_path = find_zluda()
if zluda_path is None:
import urllib.request
if is_windows:
import zipfile
archive_type = zipfile.ZipFile
zluda_url = 'https://github.com/lshqqytiger/ZLUDA/releases/download/v3.5-win/ZLUDA-windows-amd64.zip'
else:
import tarfile
archive_type = tarfile.TarFile
zluda_url = 'https://github.com/vosen/ZLUDA/releases/download/v3/zluda-3-linux.tar.gz'
import zipfile
import tarfile
archive_type = zipfile.ZipFile if is_windows else tarfile.TarFile
try:
urllib.request.urlretrieve(zluda_url, '_zluda')
urllib.request.urlretrieve(f'https://github.com/lshqqytiger/ZLUDA/releases/download/rel.9e97c717c3fef536d3116f39a15d95626c1dfe39/ZLUDA-{platform.system().lower()}-amd64.{"zip" if is_windows else "tar.gz"}', '_zluda')
with archive_type('_zluda', 'r') as f:
f.extractall('.zluda')
zluda_path = os.path.abspath('./.zluda')
@@ -519,7 +514,7 @@ def check_torch():
log.warning(f'Failed to install ZLUDA: {e}')
if os.path.exists(os.path.join(zluda_path, 'nvcuda.dll')):
log.info(f'Using ZLUDA in {zluda_path}')
torch_command = os.environ.get('TORCH_COMMAND', 'torch==2.2.1 torchvision --index-url https://download.pytorch.org/whl/cu118')
torch_command = os.environ.get('TORCH_COMMAND', 'torch==2.2.2 torchvision --index-url https://download.pytorch.org/whl/cu118')
paths = os.environ.get('PATH', '.')
if zluda_path not in paths:
os.environ['PATH'] = paths + ';' + zluda_path