CodeXL17QuickStartGuide.docx
《CodeXL17QuickStartGuide.docx》由会员分享,可在线阅读,更多相关《CodeXL17QuickStartGuide.docx(60页珍藏版)》请在冰豆网上搜索。
CodeXL17QuickStartGuide
AMDCodeXLQuickStartGuide
AMDDeveloperToolsTeamAdvancedMicroDevices,Inc.
Version1.7
Revision1
TableofContents
INTRODUCTION3
LATESTVERSIONOFTHISDOCUMENT3
PREREQUISITES3
DOWNLOADANDINSTALLCODEXL4
ValidateInstallation5
InstallingtheVC++RedistributablePackage6
CODEXLHELP7
SYSTEMINFORMATION8
TEAPOTSAMPLEPROJECT9
DebugtheTeapotSampleApplication11
BasicDebugging11
SourceCodeView12
BreakpointView13
WatchandLocalsViews14
ExplorerView16
CallStackView18
FunctionCallsHistoryView18
DebuggedProcessEventsView18
MemoryView19
StatisticsView19
MATRIXMULTIPLICATIONPROJECT20
PerformCPUProfilefortheMatrixMultiplySampleApplication21
CPUTimeBasedProfileNavigation21
SourceCodeView22
Runtheclassictextbooksample23
Analyzingtheclassicimplementation24
Analyzingtheimprovedimplementation26
PROFILEMODE27
CPUProfiling28
OverviewTab29
ModulesTab29
CallGraphTab30
FunctionsTab31
GPUProfiling32
SummaryTab33
PerformanceCountersView34
CodeXLExplorerTree35
PowerProfiling36
SwitchingtoPowerProfilingmode36
StartinganewPowerProfilingsession36
SettingtheSamplingInterval37
StoppingaPowerProfilingsession37
PowerProfilingReal-TimeValues37
PowerProfilingTimelineView38
PowerProfilingSummaryView39
ConfiguringPowerProfilerSessions40
StaticKernelandShaderAnalysis40
SwitchingtoAnalysismode40
CreatinganewprojectforKernelAnalysis41
AddingOpenCLfilestoanexistingproject42
AnalyzeModeOptions43
BuildOptions-Definingkernelcompilationoptions45
BuildingandAnalyzinganOpenCLFile48
OutputTab48
OverviewTab50
StatisticsTab50
TheAnalysisTab51
Viewingcompilationoutput:
ILandISA51
KNOWNISSUES52
SUPPORT52
Introduction
AMDCodeXL™isatoolsuitewithaunifieduserinterfacethatletsyouharnessthebenefitsofAMDCPUs,GPUs,andAPUs.IthaspowerfulcapabilitiesforAPU/GPUdebugging,CPUandGPUprofiling,andstaticOpenCL™kernelanalysis.Thesefeaturesletyoufindbugs,optimizeapplicationperformance,andeasilyaccessheterogeneouscomputing.AMDCodeXLisavailableasastand-aloneapplicationforWindows®andLinux®,aswellasaMicrosoft®VisualStudio®extensionforWindows.
GettingthemostoutoftheAMDCodeXLtoolsuiterequiresarelativelyrecentAMDAPU,arecentversionofCatalyst,andtheOpenCLAPPSDK.
Thisdocumentdescribeshowto
∙getstartedusingCodeXL
∙findinformationaboutknownCodeXLissues
∙contactAMDforsupport
LatestVersionofThisDocument
∙Forthelatestandgreatestversionofthedocumentation,gototheCodeXLWebsite.
Prerequisites
OperatingSystems
•MicrosoftWindows764-bit
•MicrosoftWindows8.164-bit
•Linux64-bit(RedHat,Ubuntu)
FordetailedsystemrequirementsseetheCodeXLReleaseNotesintheCodeXLinstallationfolderorontheDocumentationsectionoftheCodeXLwebpage.
CodeXLVisualStudioExtension
•[Optional]MicrosoftVisualStudio2010(Standard/Professional/TeamSystemEdition)
•[Optional]MicrosoftVisualStudio2012(Professional/Premium/UltimateEdition)
•[Optional]MicrosoftVisualStudio2013(Professional/Premium/UltimateEdition)
ProfilingOpenCL™Applications
•[GPUdevice]AMDCatalystdriverwithOpenCL™GPUsupport
•[GPUdevice]AMDRadeon™HD5000seriesornewer
•AMDAPPSDK(requirements)
FordetailedsystemrequirementsseetheCodeXLReleaseNotesintheCodeXLinstallationfolderorontheDocumentationsectionoftheCodeXLwebpage.
DownloadandInstallCodeXL
Installationissystem-specific(WindowsorLinux);butonceinstalledandstarted,theCodeXLoperationissystem-independent.
DownloadtheAMDCodeXLinstallationpackagefrom
ForWindows
1.Downloadthe.exefileAMD_CodeXL_Win*.exe.
2.Whenthedownloadcompletes,double-clickthe.exefiletoinstallCodeXL.
Theinstallerguidesyouthroughtheinstallationprocess.
TheCodeXLVisualStudio2010and2012extensionsarepartoftheinstallerpackageandareinstalledbydefault.
3.Choose“Custom”installation,andde-selecttheVisualStudioextensionsifyoudonotwanttoinstallthem.
ForRedHat/CentOS/FedoraLinux
1.Downloadthe64-bitLinuxRPMpackageAMD_CodeXL_Linux*.rpm.
2.InstalltheRPMpackagedirectly:
$sudorpm-UvhAMD_CodeXL_Linux*.rpm
ForUbuntuandotherDebianbasedLinuxdistributions
Eitherinstallthetararchive(1.),orinstallthe.debpackage
(2).
1.Downloadthe64-bitLinuxtarpackageAMD_CodeXL_Linux*.tar.gz.
$tar–xvzfAMD_CodeXL_Linux*.tar.gz
or
2.Downloadthe64-bitLinuxDebianpackageamdcodexl-*.deb.
$sudodpkg-iamdcodexl_x.x.x-1_amd64.deb
$sudoapt-get-finstall
ValidateInstallation
AfterCodeXLinstallation,launchtheCodeXLstandaloneapplication(orVisualStudio,ifyouareusingtheVSCodeXLextension).
ForWindows
1.Ensurethat:
∙TheC:
\ProgramFiles(C:
\ProgramFiles(x86)on64-bitmachines)foldershouldhaveanewsub-foldernamed“AMD”,whichshouldhaveasub-foldernamed“CodeXL”(thefullpathoftheCodeXLfoldershouldbe:
C:
\ProgramFiles\AMD\CodeXL,orC:
\ProgramFiles(x86)\AMD\CodeXLon64-bitmachines)
∙AnAMDCodeXLshortcutappearsonthedesktop.
∙TheControlPanelshowsAMDCodeXLinitslistofinstalledprograms.
2.Double-clickontheCodeXLdesktopshortcutorselectCodeXLfromtheprogrammenu.
TheCodeXLstand-aloneapplicationstarts.
ForWindowsusingtheVisualStudioplugin
1.LaunchMicrosoftVisualStudio.TheVSGUIshouldappear.
2.VerifythatAMDCodeXLisinstalled:
SelectHelp>>AboutMicrosoftVisualStudiofromthemenubar.
CheckthatCodeXLislistedunderInstalledproducts.TheVSmenubarincludesaCodeXLpull-downmenu.
ForLinux
Dooneofthefollowing:
1.AddoneofthefollowingtoyourPATH:
/opt/AMD/CodeXL_X.X-XXXX/(orwhereveryouextractedthetarpackage)or,
$PATH=/opt/AMD/CodeXL_X.X-XXXX:
$PATH
$CodeXL
OR
2.AddoneofthefollowingtoyourPATH:
/opt/AMD/CodeXL_X.X-XXXX/
or
$cd/opt/AMD/CodeXL_X.X-XXXX/
$./CodeXL
TheCodeXLstandaloneapplicationstarts,andtheCodeXLGUIwindowappears.
TheCodeXLExplorerviewdisplays:
Noprojectloaded,asshowninthefollowingscreenshot.NotethatscreenshotsmayvaryslightlywithdifferentversionsofCodeXL.
InstallingtheVC++RedistributablePackage
IfVisualStudioisnotinstalledunderC:
\ProgramFiles(orC:
\ProgramFiles(x86)on64-bitmachines),followthesestepstoenableCodeXLsourceviewwhileCPUprofiling.NETapplications:
∙DownloadandinstallMicrosoftVisualC++2013Redistributablex86packagefrom:
∙Registermsdia100.dllasaCOMcomponent.
▪Openacommandshellwindow.
GettingStartedwithCodeXL
▪On64-bitWindowssystems,enterthefollowingcommand:
regsvr32.exe“c:
\ProgramFiles(x86)\CommonFiles\microsoftshared\VC\msdia100.dll”
On32-bitWindowssystems,enterthefollowingcommand:
regsvr32.exe“c:
\ProgramFiles\CommonFiles\microsoftshared\VC\msdia100.dll”.
Notethat32-bitWindowsisnolongerformallysupported.
CodeXLHelp
TobringupaCodeXLHelpwindow:
1.ClickontheAMDCodeXLUserGuidelinkontheCodeXLstartupHomePage.
OR
2.SelectHelp>>ViewHelpfromtheCodeXLtoolbar.
CodeXLHelpprovidessomeofthesameinformationprovidedinthisdocument,butalsoincludesadditionaldetailsaboutCodeXLviewsandmodules.
TobringuptheCodeXLHelpwindowfortheVisualStudioextension:
1.SelectCodeXL>>Help>>ViewHelpfromtheVSmenu.
Systeminformation
Todisplaysysteminformation:
1.SelectTools>>SystemInformationfromtheCodeXLtoolbar.
Thetabsletyouselectacategoryofinformation.ThefollowingscreenshotshowsOpenCLdeviceinformationforaGPUdeviceandaCPUdeviceontheruntimesavailablelocally-a32-bitand64-bitruntime.
Todisplayprojectsettings,theprojectmustbestopped.Toeditthesettingsofaproject:
1.SelectFile>>ProjectSettingsfromthedrop-downFilemenu.
SeetheCodeXLHelpformoredetailsaboutprojectsettings.
TeapotSampleProject
TheCodeXLdistributionincludesasampleprojectthatdisplaysasmokingteapot.TheprojectusesOpenCLkernelstosolveNavier-Stokesequations.Itsharesa3DtexturebetweenOpenCLandOpenGL,copiesadensityfieldgridintothe3Dtexture,andrendersthesmokeusingOpenGL.
FortheVisualStudioextension:
1.SelectCodeXL>>OpenTeapotSampleProjectfromtheVSmenu.VisualStudiodisplaystheteapotsampleproject.
ScreenshotsintheremainderofthisdocumentshowthestandaloneversionofCodeXL.TheVisualStudioversionissimilar,butcontainsaVSwindowratherthanaCodeXLwindow.
ForWindowsorLinux:
1.IntheCodeXLwelcomepage(intheCodeXLmenubar,clickonFile-
>WelcomePage),UndertheSamplesheader,clicktheAMDTeapotlink.
TheCodeXLExplorerviewnowshows:
AMDTTeaPot|DebugMode-Notrunning
TheCodeXLwindowalsodisplaysseveralotherviews,butsincetheprogramisnotrunning,thoseviewsdonotdisplayanyinformation.
DebugtheTeapotSampleApplication
Note:
BeforedebuggingtheTeapotsampleapplication,youmustloadit(seetheprevioussection).
Aftertheteapotsampleisloaded,runthedebugprogram:
1.SelectDebug>>StartDebuggingfromthetaskbar,
or
2.Clickonthegreenrightarrow
taskbar.
Theprogrambeginsexecution,andsoondisplaysarotatingsmokingteapotinaseparatewindow.
Tostoptheprogram:
1.SelectDebug>>StopDebuggingfromthetaskbar,or
2.ClicktheblacksquaretaskbarStopbutton
or
3.Clicktheclosebuttonintheupper-rightcor