Since optimus is not supported, I assume battery life will suffer running linux. The intel video will be running, but will the nvidia card be powered off? I should also note, machine is an xps15 with no switching in bios.
-
User Retired 2 Notebook Nobel Laureate NBR Reviewer
The NVidia gpu will switch off when unused, which in your Linux setup will be 100% of the time. Your notebook will use the same amount of battery as if it had integrated graphics only. -
ALLurGroceries Vegan Vermin Super Moderator
If you can't switch it to integrated only in the BIOS your nvidia card will be powered on in linux by default if it uses optimus, until you use the acpi_call module to power it down. You can find lots of examples if you search for "nvidia optimus acpi_call".
-
User Retired 2 Notebook Nobel Laureate NBR Reviewer
You can disconnect the x16 pcie port that the NVidia GPU is attached to in grub2 prior to booting Linux. That is equivalent to running with integrated only. Use
Confirm by noting the NVidia gpu is no longer in the 'lspci -tv' output.Code:setpci -s 0:0.0 54.b=0:2
-
My non optimus nvidia didnt have a choice for IGP only and always reverted to the nvidia card over the intel. I would think the same would happen with optimus cards until you run the script to disable the card. Not sure, just a hunch.
-
I did try, before writing to script, but it didn't take.
Code:git clone http://github.com/mkottman/acpi_call.git cd acpi_call make sudo insmod acpi_call.ko ./test_off.sh
-
ALLurGroceries Vegan Vermin Super Moderator
@Gunjunkie are you getting any specific error messages when you compile the module and run insmod, or in /var/log/syslog?
I walked someone through building this recently for an alienware m11xr2, there might be some clues there. It needed a patch to acpi_call in order to work. I don't have any optimus hardware to test myself. That thread is here: http://forum.notebookreview.com/linux-compatibility-software/553945-help-new-linux-user-out-m11x-r2.html -
Hmm, the m11xr2 has the option in bios for switching. Wonder if it matters that mine does not.
I was doing the commands in my previous post and the output was similar to this (not mine)
and the one line should be,Code:# ./test_off.sh Trying \_SB.PCI0.P0P1.VGA._OFF: failed Trying \_SB.PCI0.P0P2.VGA._OFF: failed Trying \_SB_.PCI0.OVGA.ATPX: failed Trying \_SB_.PCI0.OVGA.XTPX: failed Trying \_SB.PCI0.P0P3.PEGP._OFF: failed Trying \_SB.PCI0.P0P2.PEGP._OFF: failed Trying \_SB.PCI0.P0P1.PEGP._OFF: failed Trying \_SB.PCI0.MXR0.MXM0._OFF: failed Trying \_SB.PCI0.PEG1.GFX0._OFF: failed Trying \_SB.PCI0.PEG1.GFX0.DOFF: failed Trying \_SB.PCI0.XVR0.Z01I.DGOF: failed Trying \_SB.PCI0.PEGR.GFX0._OFF: failed Trying \_SB.PCI0.PEG.VID._OFF: failed Trying \_SB.PCI0.P0P2.DGPU._OFF: failed Trying \_SB.PCI0.P0P4.DGPU.DOFF: failed Trying \_SB.PCI0.IXVE.IGPU.DGOF: failed Trying \_SB.PCI0.RP00.VGA._PS3: failed Trying \_SB.PCI0.RP00.VGA.P3MO: failed Trying \_SB.PCI0.GFX0.DSM._T_0: failed Trying \_SB.PCI0.LPC.EC.PUBS._OFF: failed Trying \_SB.PCI0.P0P2.NVID._OFF: failed
if working.Code:Trying \_SB.PCI0.PEG1.GFX0._OFF: works!
Also, don't know if it matters, but I'm using kernel
2.6.35-27-generic #48+kamal~mjgbacklight1-Ubuntu -
So I did this and pasted
into /etc/rc.local, but it didn't take at restart? I did kinda struggle through, so I'm sure I missed something.Code:sudo /sbin/rmmod /usr/local/lib/m11xr2hack.ko sudo /sbin/insmod /usr/local/lib/m11xr2hack.ko
-
ALLurGroceries Vegan Vermin Super Moderator
What distro are you on?
-
ubuntu 10.10 64 bit
-
ALLurGroceries Vegan Vermin Super Moderator
Do those commands work if you run them on their own?
Does the module show up in lsmod | grep m11xr2hack
Is your /etc/rc.local executable? chmod a+x /etc/rc.local
I'm not even sure the status of rc.local in recent ubuntu since it's been switched to upstart from sysvinit. I think it still gets executed but I'm not sure when. -
I get "no such directory".
module showsAm I supposed to remove the acpi_call folder?Code:~$ lsmod | grep m11xr2hack m11xr2hack 1737 0
It was working before the reboot. Was showing 3:40 battery life before and 5:25 after. -
ALLurGroceries Vegan Vermin Super Moderator
You get no such directory on which one?
-
Code:
mt@mt-XPS-L501X:~$ sudo /sbin/rmmod /usr/local/lib/m11xr2hack.ko ERROR: Module m11xr2hack does not exist in /proc/modules mt@mt-XPS-L501X:~$ sudo /sbin/insmod /usr/local/lib/m11xr2hack.ko mt@mt-XPS-L501X:~$
-
ALLurGroceries Vegan Vermin Super Moderator
OK maybe it's because the first one has a bad exit status so it could be killing the rest of your init script. I think if the exit status results in failure the rest of the script won't run.
Try removing the first line from your rc.local with the rmmod and reboot -- let me know if that works. -
Same thing as my previous post
-
ALLurGroceries Vegan Vermin Super Moderator
In /etc/rc.local you removed this line?
sudo /sbin/rmmod /usr/local/lib/m11xr2hack.ko
The only thing in your /etc/rc.local should be this:
/sbin/insmod /usr/local/lib/m11xr2hack.ko
After a reboot you should be able to do an lsmod | grep m11 and see that module loaded. -
Correct.
Code:mt@mt-XPS-L501X:~$ lsmod | grep m11 m11xr2hack 1737 0 mt@mt-XPS-L501X:~$
-
ALLurGroceries Vegan Vermin Super Moderator
OK so what is the problem at this point?
Do you need to add the setpci commands to turn the card off? From the other thread:
Again, I have no optimus system so I'm flying blind here I'm sorry.Code:echo 0 >/sys/bus/pci/devices/0000:01:00.0/enable echo 1 >/sys/bus/pci/devices/0000:01:00.0/remove
-
I believe so, because I did no such thing. No problem, I appreciate your help.
-
ALLurGroceries Vegan Vermin Super Moderator
Does that mean it's working?
If not, maybe you need to use a different PCI ID. You can find it in your lspci -nn -
Didn't get it yet. Removed the acpi_call.c and replaced with the hack file, but nothing. Did not do this before, yet it worked. Think I will start over.
-
This is the output of
chmod: changing permissions of `/etc/rc.local': Operation not permittedCode:chmod a+x /etc/rc.local
-
ALLurGroceries Vegan Vermin Super Moderator
Yeah that has to be done as root. So add sudo to the beginning of the command.
I think it may already be executable, from what you posted earlier, but you can find out with ls -l /etc/rc.local
It should say something like this:
Code:-rwxr-xr-x 1 root root 306 Nov 30 2009 /etc/rc.local
-
I believe its working. Thanks for helping out a novice.
So when a new kernel is installed, is this correct?
make clean
make
mv m11xr2hack.ko /usr/local/lib
chmod 0400 /usr/local/lib/m11xr2hack.ko
Acutally I left out,
And rebuild your initrd after placing that blacklist file in modprobe.d:
/sbin/new-kernel-pkg --package kernel --mkinitrd --dracut --depmod --install $(uname -r)
Not sure on this. -
ALLurGroceries Vegan Vermin Super Moderator
That first part should be right.
The second part for updating the initrd is done with:
from man update-initramfs:Code:sudo update-initramfs -ut
-t Allows to take over an custom initramfs with a newer one.
-u This mode updates an existing initramfs.
If it's for a different kernel specify -k kernelversion. For instance update-initramfs -utk 2.6.37.2
The new-kernel-pkg is for redhat I think. Been ages since I used it so IDK. -
Hmm, still not taking after reboot. So if I go
Then it seems to load. I'm going to clear my head and try tomorrow. Thanks for your patience!Code:mt@mt-XPS-L501X:~$ cd acpi_call mt@mt-XPS-L501X:~/acpi_call$ sudo insmod m11xr2hack.ko mt@mt-XPS-L501X:~/acpi_call$ lsmod | grep m11 m11xr2hack 1737 0 mt@mt-XPS-L501X:~/acpi_call$
-
ALLurGroceries Vegan Vermin Super Moderator
Did you copy the new module to /usr/local/lib ?
If you run the init script by itself after rmmod does the module load?
Maybe paste in your /etc/rc.local file contents so we can take a look.Code:sudo rmmod /usr/local/lib/m11xr2hack.ko sudo /etc/rc.local lsmod | grep m11
-
Code:
#!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will "exit 0" on success or any other # value on error. # # In order to enable or disable this script just change the execution # bits. # # By default this script does nothing. exit 0 echo 0 >/sys/bus/pci/devices/0000:01:00.0/enable echo 1 >/sys/bus/pci/devices/0000:01:00.0/remove /sbin/insmod /usr/local/lib/m11xr2hack.ko
Code:mt@mt-XPS-L501X:~$ sudo rmmod /usr/local/lib/m11xr2hack.ko mt@mt-XPS-L501X:~$ sudo /etc/rc.local mt@mt-XPS-L501X:~$ lsmod | grep m11 mt@mt-XPS-L501X:~$
-
ALLurGroceries Vegan Vermin Super Moderator
Move the first line (exit 0) to the end of the script.
-
Made the change to etc/rc.local, same. How do I copy the module
outputI see that there are errors, just don't know how to correct them. Post #28 is the only way I can seem to load the module.Code:mt@mt-XPS-L501X:~$ sudo rmmod /usr/local/lib/m11xr2hack.ko ERROR: Module m11xr2hack does not exist in /proc/modules mt@mt-XPS-L501X:~$
-
ALLurGroceries Vegan Vermin Super Moderator
I just meant did you copy the module from the build directory (acpi_call) to /usr/local/lib/
If you run the script now, does it work once that file has been copied?Code:sudo cp ~/acpi_call/m11xr2hack.ko /usr/local/lib/m11xr2hack.ko
-
I checked usr/local/lib and the m11xr2hack.ko file is there. Is it supposed to have an X icon over the upper right corner of the file? If I click on it, says "the file is of an unknown type".
-
ALLurGroceries Vegan Vermin Super Moderator
Yeah that X icon is because it's owned by root and you don't have privileges for the file as a normal user. I'm not sure what's going wrong this time, I've lost track. Can you try running the script and see if the module loads?
-
If you want to keep the rmmod you could do the following to hide the error from being displayed and always get a good return code.
Code:if /sbin/rmmod /usr/local/lib/m11xr2hack.ko 2>/dev/null ;then :;fi
-
If I do the above, shouldn't there be something in the file? It's empty. Also, when the lid is opened and resuming from suspend, there's a warning about ignoring a bad line starting with echo. Flashes too quick to see all of it. Sorry I seem so dense, but I'm just not getting it.Code:
sudo gedit /usr/local/lib/m11xr2hack.ko
-
ALLurGroceries Vegan Vermin Super Moderator
The .ko file is a kernel module, which is a binary file. You can't open it in anything but a hex editor.
-
Ok
It works, but the script isn't running at startup. What files do I need to check to make sure the correct information is there?
-
ALLurGroceries Vegan Vermin Super Moderator
Does it work if you run the script manually?
Try adding some time for it at the beginning by adding this to the top of the rc.local file (as the first line):
The problem may be the order since ubuntu is using upstart now which runs all your startup stuff in parallel, this command may be executed too soon. This will add 15 seconds of time for it to wait until it runs the rest of the script at startup.Code:sleep 15
-
Yes, if I run
I'm done with this for a while. You've been extremely patient with me and I appreciate it. I'll get it eventually. Thanks!Code::~$ cd acpi_call :~/acpi_call$ sudo insmod m11xr2hack.ko
Optimus,battery life and Linux
Discussion in 'Linux Compatibility and Software' started by Gunjunkie, Feb 27, 2011.