Tải bản đầy đủ - 0 (trang)
Hack 52. Enable 3-D Video Acceleration

Hack 52. Enable 3-D Video Acceleration

Tải bản đầy đủ - 0trang

knowwhatbrandandmodelitissoyoucanselectthebest

drivers.VideocardsaregenerallyinstalledasPCI,PCI-X,or

AGPcards,orareprovideddirectlyonthemotherboard.In

reality,allofthesecardtypesarejustvariationsonthebasic

PCItechnology,andevenonboardvideocardsareessentially

justPCIdevicesthathappentobepermanentlyinstalledonthe

motherboard.Thismakesitveryeasytoidentifyyourcardby

scanningthePCIbususinglspci:

$lspci-X





The-Xflagtellslspcitoreportdeviceidentifiersintheformat

usedbytheXWindowsconfigurationfilesratherthaninnative

format.

Youcanalsotelllspcitoreportin"verbose"mode:

$lspci-v





Verbosemodeprovidesyouabitmoreinformationabouteach

device.Unfortunately,the-Xand-vflagscan'tbecombined,so

youhavetorunthemseparately.

Lookinthereporteddevicelistforanentrythatsays"VGA

compatiblecontroller."Thedevicestringwillincludethe

manufacturerandmodel.Themostcommonbrandsofhighperformance3-DcardarenVidia,ATI,andMatrox,although

someembeddedvideocardsusechipsetsfromIntelorother

manufacturers.



Drivers



Driversforvideocardshavebeensomethingofasorepointfor

opensourcedevelopersoverthelastcoupleofyears.Modern

videocardsareessentiallyverysmall,veryhigh-performance

computerswiththeirownCPUsandmemory,andthedrivers

areanessentialpartofwhatmakesthemwork.The

manufacturerstendtoguardtheirdrivertechnologygreedily

andreleaseonlyprecompileddriversinbinaryformatthatmay

beusedbutnotmodifiedorreverse-engineered.Thisruns

countertotheidealsofmanyopensourcedeveloperswhoinsist

thatallsoftware,includingdrivers,shouldbeavailableinsource

codeformat.Thus,manyhigh-performancevideocardshaveat

leasttwosetsofdriversavailable:binarydriversprovidedby

themanufacturerandopensourcedriversdevelopedbythird

partieswhoexaminethecardsandtrytowritedriversthatwill

workwiththem.

Binarydrivershavetheadvantagethattheygenerallyoffer

higherperformanceandmakeuseofallthefeaturesofthe

card,buttheycannotbemodifiedorexaminedbyother

developersandcan'tbecompiledtorunondifferenthardware

architecturesnotsupportedbythemanufacturer.

Opensourcedrivershavetheadvantageofrunningonmore

typesofhardwarebecausedeveloperscanmodifythemtosuit

theirownrequirements,butthedisadvantageisthatthe

developersdon'thaveaccesstointernalinformationaboutthe

video-cardhardwareandmaynotbeabletoachievehigh

performanceormakeuseofallfeaturesofthecard.

TheUbuntucommitmenttoshiponlyfreesoftwaremeans

binarydriversaren'tavailableinthebasedistribution,butifyou

wantmaximumperformancefromyour3-Dcard,youwillneed

toinstallthebinarydriversfromtheuniverseandmultiverse

repositories,ordirectlyfromthecardmanufacturer'swebsite.

Toenableuniverseandmultiverse,youmayneedto"Modify

theListofPackageRepositories"[Hack#60].



nVidia

TheopensourcedriverfornVidiacardsiscallednvandcomes

aspartofthebasicXorginstallationinDapper,butfor

maximumperformance,installthebinarynvidiadriver,whichis

partofthelinux-restricted-modulespackage.Thelinuxrestricted-modulespackagecomesinseveraldifferentversions

tosuitthedifferentkernels,socheckwhichkernelversionyou

arerunning:

$uname-r

2.6.15-17-686



Theninstallthematchinglinux-restricted-modulespackage:

$sudoapt-getinstalllinux-restricted-modules-2.6.15-17-686





Youwillalsoneedeitherthenvidia-glxorthenvidia-glx-legacy

package,dependingonthespecificcardmodel.Ifyourcardis

anoldermodelsuchastheTNT,TNT2,TNTUltra,GeForce,or

GeForce2installthenvidia-glx-legacypackage.Ifit'sanewer

modelsuchasa4-series,6-series,nForce,Quadro,orFXseriesinstallnvidia-glx:

$sudoapt-getinstallnvidia-glx





Edit/etc/X11/xorg.confandlookforalinethatsayssomething

like:



Driver"nv"



Editittospecifythenvidiadriver:

Driver"nvidia"



ExitfromyourGNOMEsession.Then,whenyouarebackatthe

loginprompt,pressCtrl-Alt-BackspacetokillofftheXserver

andforceittorestart.AsXrestarts,youwillprobablyseeabig

nVidialogoflashonthescreen,showingthatithasloadedthe

binarynvidiadriverratherthanthedefaultnvdriver.Logback

intoGNOME,startupglxgears,andseeifyourframeratehas

improved.



ATI

IfyouhaveanATIcardthatwasauto-configuredbyUbuntu,

it'sprobablyrunningeithertheatiorradeondriver.For

maximumperformancewithcardsinthe"Radeon"series,9series,X-series,orTV-Out-capableATIcards,youcaninstall

thefglrxdriver,andifyourcardisan8500orbetter,youcan

alsoinstallATI'sproprietarydriver.

Installingthefglrxdriverisveryeasy:

$sudoapt-getinstallxorg-driver-fglrx





