Home
Categories
WIKI
Topic
User
LANGUAGE:
中文
English
发挥NVIDIA PRIME的全部功力:真·自动切换(二)
Experiences and Insight
2567
views ·
3
replies ·
To
floor
Go
risez
deepin
2020-10-03 03:49
Author
本帖最后由 risez 于 2020-10-2 22:35 编辑
启用并配置功能
这个功能默认并未启用。手动启用:
echo auto > /sys/bus/pci/devices/0000\:01\:00.0/power/control #启用function 0的电源管理
Copy the Code
以此类推,如果你想启用function 1的:
echo auto > /sys/bus/pci/devices/0000\:01\:00.1/power/control
Copy the Code
若需要关闭自动切换功能,只需要把上述命令的auto改为on即可。
驱动设置
首先,在/etc/modprobe.d/里新建一个名为nvidia.conf的文件,打开该文件,添加如下内容:
options nvidia "NVreg_DynamicPowerManagement=0x02"
Copy the Code
注意那个双引号里的内容,用最简单的方式去理解会是这样(要专业的自己去看官方文档):
NVreg_DynamicPowerManagement=0x00:仅使用nvidia GPU的内置电源管理,假自动切换就是用的这种方式;
NVreg_DynamicPowerManagement=0x01:开启简单的自动切换管理功能;
NVreg_DynamicPowerManagement=0x02:开启精细的自动切换管理功能。
还看不懂?你直接这样理解:
0x00:低级功能;
0x01:中级功能;
0x02:高级功能。
可选参数:
NVreg_DynamicPowerManagementVideoMemoryThreshold=100:默认是200,注意这个参数的值最大就是200,超过200会被忽略掉,设置成0会导致GPU一直不会被关闭(这和0x00有什么区别)
这个功能可以这么理解,假设我设置成200,驱动会根据使用情况判断是否需要调用独显的内存(Video memory):
若应用程序需要独显存储的内容不超过200M,则不使用独显,而是让你的系统内存存储本该是独显存储的内容;
若超过200,则开启独显,让独显存储相应的内容。
对于内存较少者,可以考虑把这个值改低,减小系统内存压力,如果你的内存较大,就不必设置了。
判断独显是否启用了自动切换管理功能,以及独显状态,独显对于自动切换管理功能的支持情况
输入如下命令:
cat /proc/driver/nvidia/gpus/0000:01:00.0/power
Copy the Code
注意那个01:00.0,是不是很熟悉啊?上面让你记下这个值,就是为了配置自动切换功能做的。现在,你只需根据你获得的值,把上面命令的值替换掉就行了。如果你不放心,可以这样做,首先输入命令:
cat /proc/driver/nvidia/gpus/
Copy the Code
此时不要回车,按两下tab键,shell将会显示该目录下的内容,自己根据显示的内容以及记下的值判断哪个才是自己需要找的文件。
输好命令后回车,这是我的输出:
Runtime D3 status: Enabled (fine-grained) #自动切换功能已启用,而且是“高级功能”
Video Memory: Off #独显已经彻底关闭掉了
GPU Hardware Support:
Video Memory Self Refresh: Supported #这两个都必须是supported才意味着你的独显支持真自动切换功能,一般你的独显符合要求肯
Video Memory Off: Supported #定都是支持的,比Turing架构旧的独显只支持Video Memory Self Refresh,两个都不支
#持?对不起,PRIME可能对你的独显无缘了
Copy the Code
注意那个Runtime D3 status后面括号里的内容,如果是(fine-grained),说明你使用了“高级功能”(0x02),如果是(coarse-grained),说明你使用了“中级功能”(0x01),如果没有括号的内容且显示的是不是Enabled而是off,那么你用的就是“低级功能”(0x00)了。
本文所有部分链接:
一:https://bbs.deepin.org/post/203224#=1##pid786085
二:https://bbs.deepin.org/post/203225#=1##pid786087
三:https://bbs.deepin.org/post/203226#=1##pid786088
四:https://bbs.deepin.org/post/203227#=1##pid786089
五:https://bbs.deepin.org/post/203228#=1##pid786090
Reply
Like 0
Favorite
View the author
All Replies
辉夜
deepin
2020-10-03 05:28
#1
厉害厉害
Reply
Like 0
View the author
thefivestar
deepin
2020-10-13 20:43
#2
╰─○ cat /proc/driver/nvidia/gpus/0000:01:00.0/power
Runtime D3 status: Not supported
Video Memory: Active
GPU Hardware Support:
Video Memory Self Refresh: Supported
Video Memory Off: Supported
兄弟,这是什么情况?
配置是AMD4800H+1660TI
Reply
Like 0
View the author
Comments
zty199
2020-10-13 22:13
大佬在教程1里面说了要8代以上Intel CPU支持的
sgb76
deepin
2020-10-13 23:42
#3
虽然不是N卡,但也占个楼备用
Reply
Like 0
View the author
Please
sign
in first
Featured Collection
Change
[Tutorial] deepin25 WSL Offline Installation Guide
UOS AI 2.8 Released! Three New Intelligent Agents & Major Evolution
Solid Q&A | deepin 25 Common Questions – The Immutable System Edition
New Thread
Popular Ranking
Change
The settings menu needs to be translated into Russian.
the Network section no longer appears
Error during system installation
Deepin IDE?
Deepin Native Apps not launching in the latest version
Music player with sample rate and bit depth
Popular Events
More
启用并配置功能
驱动设置
判断独显是否启用了自动切换管理功能,以及独显状态,独显对于自动切换管理功能的支持情况
本文所有部分链接:
一:https://bbs.deepin.org/post/203224#=1##pid786085
二:https://bbs.deepin.org/post/203225#=1##pid786087
三:https://bbs.deepin.org/post/203226#=1##pid786088
四:https://bbs.deepin.org/post/203227#=1##pid786089
五:https://bbs.deepin.org/post/203228#=1##pid786090