<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>alan.lamielle.net &#187; compile</title>
	<atom:link href="http://alan.lamielle.net/tags/compile/feed" rel="self" type="application/rss+xml" />
	<link>http://alan.lamielle.net</link>
	<description>Alan LaMielle</description>
	<lastBuildDate>Fri, 16 Sep 2011 16:50:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Installing nVidia driver 185.18.14 with real time linux kernel 2.6.28-3-rt</title>
		<link>http://alan.lamielle.net/2009/07/10/installing-nvidia-driver-185-18-14-with-real-time-linux-kernel-2-6-28-3-rt</link>
		<comments>http://alan.lamielle.net/2009/07/10/installing-nvidia-driver-185-18-14-with-real-time-linux-kernel-2-6-28-3-rt#comments</comments>
		<pubDate>Sat, 11 Jul 2009 00:50:28 +0000</pubDate>
		<dc:creator>Adam Labadorf</dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[amd]]></category>
		<category><![CDATA[amd64]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[driver]]></category>
		<category><![CDATA[grub]]></category>
		<category><![CDATA[jaunty]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[kubuntu]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[module]]></category>
		<category><![CDATA[nvidia]]></category>

		<guid isPermaLink="false">http://alan.lamielle.net/?p=302</guid>
		<description><![CDATA[This article discusses how to get the NVidia Linux graphics driver working with the real time linux kernel version 2.6.28-rt under Ubuntu (Kubuntu) 9.04 on AMD 64. DISCLAIMER:I have no idea if what I have here is a good idea beyond the fact that my video card is working properly under linux-rt.  My computer froze [...]]]></description>
			<content:encoded><![CDATA[<p>This article discusses how to get the NVidia Linux graphics driver working with the real time linux kernel version 2.6.28-rt under Ubuntu (Kubuntu) 9.04 on AMD 64.</p>
<p><span id="more-302"></span><strong>DISCLAIMER:</strong>I have no idea if what I have here is a good idea beyond the fact that my video card is working properly under linux-rt.  My computer froze a couple times with the following setup but I&#8217;m not sure if it&#8217;s the fix or the fact that linux-rt apparently doesn&#8217;t play well with multiple core machines.  Or the computer freezy gnomes.  Whatever.  Use at your own risk.</p>
<p>I&#8217;m running Kubuntu 9.04 on AMD64.</p>
<p>While setting up my linux audio recording setup on Kubuntu 9.04 I installed the linux-rt meta-package (which right now points to linux-2.6.28-3-rt) for real time process scheduling.  I was dismayed and not at all surprised that the proprietary nVidia driver for my GeForce 7950  GT did not work immediately when I booted up out of GRUB with the new kernel.  So, I downloaded the latest nVidia driver from <a title="http://www.nvidia.com/object/linux_display_amd64_185.18.14.html" href="http://www.nvidia.com/object/linux_display_amd64_185.18.14.html" target="aaaaaa">http://www.nvidia.com/object/linux_display_amd64_185.18.14.html</a> and tried to install as I have to do every time there is a new linux kernel update by running this with the downloaded script:</p>
<p><code>$&gt; sudo sh NVIDIA-Linux-x86_64-185.18.14-pkg2.run</code></p>
<p>The script informs you that it needs to compile the kernel module as usual, but dies saying compilation was unsuccessful.  Following the advice of some forum posts I found, I extracted the script into its source tree with:</p>
<p><code>$&gt; sudo sh NVIDIA-Linux-x86_64-185.18.14-pkg2.run -x</code></p>
<p>which creates a directory with a script <code>nvidia-installer.sh</code> and the source tree.  I ran the installer manually with:<br />
<code><br />
$&gt; cd  NVIDIA-Linux-x86_64-185.18.14-pkg2<br />
$&gt; sudo ./nvidia-installer<br />
</code></p>
<p>Compilation fails again at the same step.  Inspecting <code>/var/log/nvidia-installer.log</code> tells us:</p>
<p><code>/home/labadorf/video_drivers/NVIDIA-Linux-x86_64-185.18.14-pkg2/usr/src/nv/os-interface.c:130: error: incompatible types in assignment</code></p>
<p>After poking around some forums there were some suggestions about replacing some SEMAPHORE code in certain driver source files, but they were for the wrong driver version (177) and didn&#8217;t work. Alright, well I have the source for both the kernel and driver, I thought, so let&#8217;s see what this incompatible type assignment is.  At the end of the day, I traced the error to a couple lines of code earlier in <code>usr/src/nv/os-interface.c</code>.  Apparently, the driver is trying to pass some <code>raw_spinlock_t</code> kernel struct to a function that can only accept <code>spinlock_t</code> structs when it detects you&#8217;re using a real time kernel.  So, I thought a little commenting might do the trick&#8230;</p>
<p>Original <code>os-interface.c</code> source:</p>
<p><code><br />
86 typedef struct os_sema_s<br />
87 {<br />
88     nv_stack_t        *sp;<br />
89     struct completion  completion;<br />
90 #if defined(CONFIG_PREEMPT_RT)<br />
91     raw_spinlock_t     lock;<br />
92 #else<br />
93     spinlock_t         lock;<br />
94 #endif<br />
95     S032               count;<br />
96 } os_sema_t;<br />
97<br />
</code></p>
<p>Modified code:<br />
<code><br />
86 typedef struct os_sema_s<br />
87 {<br />
88     nv_stack_t        *sp;<br />
89     struct completion  completion;<br />
90 //#if defined(CONFIG_PREEMPT_RT)<br />
91 //    raw_spinlock_t     lock;<br />
92 //#else<br />
93     spinlock_t         lock;<br />
94 //#endif<br />
95     S032               count;<br />
96 } os_sema_t;<br />
97<br />
</code></p>
<p>Lo and behold, on recompiling the driver everything works fine.  Now, I suppose there may have been a good reason to use the raw version of the struct, but I got all of my audio stuff running with much lower latency AND using both monitors on high resolution (which is really handy since some of these audio apps take up a lot of screen real estate).  There are a couple bugs open on this issue so I didn&#8217;t feel the need to post anything (though none of the comments there helped with my problem), hopefully someone will figure out what the problem is and fix it soon.</p>
<p><strong>Note:</strong> By default the installer replaces whatever driver you have with the new one.  You <em>have</em> to unpack the driver source and use the installer manually if you want to use different kernels and not recompile the driver every time.  Look at <a href="http://meandubuntu.wordpress.com/2008/07/17/install-nvidia-17713-drivers-on-realtime-kernel/" target="aaaaa">this post</a> and specifically Switcher&#8217;s comment 12 for instructions on how to do that.</p>
<p>Like I said, the commenting out I&#8217;ve done may be a terrible, terrible idea, but as I know nothing about graphics drivers and even less about kernel building I&#8217;m playing the ignorant fool.  Good luck.</p>
]]></content:encoded>
			<wfw:commentRss>http://alan.lamielle.net/2009/07/10/installing-nvidia-driver-185-18-14-with-real-time-linux-kernel-2-6-28-3-rt/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

