You are not logged in.

#1 2011-01-23 15:50:18

davide
Member
Registered: 2010-12-06
Posts: 18

Integreted / nVidia VGA switching

Hi all
I've got a new Dell Vostro 3500 laptop and I managed to install Arch and get it work at least as well as Ubuntu does, but now I'm having problems with the configuration of the graphic cards.
I've got 2 graphic cards: nVidia GeForce 310M and an integrated Intel card:

$ lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation Core Processor Integrated Graphics Controller (rev 18)
01:00.0 VGA compatible controller: nVidia Corporation GT218 [GeForce 310M] (rev a2)

At start up the active one is the integrated and I want the nVidia one to work. Thing is, i seem to have no way to disabling it at bios level, so what It's up to the OS performing the switch.
As I understand, I've got the same issue told in this post:
https://bbs.archlinux.org/viewtopic.php?id=104788

I tried googling a while but I'm quite confused:
* What is vga_switcheroo and how could I install it? in this post the guy seems to get it working by mounting "none" partition with debugfs filesystem on /sys/kernel/debug, where he then finds a vgaswitcheroo folder, which I can's see if I do the same

* If I understood well, in this reply to the topic I linked before, arnaldo.coelho tells the way he managed to get things work properly, but I didn't understand what he did and how it works.

* In case anything involves kernel patching, I have absolutely no experience with it: in case I needed to do it, would it mean I would have to upgrade it and compile it any time there is a new little-changed version, and that pacman wouldn't do the job for me any more?

Thanks a lot
Davide

Last edited by davide (2011-01-23 15:54:59)

Offline

#2 2011-01-23 22:32:28

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 6,839

Re: Integreted / nVidia VGA switching

I believe the NVIDIA linux forums is the place to look, switcheroo was located there last time I checked. And no, no kernel patching should be required.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#3 2011-01-23 22:36:48

karol
Archivist
Registered: 2009-05-06
Posts: 25,431

Re: Integreted / nVidia VGA switching

You can check http://linux-hybrid-graphics.blogspot.com to get you started.

Offline

#4 2011-01-24 17:09:03

arnaldo.coelho
Member
Registered: 2005-01-28
Posts: 6

Re: Integreted / nVidia VGA switching

Davide,

First of all, sorry for my poor english...

I was able to activate and use my Nvidia GT330M in a Vostro 3700. I compiled and installed a kernel with some testing code from Dave Airlied (http://airlied.livejournal.com/74176.html). This is experimental code, but it worked in my Vostro 3700 (but i dont know if it will work in your Vostro 3500), so use it at your own risk! Here is what to do:

1) Download the linux kernel, version 2.6.37.

2) Using Dave Airlied git code, i managed to create a patch for it. Take it here (http://pastebin.com/fr0UsMaB)

3) Apply the patch and compile your own kernel. For more instruction how to do that, look here (https://wiki.archlinux.org/index.php/Ke … rom_Source).

4) Add this line to /etc/fstab:

                 none                    /sys/kernel/debug debugfs defaults 0 0

5) Boot the new kernel and try to switch to Nvidia (without running Xorg), using this command:

            echo "DIS" > /sys/kernel/debug/vgaswitcheroo/switch

If this worked for you, congratulations! But for my Vostro 3700 all i've got was a blank screen. But i figured out that the card switch was sucesseful, but the LVDS switch wasnt. So, messing arround with acpi_call i've discovered i nedded a few aditional steps:

6) Install acpi_call from here (https://github.com/mkottman/acpi_call) or use the AUR (http://aur.archlinux.org/packages.php?ID=39470)

7) Run all these commands (i needed all to make the switch work):

                modprobe acpi_call
            echo "DIS" > /sys/kernel/debug/vgaswitcheroo/switch
                echo "\_SB.PCI0.P0P1.PEGP.MXMX" > /proc/acpi/call
                echo "\_SB.PCI0.P0P1.PEGP.MXDS" > /proc/acpi/call
                echo "IGD" > /sys/kernel/debug/vgaswitcheroo/switch
                echo "DIS" > /sys/kernel/debug/vgaswitcheroo/switch
                echo "\_SB.PCI0.P0P1.PEGP.MXMX" > /proc/acpi/call
                echo "\_SB.PCI0.P0P1.PEGP.MXDS" > /proc/acpi/call

