2

I have enable switcheroo in kernel config . Why is there not /sys/kernel/debug/vgaswitcheroo/switch ?

Linux ubuntu-raid-w500 2.6.38-10-generic #46-Ubuntu SMP Tue Jun 28 15:07:17 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

My computer is Thinkpad W500 . One graphic card is ATI Mobility FireGL V5700 (512 MB). The other one is Intel Graphics Media Accelerator 4500MHD .

I am using official kernel 2.6.38-10, I do NOT customize it. I add kernel option pcie_aspm=force in GRUB_CMDLINE_LINUX_DEFAULT of /etc/default/grub

Lekensteyn
  • 174,277
waterloo2005
  • 2,037

3 Answers3

4

In Ubuntu 10.10 and up, vgaswitchheroo is already enabled so you don't need extra settings. And /sys/kernel/debug is already mounted, however you need root permissions to read the contents of /sys/kernel/debug, so using sudo su should work.

If there's still no switch, run lspci | grep VGA and make sure both cards are outputted. If one is missing a BIOS setting might be the cause, so check that.

Console example:

sergio@Sergio-L:~$ ls /sys/kernel/debug/vgaswitcheroo
ls: impossível aceder a /sys/kernel/debug/vgaswitcheroo: Permissão negada
sergio@Sergio-L:~$ sudo su
[sudo] password for sergio: 
root@Sergio-L:/home/sergio#
root@Sergio-L:/home/sergio# ls /sys/kernel/debug/vgaswitcheroo/
switch
root@Sergio-L:/home/sergio#
sergio91pt
  • 2,942
  • I have added modeset=1 kernel option . I still can not find /sys/kernel/debug/vgaswitcheroo/switch in 'su -' . – waterloo2005 Jul 14 '11 at 13:57
  • @waterloo If I'm not mistaken you need to associate modeset with a kernel module. This is baked in by default in Ubuntu, so remove that and try again. Can you update your question with the results of uname -a? If your kernel version isn't >= 2.6.34 you don't have vga_switchheroo. – sergio91pt Jul 14 '11 at 14:36
  • I cancel modeset=1 in kernel option . But I still can not find /sys/kernel/debug/vgaswitcheroo directory . – waterloo2005 Jul 14 '11 at 14:46
  • @waterloo2005 I've added my console output as an example. Yes I'm not using the latest kernel, but that's not the point. Look at the output: I can't ls /sys/kernel/debug/* without being root. sudo won't work (and you can't login with su in Ubuntu...) Use sudo su to get a root shell, then try again. – sergio91pt Jul 14 '11 at 16:53
  • I have used 'sudo passwd' to set password. So I can use 'su -' to change root user. Even I use sudo su, I still can not find /sys/kernel/debug/vgaswitcheroo/switch . – waterloo2005 Jul 15 '11 at 08:33
  • @waterloo Sorry my bad.. You have to give more information if you want this solved... You're running Ubuntu 11.04 right? And you have 2 cards to use the switch right? (lspci | grep VGA) By any chance you're using a custom kernel or custom options/custom boot options/scripts? If so what are them? If not post the part related to a boot on /var/log/kern.log to paste.ubuntu.com and share the link, it might help. – sergio91pt Jul 15 '11 at 09:01
  • I use ubuntu 11.04 . My computer is Thinkpad W500 . One graphic card is ATI Mobility FireGL V5700 (512 MB). The other one is Intel Graphics Media Accelerator 4500MHD . I use official kernel 2.6.38-10, I do NOT customize it. I add kernel option 'pcie_aspm=force' in GRUB_CMDLINE_LINUX_DEFAULT of /etc/default/grub . It is http://paste.ubuntu.com/644772/ about kern.log . – waterloo2005 Jul 15 '11 at 13:30
  • @waterloo please paste the whole bootup, starts at 0.000.. and the first line should be something like this: imklog 4.6.4, log source = /proc/kmsg started. – sergio91pt Jul 15 '11 at 15:48
  • http://paste.ubuntu.com/644885/ Thanks – waterloo2005 Jul 15 '11 at 16:46
  • @waterloo When someone asks you for more information please edit your question and put it there, that way people can have everything they need to help debug it right off the bat. Thanks! – Jorge Castro Jul 15 '11 at 17:29
  • 1
    @waterloo I'm no expert, from what I read vgaswitcheroo isn't being loaded on startup and you're using the Intel card but I couldn't find references to your ATI card so It's most likely powered off. I took a look the manuals and on your BIOS there should be these options: 'GraphicsDevice' and 'OsDetectionForSwitchableGraphics'. The former should be set to 'SwitchableGfx' and the later to 'Enable', are these set? Some more questions in case the BIOS doesn't solve it: Can you ls /sys/kernel/debug? Does lspci | grep VGA really output the 2 cards? Btw you have crashkernel set eating memory :P – sergio91pt Jul 15 '11 at 19:51
  • @Jorge Castro, good instructions. Thanks @sergio91pt, Thanks first . I am shy. In bios , I set GrphicsCard to intel only . I do NOT set it to Switchable . I hear that if I choose switchable in bios the discreted card is hot even I do not use it . Can vgaswitcheroo solve this problem ?

    Thanks

    – waterloo2005 Jul 16 '11 at 08:08
  • 1
    @waterloo Yes, you can use echo "OFF" on the switch to turn off the idle card. On the Community Help theres a init script you can try, if you don't want to be doing echo "OFF" everytime you boot. So did the BIOS solve it? Then you can mark the question as solved. – sergio91pt Jul 16 '11 at 09:04
  • @sergio91pt , yes , Changing bios settings solves it . Thanks!! – waterloo2005 Jul 16 '11 at 12:38
  • 1
    How to mark this post as solved ? Thanks – waterloo2005 Jul 16 '11 at 12:51
  • 1
    @waterloo There should be a grey button that turns into green when you hover it, at the left of my answer, its for marking the question that solved it. – sergio91pt Jul 16 '11 at 14:44
  • Please follow the instructions on this page (launchpad.net/~hybrid-graphics-linux) so Linux can support Hybrid-Graphics more efficiently – Muhammad Gelbana Nov 29 '14 at 15:24
1

If you are not using the open-source radeon driver (or the nouveau driver in case of nvidia hardware), there won't be a /sys/kernel/debug/vgaswitcheroo/switch file. (ignoring hacks like asus-switcheroo and byo-switcheroo). Disabling KMS ("modeset=0") turns off this functionality too.

Even if the file exist, it cannot be reliable used when proprietary drivers (fglrx, nvidia) are loaded thereafter. You may experience lockups when trying to write commands to it. For vga_switcheroo on NVIDIA hardware, see also How to enable vga switcheroo on an Asus U41S?. For NVIDIA Optimus hardware in general, see Is a NVIDIA GeForce with Optimus Technology supported by Ubuntu?

Lekensteyn
  • 174,277
  • I'm using the open-source radeon driver, but still there is no /sys/kernel/debug/vgaswitcheroo/switch. –  May 07 '12 at 19:16
  • @gentmatt same thing for me, might it be that we are both on Macbooks? , according to the Ubuntu switcheroo faq, it doesn’t show up unless you add nomodeset or modeset=1 to your kernel cmd line. None of them help in my case. The first one seems to stop X from starting as well. – tomodachi Sep 05 '12 at 15:29
  • @gentmatt check this out http://askubuntu.com/questions/184406/how-to-switch-between-gfx-cards-on-macbook-pro-15 – tomodachi Sep 05 '12 at 15:56
  • @tomodachi Please excuse my late reply. I was offline for a while :) Yes, I have a MacBook (MBP 8,2). But I have stopped trying to get GPU switching to work in Ubuntu. The problem is apparently that Apple's BIOS legacy mode hides the internal GPU. For that reason, Bootcamp only uses the dGPU as well. Any attempt to get GPU switching to work in Ubuntu should first manage to EFI boot on a Mac. However, I've not got this to work on a Macbook Pro (black boot screen, and other issues). –  Sep 20 '12 at 09:33
0

The answer in my case was buried above in a comment : there is a BIOS option on my HP laptop named "HybridGraphics" and it was set to "AUTO". This is seemingly not enough, and one has to set it to "ENABLE".