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
bbswitch cannot find acpi handle for MSI GT60 20C laptop's GTX 770M #72
Comments
Here is my little acpi_call script: #!/bin/sh
if ! lsmod | grep -q acpi_call; then
insmod /usr/local/myscripts/acpi_call.ko
fi
acpi_call () {
echo "$*" > /proc/acpi/call
cat /proc/acpi/call
}
case "$1" in
off)
echo $(acpi_call "\_SB.PCI0.PEG0.PEGP._OFF")
echo "Turned off"
;;
on)
echo $(acpi_call "\_SB.PCI0.PEG0.PEGP._ON")
echo "Turned on"
;;
*)
echo "Usage: $0 [on|off]"
esac |
Can you try kernel 3.12? There have been bugs like these in the past, such as #2 and #65. You can also try extending the acpi-handle-hack from the hack-lenovo branch for time time being. The handle for 01:00.0 should be Can you also post your full dmesg somewhere? On https://gist.github.com or something, not here. |
Thank you for your reply. Here is my dmesg I modified my script to use the calls from the document you posted. These ones work after changing the acpi handle to match my _SB.PCI0.PEG0.PEGP turning the nvidia card off
turning the nvidia card on
As of now I am unable to try another kernel. I need this specific one for my AI class I am currently in. As far as the acpi-handle-hack is concerned, I modified the need_acpi_handle_hack function to simply return true; but all I get is: If this issue will be completely resolved by using a a newer kernel, then I can wait until this semester is over and then update. The only reason I am attached to this kernel is for my AI class. |
Your specific laptop could use this hack (all safeguards are removed, do not use it on other laptops, it could crash your kernel): diff --git a/acpi-handle-hack.c b/acpi-handle-hack.c
index af5f3cf..ed0a198 100644
--- a/acpi-handle-hack.c
+++ b/acpi-handle-hack.c
@@ -38,6 +38,7 @@ static bool __init need_acpi_handle_hack(void) {
|| (dmi_match(DMI_SYS_VENDOR, "LENOVO") && dmi_match(DMI_PRODUCT_NAME, "PIQY0")) /* Lenovo IdeaPad Y570 */
|| dmi_match(DMI_PRODUCT_NAME, "Aspire V5-573G")
|| dmi_match(DMI_PRODUCT_NAME, "Aspire V5-573PG")
+ || 1
;
}
@@ -70,8 +71,7 @@ static void dev_set_acpi_handle(struct pci_dev *pdev, acpi_handle handle) {
}
static int __init hack_apply(void) {
- acpi_handle tmp_handle, new_handle;
- struct acpi_buffer buf = { ACPI_ALLOCATE_BUFFER, NULL };
+ acpi_handle new_handle;
if (!need_acpi_handle_hack()) {
pr_err("Machine does not need ACPI handle hack\n");
return -ENODEV;
@@ -82,37 +82,14 @@ static int __init hack_apply(void) {
return -ENODEV;
}
orig_handle = DEVICE_ACPI_HANDLE(&dis_dev->dev);
- if (!orig_handle) {
- pr_err("No ACPI handle found for discrete video card\n");
- goto free_dev;
- }
- if (ACPI_FAILURE(acpi_get_name(orig_handle, ACPI_SINGLE_NAME, &buf))) {
- pr_err("Could not acquire name for discrete video card\n");
- goto free_dev;
- }
- if (strcmp((char *)buf.pointer, "PEGP") == 0) {
- pr_err("Handle has already been changed to PEGP\n");
- goto free_name;
- }
- /* \_SB.PCI0.PEG0.VGA_ -> \_SB.PCI0.PEG0.PEGP */
- if (ACPI_FAILURE(acpi_get_parent(orig_handle, &tmp_handle))) {
- pr_err("No parent device found for %s\n", (char *)buf.pointer);
- goto free_name;
- }
- if (ACPI_FAILURE(acpi_get_handle(tmp_handle, "PEGP", &new_handle))) {
- pr_err("No PEGP handle found on %s\n", (char *)buf.pointer);
- goto free_name;
+ if (ACPI_FAILURE(acpi_get_handle(NULL, "\\_SB.PCI0.PEG0.PEGP", &new_handle))) {
+ pr_err("No PEGP handle found\n");
+ return -ENODEV;
}
pr_info("Setting new ACPI handle for discrete video card\n");
dev_set_acpi_handle(dis_dev, new_handle);
- kfree(buf.pointer);
pci_dev_put(dis_dev);
return 0;
-free_name:
- kfree(buf.pointer);
-free_dev:
- pci_dev_put(dis_dev);
- return -ENODEV;
}
static void __exit hack_undo(void) { You can install a new kernel next to your current kernel, so why wait for so long? The packages you need are linux-headers-..._amd64.deb, linux-headers-..._all.deb, linux-image-....amd64.deb. Get them from http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.11.6-saucy/. If that does not work, try http://kernel.ubuntu.com/~kernel-ppa/mainline/daily/current/. If you still have issues, it is a new bug. |
I forget that it is easy to manage kernels in linux. I got the new kernel and all appears to be well with bbswitch. It finds the handle and I can switch the gfx on and off. I guess the 3.8 kernel doesn't like my laptop. Thanks for all your help. I will permanently upgrade my kernel after this semester is over. And yes, the hack you posted works too. Thanks again!! |
I have done everything I can think possible and have spent many hours trying to troubleshoot this issue, to no avail. I have whittled the issue down to what I believe to be the problem, but I am not sure where to go from here. Please assist!
I assume the problem to be thus:
As you can see, my system does not report an acpi handle for my GPU.
I have done all the requested bug reporting stuff here:
https://bugs.launchpad.net/lpbugreporter/+bug/752542/comments/649
(Explained in the bug report) I can manually switch the GPU using the handles
\_SB.PCI0.PEG0.PEGP._OFF
and\_SB.PCI0.PEG0.PEGP._ON
using acpi_call.I wanted to try inserting these somewhere into the bbswitch code, but I don't know enough about how all this acpi stuff works to understand the code well enough.
Any assistance would be much appreciated.
EDIT: One interesting note is that using my manual method appears to be different than what happens when my system sleeps and wakes. Disabling the GPU manually using acpi_call, then sleep/wake cycling turns the GPU on, but I cannot use optirun/primusrun until I use acpi_call to turn it on, even though it IS on.
The text was updated successfully, but these errors were encountered: