20
Friday, October 25, 2002 BRL-CAD Users Group Meeting 2002 Mac OS X Mac OS X & & Christopher Sean Morrison Christopher Sean Morrison [email protected] [email protected] Quantum Research International, Inc.

Christopher Sean Morrison [email protected]

Embed Size (px)

DESCRIPTION

Christopher Sean Morrison [email protected]. Quantum Research International, Inc. BRL-CAD & Mac OS X. Topics: Apple Computer, Inc’s new platform Architecture considerations BRL-CAD and UNIX The actual port to Mac OS X Performance issues Future direction. Apple Computer, Inc. - PowerPoint PPT Presentation

Citation preview

Page 1: Christopher Sean Morrison morrison@arl.army.mil

Friday, October 25, 2002BRL-CAD Users Group Meeting 2002

Mac OS XMac OS X&&

Christopher Sean MorrisonChristopher Sean [email protected]@arl.army.mil

Quantum Research International, Inc.

Page 2: Christopher Sean Morrison morrison@arl.army.mil

BRL-CAD Users Group Meeting 2002 2

BRL-CAD & Mac OS X

Topics:Topics:

• Apple Computer, Inc’s new platformApple Computer, Inc’s new platform

• Architecture considerationsArchitecture considerations

• BRL-CAD and UNIXBRL-CAD and UNIX

• The actual port to Mac OS XThe actual port to Mac OS X

• Performance issuesPerformance issues

• Future directionFuture direction

Page 3: Christopher Sean Morrison morrison@arl.army.mil

BRL-CAD Users Group Meeting 2002 3

Apple Computer, Inc.

““Mac OS X is a modern Mac OS X is a modern operating system that combines operating system that combines the power and stability of UNIX the power and stability of UNIX with the simplicity and elegance with the simplicity and elegance of the Macintosh.”of the Macintosh.”

QuickTime™ and aTIFF (Uncompressed) decompressorare needed to see this picture.

Apple is the largest UNIX-based Apple is the largest UNIX-based platform vendor on the planet. platform vendor on the planet.

QuickTime™ and aTIFF (Uncompressed) decompressorare needed to see this picture.

Page 4: Christopher Sean Morrison morrison@arl.army.mil

BRL-CAD Users Group Meeting 2002 4

Mac OS X• New BSD-based operating systemNew BSD-based operating system• Open-source kernel (Darwin), some Open-source kernel (Darwin), some

libraries and APIs as welllibraries and APIs as well• Standards complianceStandards compliance

– OpenGL, POSIX, MPEG4, Java2, IPv6, OpenGL, POSIX, MPEG4, Java2, IPv6, LDAPv3, IPSec, SSL, SSH2, …LDAPv3, IPSec, SSL, SSH2, …

• Interoperability with Windows and UNIXInteroperability with Windows and UNIX• Popular commercial software availablePopular commercial software available

– Word, Excel, PowerPoint, Internet Explorer, Word, Excel, PowerPoint, Internet Explorer, Photoshop, Mathematica, Pagemaker, Photoshop, Mathematica, Pagemaker, InDesign, …InDesign, …

Page 5: Christopher Sean Morrison morrison@arl.army.mil

BRL-CAD Users Group Meeting 2002 5

Multiprocessing & More

• Symmetric Symmetric multiprocessing multiprocessing architecture architecture availableavailable

• Altivec vector Altivec vector pipeline (aka pipeline (aka Velocity Velocity EngineEngineTMTM))

QuickTime™ and aTIFF (Uncompressed) decompressorare needed to see this picture.

Page 6: Christopher Sean Morrison morrison@arl.army.mil

BRL-CAD Users Group Meeting 2002 6

Darwin• Core open-source operating systemCore open-source operating system• X Server supportX Server support

– Xdarwin and XonXXdarwin and XonX

• POSIX standard compliance supportedPOSIX standard compliance supported– Threading (POSIX and Mach threads available)Threading (POSIX and Mach threads available)

– ShellShell

– sysctl interfacesysctl interface

• OpenGL supportOpenGL support– hardware accellerated, double-buffered windows, per-hardware accellerated, double-buffered windows, per-

pixel alpha channel & fade control, and more…pixel alpha channel & fade control, and more…

– Quartz extremeQuartz extreme

QuickTime™ and aTIFF (Uncompressed) decompressorare needed to see this picture.

Page 7: Christopher Sean Morrison morrison@arl.army.mil

BRL-CAD Users Group Meeting 2002 7

Darwin

QuickTime™ and aTIFF (Uncompressed) decompressorare needed to see this picture.

Page 8: Christopher Sean Morrison morrison@arl.army.mil

BRL-CAD Users Group Meeting 2002 8

BRL-CAD & UNIX

• BRL-CAD is designed to work best in a BRL-CAD is designed to work best in a UNIX-based environmentUNIX-based environment

• ManyMany compact and well-defined tools that compact and well-defined tools that perform particular tasksperform particular tasks

• Presently Presently 397397 tools, utilities, commands, … tools, utilities, commands, …

• Commands may be chained together for Commands may be chained together for flexible usageflexible usage

Page 9: Christopher Sean Morrison morrison@arl.army.mil

BRL-CAD Users Group Meeting 2002 9

Why Mac OS X?• Open standards complianceOpen standards compliance• It is UNIX basedIt is UNIX based

– It has a POSIX command line interface and toolsIt has a POSIX command line interface and tools

• Apple has a respectable history of reliability and Apple has a respectable history of reliability and “good design” in both software and hardware“good design” in both software and hardware

QuickTime™ and aTIFF (LZW) decompressorare needed to see this picture.

• It’s the largest UNIX-based platformIt’s the largest UNIX-based platform

• It runs Microsoft Office, It runs Microsoft Office, Photoshop, Mathematica, …Photoshop, Mathematica, …

