priority adjustment for linux fixed
This commit is contained in:
parent
966cd2ce91
commit
f43a63235b
1 changed files with 6 additions and 5 deletions
11
koboldcpp.py
11
koboldcpp.py
|
@ -515,15 +515,16 @@ def main(args):
|
||||||
import psutil
|
import psutil
|
||||||
os_used = sys.platform
|
os_used = sys.platform
|
||||||
process = psutil.Process(os.getpid()) # Set high priority for the python script for the CPU
|
process = psutil.Process(os.getpid()) # Set high priority for the python script for the CPU
|
||||||
|
oldprio = process.nice()
|
||||||
if os_used == "win32": # Windows (either 32-bit or 64-bit)
|
if os_used == "win32": # Windows (either 32-bit or 64-bit)
|
||||||
process.nice(psutil.REALTIME_PRIORITY_CLASS)
|
process.nice(psutil.REALTIME_PRIORITY_CLASS)
|
||||||
print("High Priority for Windows Set")
|
print("High Priority for Windows Set: " + str(oldprio) + " to " + str(process.nice()))
|
||||||
elif os_used == "linux": # linux
|
elif os_used == "linux": # linux
|
||||||
process.nice(psutil.IOPRIO_HIGH)
|
process.nice(psutil.IOPRIO_CLASS_RT, value=0)
|
||||||
print("High Priority for Linux Set")
|
print("High Priority for Linux Set: " + str(oldprio) + " to " + str(process.nice()))
|
||||||
else: # MAC OS X or other
|
else: # MAC OS X or other
|
||||||
process.nice(20)
|
process.nice(-18)
|
||||||
print("High Priority for Other OS Set (nice=20)")
|
print("High Priority for Other OS Set :" + str(oldprio) + " to " + str(process.nice()))
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
print("Error, Could not change process priority: " + str(ex))
|
print("Error, Could not change process priority: " + str(ex))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue