mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-11 14:50:49 +08:00
add files via upload
uploaded nvcuda.zluda_get_nightly_flag.py to get nightly flag info inside batch
This commit is contained in:
parent
25945ff604
commit
5dcd8d2428
36
comfy/customzluda/nvcuda.zluda_get_nightly_flag.py
Normal file
36
comfy/customzluda/nvcuda.zluda_get_nightly_flag.py
Normal file
@ -0,0 +1,36 @@
|
||||
import ctypes
|
||||
import os
|
||||
import sys
|
||||
|
||||
def main():
|
||||
dll_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', 'zluda', 'nvcuda.dll'))
|
||||
|
||||
if not os.path.isfile(dll_path):
|
||||
print(f"ERROR: DLL not found: {dll_path}")
|
||||
sys.exit(1)
|
||||
|
||||
try:
|
||||
zluda_dll = ctypes.CDLL(dll_path)
|
||||
except Exception as e:
|
||||
print(f"ERROR: Could not load DLL: {e}")
|
||||
sys.exit(1)
|
||||
|
||||
try:
|
||||
zluda_get_nightly_flag = zluda_dll.zluda_get_nightly_flag
|
||||
zluda_get_nightly_flag.restype = ctypes.c_int
|
||||
|
||||
flag = zluda_get_nightly_flag()
|
||||
|
||||
if flag == 1:
|
||||
print("[nightly build]")
|
||||
elif flag == 0:
|
||||
print("[release build]")
|
||||
else:
|
||||
print(f"Unexpected flag value: {flag}")
|
||||
|
||||
except Exception as e:
|
||||
print(f"ERROR: Could not call zluda_get_nightly_flag: {e}")
|
||||
sys.exit(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Loading…
Reference in New Issue
Block a user