mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-11 14:50:49 +08:00
Fix torch 2.4.0 fix
This commit is contained in:
parent
249b60e354
commit
4e851e2cfa
@ -59,19 +59,22 @@ def _fix_pytorch_240():
|
|||||||
if os.path.exists(dest):
|
if os.path.exists(dest):
|
||||||
break
|
break
|
||||||
|
|
||||||
with open(test_file, 'rb') as f:
|
|
||||||
contents = f.read()
|
|
||||||
# todo: dubious
|
|
||||||
if b"libomp140.x86_64.dll" not in contents:
|
|
||||||
break
|
|
||||||
try:
|
try:
|
||||||
_ = ctypes.cdll.LoadLibrary(test_file)
|
with open(test_file, 'rb') as f:
|
||||||
except FileNotFoundError:
|
contents = f.read()
|
||||||
logging.warning("Detected pytorch version with libomp issue, trying to patch")
|
# todo: dubious
|
||||||
|
if b"libomp140.x86_64.dll" not in contents:
|
||||||
|
break
|
||||||
try:
|
try:
|
||||||
shutil.copyfile(os.path.join(lib_folder, "libiomp5md.dll"), dest)
|
_ = ctypes.cdll.LoadLibrary(test_file)
|
||||||
except Exception as exc_info:
|
except FileNotFoundError:
|
||||||
logging.error("While trying to patch a fix for torch 2.4.0, an error occurred, which means this is unlikely to work", exc_info=exc_info)
|
logging.warning("Detected pytorch version with libomp issue, trying to patch")
|
||||||
|
try:
|
||||||
|
shutil.copyfile(os.path.join(lib_folder, "libiomp5md.dll"), dest)
|
||||||
|
except Exception as exc_info:
|
||||||
|
logging.error("While trying to patch a fix for torch 2.4.0, an error occurred, which means this is unlikely to work", exc_info=exc_info)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def _create_tracer():
|
def _create_tracer():
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user