Lenovo t410s - Script to switch graphic card at boot
Lenovo t410s - Script to switch graphic card at boot
Hello everybody,
I have a lenovo t410s with internal (intel) and discrete (nvidia) graphic card.
I'm running Ubuntuo 10.04 64 bit.
I know that the switchable graphic card is not enable yet and I cannot switch between the two on the fly, without restarting the X server.
However, I'm looking for a script to switch the graphic card at boot time, according to the card selected in the BIOS setting and enable/disable the related driver.
Is it possible?
Thank you very much!
I have a lenovo t410s with internal (intel) and discrete (nvidia) graphic card.
I'm running Ubuntuo 10.04 64 bit.
I know that the switchable graphic card is not enable yet and I cannot switch between the two on the fly, without restarting the X server.
However, I'm looking for a script to switch the graphic card at boot time, according to the card selected in the BIOS setting and enable/disable the related driver.
Is it possible?
Thank you very much!
Re: Lenovo t410s - Script to switch graphic card at boot
While switchable graphics is long way off you might want to look at this site:
http://linux-hybrid-graphics.blogspot.com/
Another that gives some background info (not necessarily a solution) is on the Gentoo wiki
I don't know of any "script" (or if it's even possible) to detect your BIOS settings and auto-load the correct module.
What I do is create two GRUB entries, one with the radeon driver (or the NVIDIA module in your case) and the other with the intel module. Then I go into BIOS and choose which card I want to use and when GRUB loads I pick the appropriate entry. If you switch a lot this may be a little annoying, but I tend to use my Intel card 90% of the time (heat and battery issues mainly) so it works for me.
Hope this helps.
http://linux-hybrid-graphics.blogspot.com/
Another that gives some background info (not necessarily a solution) is on the Gentoo wiki
I don't know of any "script" (or if it's even possible) to detect your BIOS settings and auto-load the correct module.
What I do is create two GRUB entries, one with the radeon driver (or the NVIDIA module in your case) and the other with the intel module. Then I go into BIOS and choose which card I want to use and when GRUB loads I pick the appropriate entry. If you switch a lot this may be a little annoying, but I tend to use my Intel card 90% of the time (heat and battery issues mainly) so it works for me.
Hope this helps.
W510: i7-820QM / 8GB 1066 RAM/ 1 GB NVIDIA Quadro FX 880M / 500GB 7200rpm / 15.6" HD 1080 / Arch Linux
Re: Lenovo t410s - Script to switch graphic card at boot
Thank you very much for your reply!
This is exactly what I would like to have. I use the laptop to work mostly, however sometime it's nice to play a little bit
Just another question, about the two entries in the grub that you suggested. How can I do that?
Do you any references or maybe your entries as example?
Thank you again!
This is exactly what I would like to have. I use the laptop to work mostly, however sometime it's nice to play a little bit
Just another question, about the two entries in the grub that you suggested. How can I do that?
Do you any references or maybe your entries as example?
Thank you again!
Re: Lenovo t410s - Script to switch graphic card at boot
I'll help out but understand that I'm running Arch Linux so things are going to be slightly differently; mainly what files to modify...other than that the underlying method is the same. There are basically two parts: creating a custom ramdisk and then editing your GRUB entries. Note: All the steps below wiil require root or sudo.gilnarya wrote:Just another question, about the two entries in the grub that you suggested. How can I do that?
To make a custom ramdisk you'll want to look at the comman mkinitcpio. The Arch Linux wiki page might help, and you may want to look over similar documentation on the Ubuntu forums.
The first thing you need to do is find out where your current modules are being loaded. In Arch Linux /etc/rc.conf contains this but that's fairly unique to Arch Linux...in Ubuntu you probably want to look at /etc/modules. You need to remove whatever your current video module is (NVIDIA or intel....we're going to load it elsewhere).
Next you need to edit /etc/mkinitcpio.conf. It should be in /etc but you may want to double check....also make a backup of your mkinitcpio.conf (e.g. mkinitcpio.conf.orig). The important part of that file is the line
Code: Select all
MODULES="intel_agp i915"Now that you've added the module(s) to mkinitcpio.conf you'll need to generate the ramdisk. This is done simply with
Code: Select all
# mkinitcpio -p kernel26You now have two images generated by mkinitcpio, /boot/kernel26.img and /boot/kernel26-fallback.img. These are the standard images that you've been using, just with a few extras modules being loaded.
Next you'll repeat the steps but for the other video module. Copy your /etc/mkinitcpio.conf to another name, e.g., /etc/mkinitcpio-nvidia.conf. Simply replace the video module in the MODULE line of your new mkinitcpio.conf. For example:
/etc/mkinitcpio.conf
Code: Select all
MODULES="intel_agp i915"Code: Select all
MODULES="intel_agp radeon"Code: Select all
# mkinitcpio -c /etc/mkinitcpio-custom.conf -g /boot/kernel26-custom.imgCode: Select all
# mkinitcpio -c /etc/mkinitcpio-nvidia.conf -g /boot/kernel26-nvidia.imgCode: Select all
####################
#### BEGIN MENU ####
set timeout=4
set default="0"
set fallback="1"
# Entry 0 - Arch Linux (Intel)
menuentry "Arch Linux (Intel)" --class "arch" {
set root=(hd0,1)
linux /boot/vmlinuz26 root=/dev/disk/by-label/Arch_Root resume=/dev/disk/by-label/Swap radeon.modeset=1 acpi_osi="Linux" ro splash
initrd /boot/kernel26.img
}
# Entry 1 - Arch Linux (Intel Fallback)
menuentry "Arch Linux (Intel) Fallback" --class "arch" {
set root=(hd0,1)
linux /boot/vmlinuz26 root=/dev/disk/by-label/Arch_Root ro
initrd boot/kernel26-fallback.img
}
# Entry 2 - Arch Linux (ATI Video)
menuentry "Arch Linux (ATI)" --class "arch" {
set root=(hd0,1)
linux /boot/vmlinuz26 root=/dev/disk/by-label/Arch_Root resume=/dev/disk/by-label/Swap i915.modeset=1 acpi_osi="Linux" ro splash
initrd /boot/kernel26-ati.img
}
# Entry 3 - Memtest86+
menuentry "Memtest86+" --class "memtest" {
set root=(hd0,1)
linux /boot/memtest86+/memtest.bin
}
#### END MENU ####
####################
That should be it! Reboot and select your desired graphics card in the BIOS, then when GRUB loads pick the appropriate GRUB entry. You can check for your card with the command lspci. There should be a line with something like (this is for my ATI card)
If you chose the Intel card the above line should say something like Intel Grapics Controller.01:00.0 VGA compatible controller: ATI Technologies Inc Mobility Radeon HD 3650
You can also check that the appropriate modules (ATI here in my case) are loaded with lsmod:
Code: Select all
$ lsmod | grep radeon
radeon 707496 2
ttm 46389 1 radeon
drm_kms_helper 23796 1 radeon
drm 160401 4 radeon,ttm,drm_kms_helper
i2c_algo_bit 5031 1 radeon
i2c_core 17959 6 videodev,i2c_i801,radeon,drm_kms_helper,drm,i2c_algo_bit
Code: Select all
$ lsmod | grep i915
$
One thing to note is that if you update your kernle you'll have to run mkinitcpio again. The kernel update should use /etc/mkinitcpio.conf by default so all you need to do is rung the command for the custom image.
If I've missed anything or you have questions let me know.
W510: i7-820QM / 8GB 1066 RAM/ 1 GB NVIDIA Quadro FX 880M / 500GB 7200rpm / 15.6" HD 1080 / Arch Linux
Re: Lenovo t410s - Script to switch graphic card at boot
Superego, I'm speechless!
Thank you very much for your great help!!!!!!
I will let you know the results!
Thank you!
Thank you very much for your great help!!!!!!
I will let you know the results!
Thank you!
-
- Similar Topics
- Replies
- Views
- Last post
-
-
Fan trouble - 3000 N200 + Type 0769 - ESG ACPI Script for NHC > NOTEBOOK HARDWARE CONTROL
by MatMor » Sun Mar 12, 2017 12:12 pm » in 3000 Series Laptops - 0 Replies
- 2604 Views
-
Last post by MatMor
Sun Mar 12, 2017 12:12 pm
-
-
-
Lenovo Ideapad Yoga 13...white slider switch question
by mr.rhtuner » Mon Feb 27, 2017 2:23 pm » in IdeaPad Series Laptops - 0 Replies
- 1867 Views
-
Last post by mr.rhtuner
Mon Feb 27, 2017 2:23 pm
-
-
-
X220 thinks that the hardware wifi switch is off (help and discussion)
by axur-delmeria » Mon Apr 03, 2017 12:42 pm » in ThinkPad X200/201/220 and X300/301 Series - 4 Replies
- 997 Views
-
Last post by axur-delmeria
Tue Apr 04, 2017 11:08 pm
-
-
- 18 Replies
- 546 Views
-
Last post by karotlopj
Wed Jun 14, 2017 2:58 am
Who is online
Users browsing this forum: No registered users and 3 guests