Thenedit/etc/X11/xorg.conf,lookforalinethatlistseitherthe

atiorradeondriver:



Driver"ati"



andreplaceitwiththefglrxdriver:

Driver"fglrx"



InstallingATI'sproprietarydriverrequiresafewmorestepsbut

mayproducebetterperformanceonthelatestcards.Startby

goingtohttp://support.ati.comandnavigatingtotheLinux

drivers.DownloadtheATIDriverInstaller,notthespecificXorg

driverbecausethat'spackagedasanRPM,andyouneedto

builda.debinstead.Oncethe(verylarge!)driverfilehas

downloaded,installsomesupportingpackagesandconfigure

thedriver.Ithelpskeepthingsneatifyoudothisina

subdirectory:

$sudoapt-getinstallfakerootgcc-3.4module-assistant\\

build-essentialdebhelper

$mkdirATI

$mvati-driver-installer-8.22.5-i386.runATI/;cdATI

$chmod+xati-driver-installer-8.22.5-i386.run

$fakeroot./ati-driver-installer-8.22.5-i386.run





Theinstallerwillaskyouacoupleofquestions:answer

"Generatedistributionspecificpackages,"then"Ubuntu,"and

then"Dapper."Oncetheinstallerfinishes,itwillhavecreateda

nicelittleDebianpackagethatyoucaninstall:

$sudodpkg-i*.deb

$sudomodule-assistantbuild,installfglrx-kernel







Edit/etc/X11/xorg.conftousethefglrxdriver,asdescribed

earlier,reboot,andyou'redone.



Matrox

Matroxalsomakesavailableaproprietarydriverthatyoucan

buildasaLinuxkernelmodule.First,installthekernelheaders

tousewhenbuildingthenewmodule:

$sudoapt-getinstalllinuxheader\Quname-r\Q





ThendownloadthelatestdriverinstallerfromMatroxat

http://www.matrox.com/mga/support/drivers/latest/.

BuildingthedrivermustbedonewithGCC3.4,soinstallit,set

anenvironmentvariablethatspecifiesthatitshouldbeusedin

preferencetootherinstalledversions,andruntheinstaller:

$sudoapt-getinstallgcc-3.4gcc-3.4-base

$exportCC=gcc-3.4

$sudoshmtxdriver-x86_32-1.4.3.3.run





BackupyourexistinglibGLinstallation,sinceitwon'tworkwith

themtxdriver:

$sudomkdir/usr/lib/libGL.back



$sudomv/usr/lib/libGL.so*/usr/lib/libGL.back/





Thenedit/etc/X11/xorg.conf,findtheDevicesectionforyour

videocard,andaltertheDriverlinetousethemtxdriver:

Driver"mtx"



Finally,rebootyourcomputersothekernelcanloadthenew

module.



Hack53.MakeYourFontsPretty



UbuntuconfiguresGNOMEandKDEtousesomevery

prettyfonts,buttherearesometweaksyoucanuseto

makethemevennicer.

Mostcomputerusersdon'teventhinkaboutfonts.Theyjust

expectthemtoworkandassumethattextwilllookthesame

whetherit'sviewedonscreen,printed,orsenttoanotheruser

inadocument.However,fontmanagementisactuallya

surprisinglycomplextaskduetothemanysubtlevariationsin

thewaysfontscanbecreatedandused.



FontsAreNotCreatedEqual

Fontscanbedefinedinanumberofdifferentwaysandhavea

varietyoffileformats.Eachoperatingsystemhasitsown

methodofmanaginganddisplayingthem.Somefontsare

designedasbitmapstobedisplayedonscreen,whileothersare

invectorformatsotheycanscaleupordownandbeprintedat

highresolution.Somecomeasbundlesthatincludeboth

bitmapandvectorformatsinthesamepackage,withoneused

foronscreendisplayandtheotherusedinprintingorto

generatefilesinoutputformatssuchasPDF.Andsomecomeas

families,withseveralvariationssuchasboldanditalicbundled

togetherwiththebasefont,providingmuchbetterresultsthan

workingfromasinglebasefontandthenapplyingsuch

variationsalgorithmically.



FontManagementwithDefoma



UbuntuusesDefoma,the"DebianFontManager,"tocentralize

andsimplifyfontmanagementacrossallapplications.

Applicationscanvarydramaticallyinhowtheymanagefonts,so

whenanewfontisinstalledonyourcomputer,it'snotalways

obvioushowtotelleachapplicationthatthefontexistsand

wheretofindit.

Defomagetsaroundthisproblembyallowingapplicationsto

registerthemselvesbyprovidingaDefomaconfigurationscript.

Then,whenanewfontisinstalled,Defomaworksthroughall

theconfigurationscriptsandperformswhateveractionis

necessarytoenablethefontforeachapplication.

Thefirstthingyoushoulddothenismakesurethatyour

systemisconfiguredtouseDefomatomanagefonts.Run:

$sudodpkg-reconfiguredefoma





IfDefomaisnotcurrentlysettomanagefonts,youwillbe

askedifyouwanttouseit;answerYes.

Ifyoursystemhasendedupinanuncleanstatewithsome

manuallyinstalledfontsorapplicationsthatcan'tseesome

fonts,youcanforceDefomatototallyrebuilditsconfiguration.

Thisprocessrescansallyourinstalledfontsandmakessureall

registeredapplicationshavebeenupdatedtousethem:

$sudodefoma-reconfigure





OnscreenFont-RenderingPreferences



Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Hack 52. Enable 3-D Video Acceleration

Tải bản đầy đủ ngay(0 tr)

×