Acpi call

From Hybridgraphics

Jump to: navigation, search

acpi_call lets you send ACPI commands to turn your optimus nvidia card on or off (the actual commands to send will vary based on your laptop).

If you get and build the code from the link above, you can build and insert (insmod) the acpi_call module, but you will need to re-insert it after every reboot. In Ubuntu 11.04, you can try using dkms to make this module permanently available.

1. Install dkms and some useful packages:

sudo apt-get install dkms git build-essential
sudo apt-get install linux-headers-$(uname -r)

2. Clone the acpi_call repository from git and copy it to where dkms will look for it. We'll call it version 0.0.1 for now:

git clone
mkdir /usr/src/acpi_call-0.0.1
cp -rp acpi_call/* /usr/src/acpi_call-0.0.1

3. Create a file dkms.conf for it:

sudo gedit /usr/src/acpi_call-0.0.1/dkms.conf

and paste this into it and save it:

CLEAN="make clean"
MAKE[0]="make IGNORE_CC_MISMATCH=1 KDIR=$kernel_source_dir PWD=$dkms_tree/acpi_call/0.0.1/build"

4. Edit the Makefile:

sudo gedit /usr/src/acpi_call-0.0.1/Makefile

and paste this into it and save it:

obj-m := acpi_call.o

	$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules

	rm acpi_call.mod.o acpi_call.o acpi_call.ko

5. Add the module to dkms and build and install it:

sudo dkms add -m acpi_call -v 0.0.1
sudo dkms build -m acpi_call -v 0.0.1
sudo dkms install -m acpi_call -v 0.0.1

If all went well, you should now be able to load the module with:

sudo modprobe acpi_call

and this will give some information about it:

modinfo acpi_call


  • The AUTOINSTALL="yes" line in dkms.conf is supposed to tell dkms to automatically build and install the module if you upgrade the kernel, but if it doesn't work you can manually execute the dkms build and install commands in the new kernel.
  • If you want to remove the module (eg from all kernels), do:
sudo dkms remove -m acpi_call -v 0.0.1 --all
Personal tools