Go Back   nV News Forums > Linux Support Forums > NVIDIA Linux

Newegg Daily Deals

Reply
 
Thread Tools
Old 12-15-09, 08:35 PM   #1
underling
Registered User
 
Join Date: Jun 2005
Posts: 14
Default Fedora 12 + multiple video cards + Xinerama + vga_arbitor is unusable

I discovered after updating to Fedora 12 that my 3 monitor Xinerama setup broke. At X startup, the CPU would shoot to 100%, and GDM would never get a chance to paint anything.

I noticed that while the server was wedged, it was spinning reading and writing to /dev/vga_arbiter. Since the nvidia driver has no need to communicate over the legacy VGA channel, I patched the driver to call vga_set_legacy_decoding(dev, VGA_RSRC_NONE); at init time, and my Xinerama setup works perfectly once again.

Patch:

Code:
*** usr/src/nv/nv-linux.h.orig	2009-11-22 19:27:38.000000000 -0800
--- usr/src/nv/nv-linux.h	2009-12-15 18:32:06.000000000 -0800
***************
*** 83,102 ****
--- 83,103 ----
  
  #if !defined(KERNEL_2_4)
  #include <linux/sched.h>            /* suser(), capable() replacement   */
  #include <linux/moduleparam.h>      /* module_param()                   */
  #include <linux/smp_lock.h>         /* kernel_locked                    */
  #include <asm/tlbflush.h>           /* flush_tlb(), flush_tlb_all()     */
  #include <asm/kmap_types.h>         /* page table entry lookup          */
  #endif
  
  #include <linux/pci.h>              /* pci_find_class, etc              */
+ #include <linux/vgaarb.h>           /* vga_set_legacy_decoding          */
  #include <linux/interrupt.h>        /* tasklets, interrupt helpers      */
  #include <linux/timer.h>
  
  #include <asm/div64.h>              /* do_div()                         */
  #include <asm/system.h>             /* cli, sli, save_flags             */
  #include <asm/io.h>                 /* ioremap, virt_to_phys            */
  #include <asm/uaccess.h>            /* access_ok                        */
  #include <asm/page.h>               /* PAGE_OFFSET                      */
  #include <asm/pgtable.h>            /* pte bit definitions              */
  
*** usr/src/nv/nv.c.orig	2009-11-22 19:27:36.000000000 -0800
--- usr/src/nv/nv.c	2009-12-15 18:32:06.000000000 -0800
***************
*** 724,743 ****
--- 724,745 ----
                  goto failed;
              }
  
              entry->data = nv;
              entry->read_proc = nv_kern_read_agpinfo;
  #if defined(NV_PROC_DIR_ENTRY_HAS_OWNER)
              entry->owner = THIS_MODULE;
  #endif
          }
  
+         vga_set_legacy_decoding(dev, VGA_RSRC_NONE);
+ 
          NV_PCI_DEV_PUT(dev);
      }
  
      entry = create_proc_entry("version", flags, proc_nvidia);
      if (!entry)
          goto failed;
  
      entry->read_proc = nv_kern_read_version;
  #if defined(NV_PROC_DIR_ENTRY_HAS_OWNER)
      entry->owner = THIS_MODULE;
underling is offline   Reply With Quote
Old 12-16-09, 01:14 PM   #2
underling
Registered User
 
Join Date: Jun 2005
Posts: 14
Default Re: Fedora 12 + multiple video cards + Xinerama + vga_arbitor is unusable

Here is a new patch with appropriate macro shielding to only interact with the new vgaarb API when it's present:

Code:
*** usr/src/nv/nv-linux.h.orig	2009-11-22 19:27:38.000000000 -0800
--- usr/src/nv/nv-linux.h	2009-12-16 11:02:22.000000000 -0800
***************
*** 83,102 ****
--- 83,105 ----
  
  #if !defined(KERNEL_2_4)
  #include <linux/sched.h>            /* suser(), capable() replacement   */
  #include <linux/moduleparam.h>      /* module_param()                   */
  #include <linux/smp_lock.h>         /* kernel_locked                    */
  #include <asm/tlbflush.h>           /* flush_tlb(), flush_tlb_all()     */
  #include <asm/kmap_types.h>         /* page table entry lookup          */
  #endif
  
  #include <linux/pci.h>              /* pci_find_class, etc              */
