mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-12-16 17:42:58 +08:00
feat: ComfyUI can be run on the specified Ascend NPU (#9663)
* feature: Set the Ascend NPU to use a single one * Enable the `--cuda-device` parameter to support both CUDA and Ascend NPUs simultaneously. * Make the code just set the ASCENT_RT_VISIBLE_DEVICES environment variable without any other edits to master branch --------- Co-authored-by: Jedrzej Kosinski <kosinkadink1@gmail.com>
This commit is contained in:
parent
2dadb34860
commit
1364548c72
1
main.py
1
main.py
@ -127,6 +127,7 @@ if __name__ == "__main__":
|
|||||||
if args.cuda_device is not None:
|
if args.cuda_device is not None:
|
||||||
os.environ['CUDA_VISIBLE_DEVICES'] = str(args.cuda_device)
|
os.environ['CUDA_VISIBLE_DEVICES'] = str(args.cuda_device)
|
||||||
os.environ['HIP_VISIBLE_DEVICES'] = str(args.cuda_device)
|
os.environ['HIP_VISIBLE_DEVICES'] = str(args.cuda_device)
|
||||||
|
os.environ["ASCEND_RT_VISIBLE_DEVICES"] = str(args.cuda_device)
|
||||||
logging.info("Set cuda device to: {}".format(args.cuda_device))
|
logging.info("Set cuda device to: {}".format(args.cuda_device))
|
||||||
|
|
||||||
if args.oneapi_device_selector is not None:
|
if args.oneapi_device_selector is not None:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user