zluda support cudaMallocAsync

This commit is contained in:
Seunghoon Lee
2024-05-17 13:43:55 +09:00
parent 94e6ae721e
commit 6043f5a714
2 changed files with 14 additions and 7 deletions
+5 -2
View File
@@ -498,13 +498,15 @@ def check_torch():
error = None
from modules import zluda_installer
try:
if args.reinstall_zluda:
zluda_installer.uninstall()
if args.use_zluda_dnn:
if zluda_installer.check_dnn_dependency():
zluda_installer.enable_dnn()
else:
log.warning("Couldn't find the required dependency of ZLUDA DNN.")
zluda_installer.install()
zluda_path = zluda_installer.find()
zluda_path = zluda_installer.get_path()
zluda_installer.install(zluda_path)
zluda_installer.make_copy(zluda_path)
except Exception as e:
error = e
@@ -1062,6 +1064,7 @@ def add_args(parser):
group.add_argument('--skip-env', default = os.environ.get("SD_SKIPENV",False), action='store_true', help = "Skips setting of env variables during startup, default: %(default)s")
group.add_argument('--experimental', default = os.environ.get("SD_EXPERIMENTAL",False), action='store_true', help = "Allow unsupported versions of libraries, default: %(default)s")
group.add_argument('--reinstall', default = os.environ.get("SD_REINSTALL",False), action='store_true', help = "Force reinstallation of all requirements, default: %(default)s")
group.add_argument('--reinstall-zluda', default = os.environ.get("SD_REINSTALL_ZLUDA",False), action='store_true', help = "Force reinstallation of ZLUDA, default: %(default)s")
group.add_argument('--test', default = os.environ.get("SD_TEST",False), action='store_true', help = "Run test only and exit")
group.add_argument('--version', default = False, action='store_true', help = "Print version information")
group.add_argument('--ignore', default = os.environ.get("SD_IGNORE",False), action='store_true', help = "Ignore any errors and attempt to continue")
+9 -5
View File
@@ -11,13 +11,14 @@ RELEASE = f"rel.{os.environ.get('ZLUDA_HASH', '11cc5844514f93161e0e74387f04e2c53
DLL_MAPPING = {
'cublas.dll': 'cublas64_11.dll',
'cusparse.dll': 'cusparse64_11.dll',
'cudart.dll': 'cudart64_110.dll',
'nvrtc.dll': 'nvrtc64_112_0.dll',
}
HIP_TARGETS = ['rocblas.dll', 'rocsolver.dll', 'hiprtc0507.dll',]
HIP_TARGETS = ['amdhip64.dll', 'rocblas.dll', 'rocsolver.dll', 'hiprtc0507.dll',]
ZLUDA_TARGETS = ('nvcuda.dll', 'nvml.dll',)
def find() -> str:
def get_path() -> str:
return os.path.abspath(os.environ.get('ZLUDA', '.zluda'))
@@ -45,9 +46,7 @@ def enable_dnn() -> None:
HIP_TARGETS.append('MIOpen.dll')
def install() -> None:
zluda_path = find()
def install(zluda_path: os.PathLike) -> None:
if os.path.exists(zluda_path):
return
@@ -64,6 +63,11 @@ def install() -> None:
os.remove('_zluda')
def uninstall() -> None:
if os.path.exists('.zluda'):
shutil.rmtree('.zluda')
def make_copy(zluda_path: os.PathLike) -> None:
for k, v in DLL_MAPPING.items():
if not os.path.exists(os.path.join(zluda_path, v)):