+ #if defined(CONFIG_VGA_ARB)
+ #include <linux/vgaarb.h>           /* vga_set_legacy_decoding          */
+ #endif
  #include <linux/interrupt.h>        /* tasklets, interrupt helpers      */
  #include <linux/timer.h>
  
  #include <asm/div64.h>              /* do_div()                         */
  #include <asm/system.h>             /* cli, sli, save_flags             */
  #include <asm/io.h>                 /* ioremap, virt_to_phys            */
  #include <asm/uaccess.h>            /* access_ok                        */
  #include <asm/page.h>               /* PAGE_OFFSET                      */
  #include <asm/pgtable.h>            /* pte bit definitions              */
  
*** usr/src/nv/nv.c.orig	2009-11-22 19:27:36.000000000 -0800
--- usr/src/nv/nv.c	2009-12-16 11:02:54.000000000 -0800
***************
*** 724,743 ****
--- 724,747 ----
                  goto failed;
              }
  
              entry->data = nv;
              entry->read_proc = nv_kern_read_agpinfo;
  #if defined(NV_PROC_DIR_ENTRY_HAS_OWNER)
              entry->owner = THIS_MODULE;
  #endif
          }
  
+ #if defined(CONFIG_VGA_ARB)
+         vga_set_legacy_decoding(dev, VGA_RSRC_NONE);
+ #endif
+ 
          NV_PCI_DEV_PUT(dev);
      }
  
      entry = create_proc_entry("version", flags, proc_nvidia);
      if (!entry)
          goto failed;
  
      entry->read_proc = nv_kern_read_version;
  #if defined(NV_PROC_DIR_ENTRY_HAS_OWNER)
      entry->owner = THIS_MODULE;
underling is offline   Reply With Quote
Old 12-16-09, 01:23 PM   #3
underling
Registered User
 
Join Date: Jun 2005
Posts: 14
Default Re: Fedora 12 + multiple video cards + Xinerama + vga_arbitor is unusable

It appears that a few people are running the patch successfully:

http://www.nvnews.net/vbulletin/showthread.php?t=141706
http://forums.fedoraforum.org/showthread.php?t=236211

I think it's the right thing to do. It's a shame that the vga arbiter is opt-out in nature, since the overwhelming majority of video cards have their own relocatable address space to communicate with each card independently without toggling the enable bits for each card in a round-robin loop. It would have probably made more sense for drivers to declare that they need that facility, rather than declare that they don't.

I'm going to post this to the rpmfusion mailing list if no one has any objections.
underling is offline   Reply With Quote
Old 01-07-10, 05:41 PM   #4
underling
Registered User
 
Join Date: Jun 2005
Posts: 14
Default Re: Fedora 12 + multiple video cards + Xinerama + vga_arbitor is unusable

Can an nVidia dev comment on the necessity for the nvidia driver to opt out of vga arbitration if the interface is present in the kernel? It would be nice to have a patched version in rpmfusion that just works for us few Xinerama stragglers. AaronP?
underling is offline   Reply With Quote
Old 01-07-10, 05:44 PM   #5
zander
NVIDIA Corporation
 
zander's Avatar
 
Join Date: Aug 2002
Posts: 3,740
Default Re: Fedora 12 + multiple video cards + Xinerama + vga_arbitor is unusable

Yes, we believe this is currently necessary. Future driver releases will do this. We have a bug file to track additional work we believe to be beneficial and/or feel may be needed in the future.
zander is offline   Reply With Quote
Old 01-08-10, 05:39 AM   #6
leigh123linux
Registered User
 
leigh123linux's Avatar
 
Join Date: Feb 2008
Posts: 163
Default Re: Fedora 12 + multiple video cards + Xinerama + vga_arbitor is unusable

Quote:
Originally Posted by underling View Post
Can an nVidia dev comment on the necessity for the nvidia driver to opt out of vga arbitration if the interface is present in the kernel? It would be nice to have a patched version in rpmfusion that just works for us few Xinerama stragglers. AaronP?

There is a patched driver at rpmfusion, it is currently in the testing repo.

Quote:
%changelog
* Wed Dec 30 2009 Nicolas Chauvet <kwizart@fedoraproject.org> - 190.53-1
- Update to 190.53
- Add patch for VGA_ARB
http://download1.rpmfusion.org/nonfr...od-nvidia.html
leigh123linux is offline   Reply With Quote
Old 06-24-10, 11:14 AM   #7
Aquila2063
Registered User
 
