nVidia and Xen under Fedora 7

Msquared sub1.freshrpms.xenvidia at msquared.id.au
Tue Oct 16 12:52:46 CEST 2007


Hi!

I know Xen is officially not supported by nVidia, but I can't even get to
the point of building the thing!  I encounter a number of small problems
that I can work around, then another that I'm not sure how to tackle:
getting GCC to use the files in include/asm-i386/mach-xen.  I think this
is the core of the problem that I am experiencing.


In case it helps, here's what I've done so far:

  * Install kernel-xen-devel: yum -y install kernel-xen-devel
  * Download nVidia 100.14.19 package
  * Extract package
  * Attempt to build: make module

At first, the build system can't detect the kernel version.  The following
patch fixes that:

--- nv-orig/conftest.sh 2007-09-13 05:49:01.000000000 +0800
+++ nv/conftest.sh      2007-10-16 17:25:28.000000000 +0800
@@ -303,7 +303,6 @@
             #
             echo "#include <linux/autoconf.h>
             #include <linux/version.h>
-            #include <linux/utsname.h>
             int main() {
               if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) {
                 return 0;


Next, try make with the Xen sanity check off:

  IGNORE_XEN_PRESENCE=1 make module


Now, it complains that pm_message_t is defined twice (see
nvidia-build-errors-001.txt).  Turns out, the pm_message_t test in
conftest.sh is not working properly.

That test builds a simple C program to test for pm_message_t.  For some
reason, it's failing to build (see nvidia-build-errors-002.txt).

At this point, I think I need to work out how to get the C compiler to
look for files in mach-xen/asm, as that test is trying to include
synch_bitops.h and hypervisor.h, which only reside in that folder.

I tried to work around it by explicitly telling the build system that it's
OK, with:

  IGNORE_XEN_PRESENCE=1 NV_PM_MESSAGE_T=1 make module

The failure occurred at include/asm/elf.h, which I think might depend on
mach-xxx (in this case, mach-xen).  There were also many other warnings.
See nvidia-build-errors-003.txt.

At this point I'm giving up, because it seems that whatever is causing the
compiler to fail to include he right files will just cause endless grief
until I solve it.  I even tried to copy asm-i386/mach-xen/asm/*.h to
asm-i386, but that didn't work.  It made some errors go away, but not all
of them.

Going back to the first problem I found (unable to determine kernel
version), I discovered similar problems with synch_bitops.h and
hypervisor.h (see nvidia-build-errors-004.txt), so I assume it's all
related.


Any ideas?

Regards, Msquared...
-------------- next part --------------
[root at neuromancer nv]# IGNORE_XEN_PRESENCE=1 make module
sh ./conftest.sh "cc" "cc" /lib/modules/2.6.20-2936.fc7xen/source /lib/modules/2.6.20-2936.fc7xen/build cc_sanity_check full_output
sh ./conftest.sh "cc" "cc" /lib/modules/2.6.20-2936.fc7xen/source /lib/modules/2.6.20-2936.fc7xen/build select_makefile full_output
make --no-print-directory -f Makefile module

NVIDIA: calling KBUILD...
make CC=cc KBUILD_OUTPUT=/lib/modules/2.6.20-2936.fc7xen/build KBUILD_VERBOSE=1 -C /lib/modules/2.6.20-2936.fc7xen/source SUBDIRS=/root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv modules
make -C /lib/modules/2.6.20-2936.fc7xen/build \
        KBUILD_SRC=/usr/src/kernels/2.6.20-2936.fc7-xen-i686 \
        KBUILD_EXTMOD="/root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv" -f /usr/src/kernels/2.6.20-2936.fc7-xen-i686/Makefile modules
test -e include/linux/autoconf.h -a -e include/config/auto.conf || (            \
        echo;                                                           \
        echo "  ERROR: Kernel configuration is invalid.";               \
        echo "         include/linux/autoconf.h or include/config/auto.conf are missing.";      \
        echo "         Run 'make oldconfig && make prepare' on kernel src to fix it.";  \
        echo;                                                           \
        /bin/false)
mkdir -p /root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv/.tmp_versions
rm -f /root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv/.tmp_versions/*
make -f /usr/src/kernels/2.6.20-2936.fc7-xen-i686/scripts/Makefile.build obj=/root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv
  cc -Wp,-MD,/root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv/.nv.o.d  -nostdinc -isystem /usr/lib/gcc/i386-redhat-linux/4.1.2/include -Iinclude2/asm/mach-xen -D__KERNEL__ -Iinclude -Iinclude2 -I/usr/src/kernels/2.6.20-2936.fc7-xen-i686/include -include include/linux/autoconf.h -D__XEN_INTERFACE_VERSION__=0x00030205  -I/root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Wstrict-prototypes -Wundef -Werror-implicit-function-declaration -Os -pipe -msoft-float -mregparm=3 -mpreferred-stack-boundary=2 -march=i686 -mtune=generic -mtune=generic -ffreestanding -maccumulate-outgoing-args -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -I/usr/src/kernels/2.6.20-2936.fc7-xen-i686/include/asm-i386/mach-xen -Iinclude/asm-i386/mach-xen -I/usr/src/kernels/2.6.20-2936.fc7-xen-i686/include/asm-i386/mach-default -Iinclude/asm-i386/mach-default -fno-omit-frame-pointer -fno-optimize-sibling-calls -g -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign  -I/root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv -Wall -Wimplicit -Wreturn-type -Wswitch -Wformat -Wchar-subscripts -Wparentheses -Wpointer-arith -Wno-multichar -Werror -MD -Wsign-compare -Wno-cast-qual -Wno-error -D_LOOSE_KERNEL_NAMES -D__KERNEL__ -DMODULE -DNVRM -DNV_VERSION_STRING=\"100.14.19\" -UDEBUG -U_DEBUG -DNDEBUG -DNV_MULTIPLE_BRIDGE_AGPGART_PRESENT -DNV_PCI_GET_CLASS_PRESENT -DNV_IRQ_HANDLER_WITH_PTREGS_PRESENT -DNV_PCI_CHOOSE_STATE_PRESENT -DNV_VM_INSERT_PAGE_PRESENT -DNV_OLD_MM_KGDB_BREAKPOINT_PRESENT -DNV_ACQUIRE_CONSOLE_SEM_PRESENT -DNV_REMAP_PFN_RANGE_PRESENT -DNV_CHANGE_PAGE_ATTR_PRESENT -DMODULE -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(nv)"  -D"KBUILD_MODNAME=KBUILD_STR(nvidia)" -c -o /root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv/.tmp_nv.o /root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv/nv.c
In file included from /root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv/nv.c:14:
/root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv/nv-linux.h:546:2: warning: #warning "conftest.sh failed, assuming kmem_cache_create(6)!"
In file included from include/linux/list.h:9,
                 from include/linux/lockdep.h:17,
                 from include/linux/spinlock_types.h:13,
                 from include/linux/spinlock.h:80,
                 from include/linux/capability.h:46,
                 from include/linux/sched.h:47,
                 from include/linux/utsname.h:36,
                 from /root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv/nv-linux.h:20,
                 from /root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv/nv.c:15:
include/linux/prefetch.h: In function ?prefetch_range?:
include/linux/prefetch.h:62: warning: pointer of type ?void *? used in arithmetic
In file included from include/asm/smp.h:17,
                 from include/linux/smp.h:19,
                 from include/linux/sched.h:66,
                 from include/linux/utsname.h:36,
                 from /root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv/nv-linux.h:20,
                 from /root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv/nv.c:15:
include/asm/fixmap.h: At top level:
include/asm/fixmap.h:110: error: expected declaration specifiers or ?...? before ?maddr_t?
In file included from include/asm/elf.h:53,
                 from include/linux/elf.h:8,
                 from include/linux/module.h:16,
                 from /root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv/nv-linux.h:52,
                 from /root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv/nv.c:15:
include/asm/desc.h: In function ?load_TLS?:
include/asm/desc.h:84: error: implicit declaration of function ?virt_to_machine?
In file included from /root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv/nv-linux.h:104,
                 from /root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv/nv.c:15:
/usr/src/kernels/2.6.20-2936.fc7-xen-i686/include/asm-i386/mach-xen/asm/maddr.h: In function ?pte_phys_to_machine?:
/usr/src/kernels/2.6.20-2936.fc7-xen-i686/include/asm-i386/mach-xen/asm/maddr.h:138: error: ?PHYSICAL_PAGE_MASK? undeclared (first use in this function)
/usr/src/kernels/2.6.20-2936.fc7-xen-i686/include/asm-i386/mach-xen/asm/maddr.h:138: error: (Each undeclared identifier is reported only once
/usr/src/kernels/2.6.20-2936.fc7-xen-i686/include/asm-i386/mach-xen/asm/maddr.h:138: error: for each function it appears in.)
/usr/src/kernels/2.6.20-2936.fc7-xen-i686/include/asm-i386/mach-xen/asm/maddr.h: In function ?pte_machine_to_phys?:
/usr/src/kernels/2.6.20-2936.fc7-xen-i686/include/asm-i386/mach-xen/asm/maddr.h:151: error: ?PHYSICAL_PAGE_MASK? undeclared (first use in this function)
In file included from /root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv/nv.c:15:
/root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv/nv-linux.h: At top level:
/root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv/nv-linux.h:802: error: conflicting types for ?pm_message_t?
include/linux/pm.h:144: error: previous declaration of ?pm_message_t? was here
/root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv/nv.c: In function ?nv_kern_open?:
/root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv/nv.c:1993: warning: passing argument 2 of ?request_irq? from incompatible pointer type
make[4]: *** [/root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv/nv.o] Error 1
make[3]: *** [_module_/root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv] Error 2
make[2]: *** [modules] Error 2
NVIDIA: left KBUILD.
nvidia.ko failed to build!
make[1]: *** [module] Error 1
make: *** [module] Error 2
-------------- next part --------------
In file included from /lib/modules/2.6.20-2936.fc7xen/build/include/asm/processor.h:18,
                 from /lib/modules/2.6.20-2936.fc7xen/build/include/linux/prefetch.h:14,
                 from /lib/modules/2.6.20-2936.fc7xen/build/include/linux/list.h:8,
                 from /lib/modules/2.6.20-2936.fc7xen/build/include/linux/pm.h:26,
                 from conftest6849.c:2:
/lib/modules/2.6.20-2936.fc7xen/build/include/asm/system.h:9:30: error: asm/synch_bitops.h: No such file or directory
/lib/modules/2.6.20-2936.fc7xen/build/include/asm/system.h:10:28: error: asm/hypervisor.h: No such file or directory
-------------- next part --------------
sh ./conftest.sh "cc" "cc" /lib/modules/2.6.20-2936.fc7xen/source /lib/modules/2.6.20-2936.fc7xen/build cc_sanity_check full_output
sh ./conftest.sh "cc" "cc" /lib/modules/2.6.20-2936.fc7xen/source /lib/modules/2.6.20-2936.fc7xen/build select_makefile full_output
make --no-print-directory -f Makefile module

NVIDIA: calling KBUILD...
make CC=cc KBUILD_OUTPUT=/lib/modules/2.6.20-2936.fc7xen/build KBUILD_VERBOSE=1 -C /lib/modules/2.6.20-2936.fc7xen/source SUBDIRS=/root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv modules
make -C /lib/modules/2.6.20-2936.fc7xen/build \
        KBUILD_SRC=/usr/src/kernels/2.6.20-2936.fc7-xen-i686 \
        KBUILD_EXTMOD="/root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv" -f /usr/src/kernels/2.6.20-2936.fc7-xen-i686/Makefile modules
test -e include/linux/autoconf.h -a -e include/config/auto.conf || (            \
        echo;                                                           \
        echo "  ERROR: Kernel configuration is invalid.";               \
        echo "         include/linux/autoconf.h or include/config/auto.conf are missing.";      \
        echo "         Run 'make oldconfig && make prepare' on kernel src to fix it.";  \
        echo;                                                           \
        /bin/false)
mkdir -p /root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv/.tmp_versions
rm -f /root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv/.tmp_versions/*
make -f /usr/src/kernels/2.6.20-2936.fc7-xen-i686/scripts/Makefile.build obj=/root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv
  cc -Wp,-MD,/root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv/.nv.o.d  -nostdinc -isystem /usr/lib/gcc/i386-redhat-linux/4.1.2/include -Iinclude2/asm/mach-xen -D__KERNEL__ -Iinclude -Iinclude2 -I/usr/src/kernels/2.6.20-2936.fc7-xen-i686/include -include include/linux/autoconf.h -D__XEN_INTERFACE_VERSION__=0x00030205  -I/root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Wstrict-prototypes -Wundef -Werror-implicit-function-declaration -Os -pipe -msoft-float -mregparm=3 -mpreferred-stack-boundary=2 -march=i686 -mtune=generic -mtune=generic -ffreestanding -maccumulate-outgoing-args -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -I/usr/src/kernels/2.6.20-2936.fc7-xen-i686/include/asm-i386/mach-xen -Iinclude/asm-i386/mach-xen -I/usr/src/kernels/2.6.20-2936.fc7-xen-i686/include/asm-i386/mach-default -Iinclude/asm-i386/mach-default -fno-omit-frame-pointer -fno-optimize-sibling-calls -g -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign  -I/root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv -Wall -Wimplicit -Wreturn-type -Wswitch -Wformat -Wchar-subscripts -Wparentheses -Wpointer-arith -Wno-multichar -Werror -MD -Wsign-compare -Wno-cast-qual -Wno-error -D_LOOSE_KERNEL_NAMES -D__KERNEL__ -DMODULE -DNVRM -DNV_VERSION_STRING=\"100.14.19\" -UDEBUG -U_DEBUG -DNDEBUG -DNV_MULTIPLE_BRIDGE_AGPGART_PRESENT -DNV_PCI_GET_CLASS_PRESENT -DNV_IRQ_HANDLER_WITH_PTREGS_PRESENT -DNV_PCI_CHOOSE_STATE_PRESENT -DNV_VM_INSERT_PAGE_PRESENT -DNV_OLD_MM_KGDB_BREAKPOINT_PRESENT -DNV_ACQUIRE_CONSOLE_SEM_PRESENT -DNV_REMAP_PFN_RANGE_PRESENT -DNV_CHANGE_PAGE_ATTR_PRESENT -DMODULE -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(nv)"  -D"KBUILD_MODNAME=KBUILD_STR(nvidia)" -c -o /root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv/.tmp_nv.o /root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv/nv.c
In file included from /root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv/nv.c:14:
/root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv/nv-linux.h:546:2: warning: #warning "conftest.sh failed, assuming kmem_cache_create(6)!"
In file included from include/linux/list.h:9,
                 from include/linux/lockdep.h:17,
                 from include/linux/spinlock_types.h:13,
                 from include/linux/spinlock.h:80,
                 from include/linux/capability.h:46,
                 from include/linux/sched.h:47,
                 from include/linux/utsname.h:36,
                 from /root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv/nv-linux.h:20,
                 from /root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv/nv.c:15:
include/linux/prefetch.h: In function ?prefetch_range?:
include/linux/prefetch.h:62: warning: pointer of type ?void *? used in arithmetic
In file included from include/asm/smp.h:17,
                 from include/linux/smp.h:19,
                 from include/linux/sched.h:66,
                 from include/linux/utsname.h:36,
                 from /root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv/nv-linux.h:20,
                 from /root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv/nv.c:15:
include/asm/fixmap.h: At top level:
include/asm/fixmap.h:110: error: expected declaration specifiers or ?...? before ?maddr_t?
In file included from include/asm/elf.h:53,
                 from include/linux/elf.h:8,
                 from include/linux/module.h:16,
                 from /root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv/nv-linux.h:52,
                 from /root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv/nv.c:15:
include/asm/desc.h: In function ?load_TLS?:
include/asm/desc.h:84: error: implicit declaration of function ?virt_to_machine?
In file included from /root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv/nv-linux.h:104,
                 from /root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv/nv.c:15:
/usr/src/kernels/2.6.20-2936.fc7-xen-i686/include/asm-i386/mach-xen/asm/maddr.h: In function ?pte_phys_to_machine?:
/usr/src/kernels/2.6.20-2936.fc7-xen-i686/include/asm-i386/mach-xen/asm/maddr.h:138: error: ?PHYSICAL_PAGE_MASK? undeclared (first use in this function)
/usr/src/kernels/2.6.20-2936.fc7-xen-i686/include/asm-i386/mach-xen/asm/maddr.h:138: error: (Each undeclared identifier is reported only once
/usr/src/kernels/2.6.20-2936.fc7-xen-i686/include/asm-i386/mach-xen/asm/maddr.h:138: error: for each function it appears in.)
/usr/src/kernels/2.6.20-2936.fc7-xen-i686/include/asm-i386/mach-xen/asm/maddr.h: In function ?pte_machine_to_phys?:
/usr/src/kernels/2.6.20-2936.fc7-xen-i686/include/asm-i386/mach-xen/asm/maddr.h:151: error: ?PHYSICAL_PAGE_MASK? undeclared (first use in this function)
In file included from /root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv/nv.c:15:
/root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv/nv-linux.h: At top level:
/root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv/nv-linux.h:802: error: conflicting types for ?pm_message_t?
include/linux/pm.h:144: error: previous declaration of ?pm_message_t? was here
/root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv/nv.c: In function ?nv_kern_open?:
/root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv/nv.c:1993: warning: passing argument 2 of ?request_irq? from incompatible pointer type
make[4]: *** [/root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv/nv.o] Error 1
make[3]: *** [_module_/root/Download/NVIDIA-Linux-x86-100.14.19-pkg1/usr/src/nv] Error 2
make[2]: *** [modules] Error 2
NVIDIA: left KBUILD.
nvidia.ko failed to build!
make[1]: *** [module] Error 1
make: *** [module] Error 2
-------------- next part --------------
In file included from /lib/modules/2.6.20-2936.fc7xen/build/include/asm/processor.h:18,
                 from /lib/modules/2.6.20-2936.fc7xen/build/include/asm/thread_info.h:16,
                 from /lib/modules/2.6.20-2936.fc7xen/build/include/linux/thread_info.h:21,
                 from /lib/modules/2.6.20-2936.fc7xen/build/include/linux/preempt.h:9,
                 from /lib/modules/2.6.20-2936.fc7xen/build/include/linux/spinlock.h:49,
                 from /lib/modules/2.6.20-2936.fc7xen/build/include/linux/capability.h:45,
                 from /lib/modules/2.6.20-2936.fc7xen/build/include/linux/sched.h:46,
                 from /lib/modules/2.6.20-2936.fc7xen/build/include/linux/utsname.h:35,
                 from conftest8376.c:3:
/lib/modules/2.6.20-2936.fc7xen/build/include/asm/system.h:9:30: error: asm/synch_bitops.h: No such file or directory
/lib/modules/2.6.20-2936.fc7xen/build/include/asm/system.h:10:28: error: asm/hypervisor.h: No such file or directory
In file included from /lib/modules/2.6.20-2936.fc7xen/build/include/asm/smp.h:16,
                 from /lib/modules/2.6.20-2936.fc7xen/build/include/linux/smp.h:18,
                 from /lib/modules/2.6.20-2936.fc7xen/build/include/linux/sched.h:65,
                 from /lib/modules/2.6.20-2936.fc7xen/build/include/linux/utsname.h:35,
                 from conftest8376.c:3:
/lib/modules/2.6.20-2936.fc7xen/build/include/asm/fixmap.h:110: error: expected declaration specifiers or ?...? before ?maddr_t?


More information about the freshrpms-list mailing list