|
本帖最后由 arthur200000 于 2015-5-30 22:47 编辑
众所周知,进行GPU运算时,必须使用一些CPU资源。在运行计算时,常常由于GPU计算程序的CPU资源获取不足,导致其运算效率低下,造成严重的分数损失。常见的处理方法有空出一个线程。
然而GPU运算的CPU使用率一般很低,特别是CUDA类程序。为了这么小的使用率就空出一个线程,显然有些浪费。于是又有了另一种方法——任务管理器手动调节优先级。
可是这种方法也有其显而易见的问题——麻烦。要是是低端卡跑大包这种东西也就算了,一天下来也用不上几次。可是20分钟虐一个包的高端卡玩家总不能这样吧?
于是,笔者发现了一个工具:Process Lasso。
Process Lasso原先被设计为一个CPU优先级优化工具,其目的是自动提高前台程序CPU优先级以获得更高的性能,同时降低占用率过高的进程优先级降低CPU占用率。这一点也就说明该程序有自动修改优先级的功能,虽然其降低优先级到低于标准的做法对于BOINC来说并不有利。【剧透:可以关掉】
顺便给要写脚本自己自动化的各位一点提示好了……
另外 wmic 的 where 其实挺强大的……cmd 写个 sleep + goto 死循环跑着就好了。- REM WINDOWS CMD
- :LOOP
- REM See the superuser link below.
- wmic process where "CommandLine like '%setiathome%cuda%'" CALL setpriority 'above normal'
- GOTO:LOOP
复制代码- # POSIX shell
- # setprio PID prio
- setprio ()
- {
- local nice_level = 0;
- [ -z "$2" ] && return 2; # 2: WRONG FORMAT
- echo "$1" | grep -qx '\d*' || return 2;
- if uname | grep _NT; then # It is Windows! http://superuser.com/questions/620724
- wmic process where ProcessID=$1 CALL setpriority "$2";
- else
- case "$2" in
- idle)
- nice_level=20;;
- 'below normal')
- nice_level=14;;
- normal)
- nice_level=10;;
- 'above normal')
- nice_level=6;;
- 'high priority')
- nice_level=2;;
- realtime)
- nice_level=-16;;
- *)
- echo Wrong nice_level format.;
- echo Acceptable Options:;
- echo "idle, 'below normal', normal, 'above normal', 'high priority', 'real time'";
- return 2
- ;;
- esac;
- renice "$nice_level" "$1";
- fi
- }
复制代码 |
评分
-
查看全部评分
|