Skip to content

Commit e0a7694

Browse files
committed
try to set cuda pcie order first thing
1 parent a8d33eb commit e0a7694

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

koboldcpp.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@
88
# editing tools, save formats, memory, world info, author's note, characters,
99
# scenarios and everything Kobold and KoboldAI Lite have to offer.
1010

11+
import os
12+
try:
13+
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" # try set GPU to PCI order first thing
14+
except Exception:
15+
pass
1116
import copy
1217
import ctypes
1318
import multiprocessing
14-
import os
1519
import math
1620
import re
1721
import argparse
@@ -574,7 +578,7 @@ def set_backend_props(inputs):
574578
inputs.kcpp_main_gpu = args.maingpu
575579

576580
if args.usecublas:
577-
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
581+
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
578582
if not args.tensor_split:
579583
if (args.usecublas and "0" in args.usecublas):
580584
os.environ["CUDA_VISIBLE_DEVICES"] = "0"

0 commit comments

Comments
 (0)