From owner-freebsd-questions@FreeBSD.ORG Wed Dec 23 03:42:55 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8EE50106566B for ; Wed, 23 Dec 2009 03:42:55 +0000 (UTC) (envelope-from macerl@telkomsa.net) Received: from rrba-ip-smtp-1-3.saix.net (rrba-ip-smtp-1-3.saix.net [196.25.240.222]) by mx1.freebsd.org (Postfix) with ESMTP id 2774C8FC08 for ; Wed, 23 Dec 2009 03:42:54 +0000 (UTC) Received: from toutatis.localnet (dsl-242-93-13.telkomadsl.co.za [41.242.93.13]) by rrba-ip-smtp-1-3.saix.net (Postfix) with ESMTP id 4A9672101; Wed, 23 Dec 2009 05:42:51 +0200 (SAST) From: Richard Mace To: Pieter de Goeje Date: Wed, 23 Dec 2009 05:42:28 +0200 User-Agent: KMail/1.12.4 (FreeBSD/8.0-RELEASE; KDE/4.3.4; i386; ; ) References: <200912221736.20023.macerl@telkomsa.net> <20091222210051.GA6367@slackbox.xs4all.nl> <200912230320.29577.pieter@degoeje.nl> In-Reply-To: <200912230320.29577.pieter@degoeje.nl> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200912230542.28400.macerl@telkomsa.net> Cc: Roland Smith , freebsd-questions@freebsd.org, Roger Subject: Re: Help building/running SDL/OpenGL code X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2009 03:42:55 -0000 On Wednesday 23 December 2009 04:20:28 Pieter de Goeje wrote: > On Tuesday 22 December 2009 22:00:51 Roland Smith wrote: > > On Tue, Dec 22, 2009 at 09:57:57PM +0200, Richard Mace wrote: > > > In the end, as a last resort, I de-installed the nvidia driver and > > > started X with an empty /etc/X11/xorg.conf (which presumably loads the > > > "nv" driver). I re-built my code and it runs, albeit without the > > > smoothest of graphics. > > > > On a recent core2 duo or quad, even software rendering isn't that bad. > > True, until you press the full screen(s) button of your program running on > your dual 1920x1200 monitor setup like I do ;-) Suddenly you're watching a > slideshow... > > > > I guess that that proves that the problem lies with the NVIDIA driver > > > and its inter-relationship with the Mesa libraries, which one has to > > > use if one builds one's own "OpenGL" programs. > > > > Yes. > > Agreed. It's quite annoying that the nvidia drivers replace the existing > mesa GL libs, which breaks OpenGL when you switch back to mesa rendering. > However, because the library is implemented by nvidia for their hardware, > it is also blazingly fast. > > > > It is a pity that FreeBSD has not sorted that out, but I hasten to add > > > that I'm new to FBSD and it could be my error. What I meant here by "sort out" was that FreeBSD provide some way for Mesa libs and NVIDIA drivers to co-exist. It seems that you (as new user) have to learn, through error, that you need to install Mesa first, then NVIDIA (and whenever Mesa-related apps get an upgrade you need to re-install NVIDIA). Would be nice if these two ports could check for each other's existence before install and do the necessary to the libGL* symbolic links. > > It was nvidia's decision to drop support for older cards from their > > recent drivers. Nothing that the FreeBSD project can do about that. > > The oldest cards that the new drivers support are the GeForce 6xxx series, > which are over 5 years old. I'm not saying that I approve dropping support > but frankly I don't really care for 3D acceleration on graphics cards that > old. > > The latest nvidia drivers are actually built using a more recent version of > FreeBSD so you won't have that linking problem. Which is indeed the most > likely cause of the problem. I don't understand why glxgears does run and > your simulation does not though... I would've expected both too fail or > work. This is confusing to me, too, which led to the question immediately below. > > > It does beg the question, though, how one would develop OpenGL apps on > > > FBSD? I'll revisit this soon, after some careful googling. > > Personally I use a recent nvidia card with the latest nvidia drivers. This > has worked well for me, but I don't use SDL. My programs tend to use the > simple GLUT/GLU/GL combo or wxGTK/GLU/GL if I need more controls. Loading > textures is done using DevIL. Unfortunately my old GeForce 4 is broken so > I can't test the legacy drivers any more. > > > Get a card that is well-supported by the drivers in the FreeBSD kernel > > and Xorg/Mesa. Currently that means Intel's on-board graphics or boards > > with Well, right now I am "evaluating" FreeBSD on an "old" machine (Pentium IV, NVIDIA FX5200) to see whether I would make the switch from Debian GNU/Linux. I don't really want to purchase a new card for this purpose. Perhaps I will try to install FBSD on my laptop, which is dual-core and has an NVIDIA Quadro FX 570M on board. > > If you're going with intel you might as well use software rendering :-) I'd agree there ;-). > > ATI/AMD radeon chips, except for the latest chips. AMD released docs for > > those chips some months ago, and the drivers for accellerated 3D are > > still evolving. > > Yes, AMD's efforts are very commendable. > > > Accellerated 3D works fine on my Radeon X1650 equipped card with the > > xf86-video-ati driver and the drm.ko and radeon.ko kernel modules. > > > > Roland > Thanks to all for your help and suggestions. Incidentally, if there is anyone out there with newer hardware who is interested in building the code I am talking about you can find it at: http://physics.ukzn.ac.za/~richm/courses/phys110/lennard-jones-3d.html You'll need to change the following lines in the Makefile to get it to successfully build under FreeBSD: ================================================== CFLAGS = -Wall -Wextra -pthread -I/usr/local/include -I/usr/local/include/SDL -O3 -march=native LFLAGS = -Wall -L/usr/local/lib lennardjones : $(OBJS) $(CC) $(LFLAGS) -o lennardjones $(OBJS) -lSDL -lSDL_gfx -lGLU ================================================== It would be interesting to hear feedback. (Basic controls are: up-arrow add heat to crystal; down-arrow cool down gas/crystal. There are a bunch of others -- look in main.c). You are welcome to do whatever you wish with my code. -Richard