8) When the switch is complete, you will see the console in a 1024x768 resolution. Just start Xorg and it will be using your native resolution. To me was necessary to create a xorg.conf because the autoconfiguration wasn't working.

PS: With nouveau i've got some stability issues, but it seems to be related to this bug (https://bugs.freedesktop.org/show_bug.cgi?id=26980) and not with Dave code itself.

Offline

#5 2011-01-25 17:14:08

davide
Member
Registered: 2010-12-06
Posts: 18

Re: Integreted / nVidia VGA switching

Thanks a lot for your replies
I think I'll try playing a little more with vga_switcheroo, then if I don't come out with a solution I'll follow arnaldo.cohelo's way, even if I've got the feeling it will take me a while... at least I've done with my exams.
Just one thing: arnaldo, do you think your solution can work with nvidia proprietary driver?

Thanks again
Davide

Offline

#6 2011-01-25 17:28:56

arnaldo.coelho
Member
Registered: 2005-01-28
Posts: 6

Re: Integreted / nVidia VGA switching

Nope, this solution won't work with nvidia proprietary driver.

Offline

#7 2011-01-27 17:52:27

Maroko
Member
From: Slovakia
Registered: 2009-06-23
Posts: 14

Re: Integreted / nVidia VGA switching

arnaldo.coelho: I tried your solution and it is working with Vostro 3500. Thank you!

Offline

#8 2011-01-29 16:47:02

arnaldo.coelho
Member
Registered: 2005-01-28
Posts: 6

Re: Integreted / nVidia VGA switching

Maroko: having any stability issues?

Offline

#9 2011-01-30 10:52:03

Maroko
Member
From: Slovakia
Registered: 2009-06-23
Posts: 14

Re: Integreted / nVidia VGA switching

arnaldo.coelho: Unfortunately I do. Sometimes (once a day maybe) the system freezes. I can move the mouse, but system doesn't react. I have to press power button to force shutdown. My laptop is connected to external display, through HDMI. I'm wondering if it is the cause of the stability issues, but I didn't test it without external display yet.

Offline

#10 2011-03-19 17:31:44

gerardojerry
Member
Registered: 2011-03-19
Posts: 5

Re: Integreted / nVidia VGA switching

arnaldo.coelho:

1) Download the linux kernel, version 2.6.37.

