New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable dGPU in integrated mode if it doesn't support runtimepm #326
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
21.10
I have tested this on the oryp4
:
apt policy system76-power
system76-power:
Installed: 1.1.20~1648670246~21.10~77def87
Candidate: 1.1.20~1648670246~21.10~77def87
Version table:
*** 1.1.20~1648670246~21.10~77def87 1002
1002 http://apt.pop-os.org/staging/missing-runpm impish/main amd64 Packages
100 /var/lib/dpkg/status
1.1.20~1648241921~21.10~1e1599a 1001
1001 http://apt.pop-os.org/release impish/main amd64 Packages
with the 510
and 470
drivers in both in integrated and hybrid modes and the GPU fan is always running at around 4300rpm.
Refering back to the orginal issue #325 the output of /sys/bus/pci/devices/0000:01:00.0/power/control
in in integrated mode is now on
and auto
in hybrid mode.
Since I was also using this #329 to test the 470
issue earlier I also tried it here, but the problem was the same.
Right...I query the loaded drivers to get version, because NVIDIA puts the version in the folder name at So I need to fix the runtimepm check to not depend on the driver being loaded. |
src/graphics.rs
Outdated
let docs: Vec<path::PathBuf> = fs::read_dir("/usr/share/doc") | ||
.map_err(|e| { | ||
GraphicsDeviceError::Json(io::Error::new(io::ErrorKind::InvalidData, e.to_string())) | ||
})? | ||
.filter_map(Result::ok) | ||
.map(|f| f.path()) | ||
.filter(|f| f.starts_with("nvidia-driver-")) | ||
.collect(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Surely there's a better way to get the major version to find this folder?
On 21.10 oryp4 this seem to be working now with the 510 drivers in Integrated mode, but the GPU fan still runs nonstop with the 470 drivers in Integrated mode.
510.54 510.60.02 470.86 470.103.01 |
What's the journal say?
|
That just gives me |
Sorry, |
No worries. Here you go.
|
I have a question: since the integrated mode blacklists the Nvidia drivers and modules causing the device to be driverless, how will devices that support |
Removing the device from the bus was the previous default. But if a device supports RTD3 then it shouldn't be required. The kernel will suspend the device when it's not used. |
So the drivers don't need to be loaded in order for the kernel to suspend the device? |
I mean, isn't power management the driver's responsibility? And in this case, it is blacklisted. |
@crawfxrd In testing
|
If a device does not support runtime power management, then remove it from the bus when in integrated mode. Fixes: 1e1599a ("daemon: Always enable GPU power") Signed-off-by: Tim Crawford <tcrawford@system76.com>
Store the device ID at PCI enumeration so it does not need to be fetched from sysfs again later. Search /usr/share/doc for the NVIDIA driver folder instead of getting the version of the loaded driver. Allows getting the dGPU features when the driver is unloaded and the PCI device has been removed from the bus. Signed-off-by: Tim Crawford <tcrawford@system76.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes the fan issues in Integrated mode.
CLI
Tasks which test the behavior of the CLI client.
- Power profiles can be queried and set
- Laptop with switchable graphics:
- Switchable graphics can be queried
- Command returns
daemon returned an error message: "The name com.system76.PowerDaemon was not provided by any .service files
on a non-switchable system - Command returns
switchable
on a laptop with switchable graphics
- Command returns
- Switching from Integrated to NVIDIA
- Switching from Integrated to Hybrid
- Switching from Integrated to Compute
- Switching from NVIDIA to Integrated
- Switching from NVIDIA to Hybrid
- Switching from NVIDIA to Compute
- Switching from Hybrid to Integrated
- Switching from Hybrid to NVIDIA
- Switching from Hybrid to Compute
- Switching from Compute to Integrated
- Switching from Compute to NVIDIA
- Switching from Compute to Hybrid
- Discrete graphics power state can be queried and set
- Switchable graphics can be queried
GNOME Shell
Tasks which test the behavior of the shell extension.
- Test that the power profile can be switched, and that the dots are correct
- Test that any power profile change from the CLI is reflected in the extension
- When switching to balanced, with screen brightness maxed, screen brightness drops to 50%
- When switching to battery, with screen brightness maxed, screen brightness drops to 10%
- When switching to balanced, with screen brightness minimized, screen brightness does not change
- When restarting the daemon, and the daemon defaults to a balanced profile, the brightness should not change
- When restarting the system, screen brightness should be the same as before
- Laptop with switchable graphics:
- Switching from Integrated to NVIDIA
- Switching from Integrated to Hybrid
- Switching from Integrated to Compute
- Switching from NVIDIA to Integrated
- Switching from NVIDIA to Hybrid
- Switching from NVIDIA to Compute
- Switching from Hybrid to Integrated
- Switching from Hybrid to NVIDIA
- Switching from Hybrid to Compute
- Switching from Compute to Integrated
- Switching from Compute to NVIDIA
- Switching from Compute to Hybrid
- Test that switchable graphics changes from the CLI are reflected in the extension
@n3m0-22 did it actually work? I didn't change anything, just rebased. Do you have the workaround still applied? |
Yes I completely removed the service and script I created then applied this. It had worked before on 21.10. This weekend was the first time I had a chance to fully test 22.04 on the |
If this works then #336 isn't needed. |
Either way I tested both, and both solve the fan issue on the |
The graphs I posted on the other PR match the GPU fan performance change as with this PR. |
If a device does not support runtime power management, then remove it from the bus when in integrated mode.
Fixes: 1e1599a ("daemon: Always enable GPU power")
Resolves: #325