Skip to content

Commit 1364548

Browse files
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 <[email protected]>
1 parent 2dadb34 commit 1364548

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ def execute_script(script_path):
127127
if args.cuda_device is not None:
128128
os.environ['CUDA_VISIBLE_DEVICES'] = str(args.cuda_device)
129129
os.environ['HIP_VISIBLE_DEVICES'] = str(args.cuda_device)
130+
os.environ["ASCEND_RT_VISIBLE_DEVICES"] = str(args.cuda_device)
130131
logging.info("Set cuda device to: {}".format(args.cuda_device))
131132

132133
if args.oneapi_device_selector is not None:

0 commit comments

Comments
 (0)