2) Using Dave Airlied git code, i managed to create a patch for it. Take it here (http://pastebin.com/fr0UsMaB)

3) Apply the patch and compile your own kernel. For more instruction how to do that, look here (https://wiki.archlinux.org/index.php/Ke … rom_Source).

Sorry I'm a mewbie in this but i want to know how do i apply your patch to the downloaded kernel, I've downloaded kernel version 2.6.37, but after I decompress it i don't know what to do, can you plz help me?? thanks

Offline

#11 2011-03-19 17:35:59

feng-fr
Member
Registered: 2011-02-27
Posts: 15

Re: Integreted / nVidia VGA switching

According you're in the case :

$ ls

linux-2.6.37/
nvidia-optimus-patch-2.6.37.patch

$ patch -p0 < nvidia-optimus-patch-2.6.37.patch


Enjoy wink

Last edited by feng-fr (2011-03-19 17:36:43)

Offline

#12 2011-03-19 19:08:19

gerardojerry
Member
Registered: 2011-03-19
Posts: 5

Re: Integreted / nVidia VGA switching

thanks! now in compiling the kernel, but now with this i supose i can use the nvidia card, and then i can use the desktop effects right??

Offline

#13 2011-03-19 20:36:10

gerardojerry
Member
Registered: 2011-03-19
Posts: 5

Re: Integreted / nVidia VGA switching

Now im using the nvidia card!! Thankyou! but the only problem is that i cant use the wifi, if someone knows why please tell me, but meanwhile i will search for an answer big_smile

Offline

#14 2011-03-19 21:59:16

gerardojerry
Member
Registered: 2011-03-19
Posts: 5

Re: Integreted / nVidia VGA switching

Till now, no stability issues, i'll use it more to see if something goes wrong
Again, thank you!

Offline

#15 2011-03-22 15:52:38

gerardojerry
Member
Registered: 2011-03-19
Posts: 5

Re: Integreted / nVidia VGA switching

only I cant use my HDMI hmm and my system crashes when I unplug the AC adapter

Offline

#16 2011-04-27 18:51:57

Maroko
Member
From: Slovakia
Registered: 2009-06-23
Posts: 14

Re: Integreted / nVidia VGA switching

With kernel 2.6.38-4 and nouveau I've been running Vostro 3500 for two days without random crash. The only problem is when I play a video with any player (VLC, mplayer, ...) - system instantly hangs. I tried to change video output from default (probably xv) to SDL (in VLC), but it didn't help. I searched all over the net, but no one seems to have this problem. I guess I have to wait for new kernel and hope it will be fine smile Any suggestions? Thanks.

Offline

#17 2011-04-27 19:02:32

feng-fr
Member
Registered: 2011-02-27
Posts: 15

Re: Integreted / nVidia VGA switching

Hi,

Did you apply arnaldo.coelho's patch on kernel .38 ?
If no, please tell me how enable discrete card without it !!

You still use the commands to enable the discrete card ? ( echo "DIS" > ... & cie )

I'll try on my Vostro 3700 and feedback smile

Last edited by feng-fr (2011-04-27 20:09:56)

Offline

#18 2011-04-27 20:48:14

Maroko
Member
From: Slovakia
Registered: 2009-06-23
Posts: 14

Re: Integreted / nVidia VGA switching

feng-fr:
Hi.
With 2.6.38 from arch repo, there was no need to patch and compile kernel.
I just compiled acpi_call-git (it is in AUR) and then added this code to /etc/rc.local:

mount -t debugfs none /sys/kernel/debug
modprobe acpi_call
echo "DIS" > /sys/kernel/debug/vgaswitcheroo/switch
echo "\_SB.PCI0.P0P1.PEGP.MXMX" > /proc/acpi/call
echo "\_SB.PCI0.P0P1.PEGP.MXDS" > /proc/acpi/call
echo "IGD" > /sys/kernel/debug/vgaswitcheroo/switch
echo "DIS" > /sys/kernel/debug/vgaswitcheroo/switch
echo "\_SB.PCI0.P0P1.PEGP.MXMX" > /proc/acpi/call
echo "\_SB.PCI0.P0P1.PEGP.MXDS" > /proc/acpi/call

Just make sure that acpi_call is compiled for kernel that you use with nouveau.
If you have only one kernel installed, everything should be fine.

Also, I created file /etc/X11/xorg.conf.d/20-nouveau.conf with:

Section "Device"
    Identifier "nvidia card"
    Driver "nouveau"
EndSection

Last edited by Maroko (2011-04-27 20:54:22)

Offline

#19 2011-04-27 20:56:33

feng-fr
Member
Registered: 2011-02-27
Posts: 15

Re: Integreted / nVidia VGA switching

I use my own kernel based on Arch's one with additionals patches

I added switch code into a rc.switch and added some lines into rc.sysinit

I planed to add on AUR a "vostro-kit" package with the special kernel & some scripts to switch and display it at boot time & disable discrete card with system tray notification.

If I experience same issue than you with the .38 kernel, i'll wait the .39 (cause .37 have random hangs, so it's pretty useless ...)

I'll try tomorrow smile

Offline

#20 2011-05-01 10:19:06

feng-fr
Member
Registered: 2011-02-27
Posts: 15

Re: Integreted / nVidia VGA switching

No hang at home when reading a video big_smile

Let's see if nouveau hang as it did in 37 patched wink

Offline

Board footer

Powered by FluxBB