Page 10: Christopher Sean Morrison morrison@arl.army.mil

BRL-CAD Users Group Meeting 2002 10

The Port• Bulk of work (90%) was done in less than Bulk of work (90%) was done in less than

half an hourhalf an hour• Iterative and incremental approachIterative and incremental approach• Files modified:Files modified:

– sh/machinetype.shsh/machinetype.sh– Cakefile.defsCakefile.defs– h/conf.hh/conf.h– h/machine.hh/machine.h– libbu/parallel.clibbu/parallel.c– libfb/…libfb/…– libdm/…libdm/…

Page 11: Christopher Sean Morrison morrison@arl.army.mil

BRL-CAD Users Group Meeting 2002 11

Iterative and Incremental Process

• Get Get sh/machinetype.shsh/machinetype.sh to work to work

• Run Run setup.shsetup.sh successfully successfully– Get Get cakecake to work to work

• Stub a base configuration into Stub a base configuration into Cakefile.defsCakefile.defs

• Add architecture details to Add architecture details to h/machine.hh/machine.h

• Compile, modify Compile, modify h/conf.hh/conf.h, and repeat … , and repeat … until all errors and (most) warnings are until all errors and (most) warnings are eliminatedeliminated

Page 12: Christopher Sean Morrison morrison@arl.army.mil

BRL-CAD Users Group Meeting 2002 12

Problems Encountered

• Adding the architecture piece-wise unveiled Adding the architecture piece-wise unveiled assumptions and dependancies that were not assumptions and dependancies that were not expectedexpected– E.g. X Windows support on UNIXE.g. X Windows support on UNIX

• Subtle bugs (some nasty) that were not Subtle bugs (some nasty) that were not evident on other platforms emergedevident on other platforms emerged

• Those problems have been fixedThose problems have been fixed

Page 13: Christopher Sean Morrison morrison@arl.army.mil

BRL-CAD Users Group Meeting 2002 13

Extra Functionality Needed

• Get multiple processor support (SMP) Get multiple processor support (SMP) workingworking– Modified Modified bu_avail_cpus()bu_avail_cpus() in in libbu/parallel.clibbu/parallel.c

• Get more than a debug framebuffer and Get more than a debug framebuffer and display managerdisplay manager– Add interface in libfb and libdmAdd interface in libfb and libdm– Add X Windows supportAdd X Windows support– Add OpenGL supportAdd OpenGL support

• Other ideas for later …Other ideas for later …

Page 14: Christopher Sean Morrison morrison@arl.army.mil

BRL-CAD Users Group Meeting 2002 14

Performance• Running the BRL-CAD benchmarkRunning the BRL-CAD benchmark

– bench/run.shbench/run.sh actually runs the test actually runs the test• results stored in the file named “results stored in the file named “summarysummary””

– bench/try.shbench/try.sh invokes the benchmark run interactively, invokes the benchmark run interactively, opening up a window per imageopening up a window per image

• For the time being, you will need X Windows to be installedFor the time being, you will need X Windows to be installed

• Interpreting the resultsInterpreting the results– Apple has done impressive optimizationsApple has done impressive optimizations

• Uses the open source GNU Compiler Collection (GCC 3.1)Uses the open source GNU Compiler Collection (GCC 3.1)

– The hardware takes significant advantage of L2 cache The hardware takes significant advantage of L2 cache availableavailable

• G4 500’s have 1MB unified L2 per chipG4 500’s have 1MB unified L2 per chip

• G4 800 and 1000’s have 256KB L2 and 1MB L3G4 800 and 1000’s have 256KB L2 and 1MB L3

Page 15: Christopher Sean Morrison morrison@arl.army.mil

BRL-CAD Users Group Meeting 2002 15

Benchmark Results

0

20000

40000

60000

80000

100000

average rays/second (rtfm)G4 500 36354 36177 36495 36631 36525Dual G4 500 83633 83100 82675 82905 83169G4 800 40722 40430 40490 40456 40440

Page 16: Christopher Sean Morrison morrison@arl.army.mil

BRL-CAD Users Group Meeting 2002 16

Demo

Page 17: Christopher Sean Morrison morrison@arl.army.mil

BRL-CAD Users Group Meeting 2002 17

Comparison to Linux on PPC

• Yellow Dog Linux 2.3 with default install Yellow Dog Linux 2.3 with default install gave approximately 25% slower runtime gave approximately 25% slower runtime performanceperformance

• Compiles significantly faster than DarwinCompiles significantly faster than Darwin– 25 minutes as opposed to 1.5 hours25 minutes as opposed to 1.5 hours

• Hints that Apple has better compiler Hints that Apple has better compiler optimizations and perhaps better run-time optimizations and perhaps better run-time librarieslibraries

Page 18: Christopher Sean Morrison morrison@arl.army.mil

BRL-CAD Users Group Meeting 2002 18

Future work

• Use Project Builder compilation Use Project Builder compilation environment coupled with GNU’s autotoolsenvironment coupled with GNU’s autotools

• Integrate Altivec vector pipeline support Integrate Altivec vector pipeline support into math operationsinto math operations

• Relinquish dependancy on XRelinquish dependancy on X – Create libfb and libdm interface for AquaCreate libfb and libdm interface for Aqua– Use AquaTkUse AquaTk

Page 19: Christopher Sean Morrison morrison@arl.army.mil

BRL-CAD Users Group Meeting 2002 19

Use Aqua Interface

QuickTime™ and aTIFF (Uncompressed) decompressorare needed to see this picture.

Page 20: Christopher Sean Morrison morrison@arl.army.mil

BRL-CAD Users Group Meeting 2002 20

QuickTime™ and aTIFF (Uncompressed) decompressorare needed to see this picture.