Join Date: Jun 2010
Posts: 5
Default Re: Fedora 12 + multiple video cards + Xinerama + vga_arbitor is unusable

Greetings
Do the latest nvidia drivers contain these patches to the VGA arbiter? Any indication either way?

Thanks in advance.
Aquila2063 is offline   Reply With Quote
Old 06-28-10, 05:48 PM   #8
danix
NVIDIA Corporation
 
danix's Avatar
 
Join Date: Feb 2010
Location: Santa Clara, CA
Posts: 237
Default Re: Fedora 12 + multiple video cards + Xinerama + vga_arbitor is unusable

195.36.31 and 256.35 are both pre-patched, and should avoid this interaction with the VGA arbiter. If you are trying these versions, and still experiencing problems, you may be affected by another bug. Please start a new post and include an nvidia-bug-report.log.

To be clear, the patch to the driver does not patch the VGA arbiter. The VGA arbiter is part of the kernel and it currently behaves in a way that can break certain multi-GPU setups. We're working with the kernel VGA arbiter developers to fix this in the kernel; in the meantime, the patch to the driver works around the VGA arbiter's broken behavior.
danix is offline   Reply With Quote

Old 10-29-10, 08:19 AM   #9
petrovlucca
nVidia Driver
 
Join Date: Oct 2010
Location: USA
Posts: 4
Default Re: Fedora 12 + multiple video cards + Xinerama + vga_arbitor is unusable

Quote:
Originally Posted by underling View Post
Here is a new patch with appropriate macro shielding to only interact with the new vgaarb API when it's present:

Code:
*** usr/src/nv/nv-linux.h.orig	2009-11-22 19:27:38.000000000 -0800
--- usr/src/nv/nv-linux.h	2009-12-16 11:02:22.000000000 -0800
***************
*** 83,102 ****
--- 83,105 ----
  
  #if !defined(KERNEL_2_4)
  #include <linux/sched.h>            /* suser(), capable() replacement   */
  #include <linux/moduleparam.h>      /* module_param()                   */
  #include <linux/smp_lock.h>         /* kernel_locked                    */
  #include <asm/tlbflush.h>           /* flush_tlb(), flush_tlb_all()     */
  #include <asm/kmap_types.h>         /* page table entry lookup          */
  #endif
  
  #include <linux/pci.h>              /* pci_find_class, etc              */
+ #if defined(CONFIG_VGA_ARB)
+ #include <linux/vgaarb.h>           /* vga_set_legacy_decoding          */
+ #endif
  #include <linux/interrupt.h>        /* tasklets, interrupt helpers      */
  #include <linux/timer.h>
  
  #include <asm/div64.h>              /* do_div()                         */
  #include <asm/system.h>             /* cli, sli, save_flags             */
  #include <asm/io.h>                 /* ioremap, virt_to_phys            */
  #include <asm/uaccess.h>            /* access_ok                        */
  #include <asm/page.h>               /* PAGE_OFFSET                      */
  #include <asm/pgtable.h>            /* pte bit definitions              */
  
*** usr/src/nv/nv.c.orig	2009-11-22 19:27:36.000000000 -0800
--- usr/src/nv/nv.c	2009-12-16 11:02:54.000000000 -0800
***************
*** 724,743 ****
--- 724,747 ----
                  goto failed;
              }
  
              entry->data = nv;
              entry->read_proc = nv_kern_read_agpinfo;
  #if defined(NV_PROC_DIR_ENTRY_HAS_OWNER)
              entry->owner = THIS_MODULE;
  #endif
          }
  
+ #if defined(CONFIG_VGA_ARB)
+         vga_set_legacy_decoding(dev, VGA_RSRC_NONE);
+ #endif
+ 
          NV_PCI_DEV_PUT(dev);
      }
  
      entry = create_proc_entry("version", flags, proc_nvidia);
      if (!entry)
          goto failed;
  
      entry->read_proc = nv_kern_read_version;
  #if defined(NV_PROC_DIR_ENTRY_HAS_OWNER)
      entry->owner = THIS_MODULE;
Thanks for the patch. It solve my problems. Everything is going nicely now.
petrovlucca is offline   Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 09:54 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 1998 - 2014, nV News.