Home
ME964 GIT, Trac, CMake & CUDA Debugging
Contents
1. COMPUTER AIDED ENGINEERING General Tools Find available computers o CAE Forms o Directory of Account Management Tools Account Tools Account Info Account Detsits Email Tools Fering Forwarding and Aliases Vacation Message Mailing Lists Mad Usage IN Printing o Disk Space i Fle Mananer Brian s CAE Account Log out Account Tools gt Account Details Account Details bdavis Username change password Group Memberships create a group siemenscollab Request new account Brian s CAE Account General Tools o Find available computers o CAE Forms Management Tools Linux Setup o Email Tools Fiering Forwarding and Aliases Y Vacation Message 9 Mailing Usts Mad Usage Printing o Disk Space File Manager o Web Tools Personal Web Page o Directory of Account Log out Account Tools gt Account Details gt Add Group Create a new group Group Name Comments Group Password Members enter one login name per line 12 A brief GIT How TO e Trac settings can e modified if desired e Click submit neral Tools na avslsdie xmputers AE Forms rectory of Account snagement Tools count Tools zeount Info Accownt Details Green ep mistery umer Setan mad Tools aienag Perwarding and hasca Vaceten Means ge Maling swa wad mage tinting sk Space mie manager
2. eneral Tools Genera o Welcome This site contains a number of tools for managing your account We ve grouped them into the categories below to help you find vhat you need Keep in mind that you can access each tool from the sidebar on the left Account Information View information about your CAE account Account Tools Email Setup m o Account Info Account Detsis Groups This page allows you to configure a large variety of options relating to Login History your CAE email account Linux Setup Email Tools Printing Fering 9 Forwarding and Misses 9 Vacation Message The Printing tool shows you a history of your printed documents and the k Mailing Lists remaining pages in your alloted quota LEL d t z Mad Usage COMPUTER MOED ENGINEERING o Printing Disk Space o Disk Space General Tools File Manager The Disk Space tool allows you to Account Tools gt Repos Web Tools Personal Web Page o Find available View your usage of disk space computers Repositories M Databas Configure your quota space for Unix and Windows P ea jar nd Get a detailed analysis of the files in your Unix Windows home directory o CAE Forms tent Send Rtogs P Repostones o Directory of Account Web Tools nt va Set Alternative Repository Passwords Account Tools Here you can set alternative passwords for e repository Resources Manage your website data A t Inf o MSDN Academic o z z i t Account Detais Create and
3. ed Tools Personal web Page Virtual reste web Lege Repestenes Resources SDN Academic zance Account Tools gt Repos gt Manage Repository OK Your changes will take effect in a few minutes Manage Repository Use this form creste or edit settings on a repository Indicates s required field See Mtps kD wisc edu cse page php d 18796 for help Groups must already exist Click here to see your groups or make a Whether Both sll Read Group and Reed Networks sre required for res sccess either any or just Trac Readers Can Make Tickets V Trac aite ntm See Trac Interface Customization Ste Appearance for syntax and details Leave blank to accept the default styles Trac style caa e aite html notes above A favicon ico sty use as your Trac projesi displayed in the browser bar A brief GIT How To ese 1 TAON ING NGANG acae WENG Ng General Tools Account Tools gt Repos gt Manage Repository o Find available computers Manage Repository CAE Forms Use this form create or edit settings on a repository Directory of Account Indicates a required field Management Tools herens fich mar in sihi G fach Account Tagls You can access your Trac site here https trac cae wisc edu trac test_git Your GIT URI is actp it cae wiac edu git test_git Le we Account Dersi oes Login History W sa Email Tools Fera W Forwarding anc Amases Vacation
4. 6 lt p gt test lt p gt 7 lt body gt 8 lt html gt Note See TracBrowser for help on using the browser View changes Download in other formats Plain Text Original Format Not all SCM tools are equal ss e Centralized SVN CVS vs Distributed GIT e With distributed you work offline such as on plane sailboat or a cabin in the woods e Create a copy for a friend without ever having a remote server e Deep Cloning e Performance Not all SCM tools are equal ss e What you check in to the repository Is what you get out e Unbelievably not all tools support this as corruption on drives backups or transfer to CD DVD can cause data corruption and no integrity checking is performed GIT En e hiip git scm com e Tech Talk Linus Torvalds on git e http www youtube com watch v 4XpnKHJAok8 e Tortise Gui for GIT e http code google com p tortoisegit e GIT Bash for Windows e http msysgit github com A brief GIT How To My CAE Account File Edit View Hlistor Bookmarks Tools wep ge lt H MEEL https my cae wisc edu tools i 9 7 Fimo Vrste Google s e Login to CAE account e Click Repositories under Web Tools e Click Create and Edit Repository Settings o Cae reme o Directory of Account Management Tools est Headline mi 2 kah SPN ec Repos W University of Wisconsi En B JEN laCae COMPUTER AIDED ENNE ENG Brian s CAE Account
5. APP_SRC_DIR V S u al St u d O 7 BUILD 64BIT C kaka BUILD_BOOST o ru N_VS i bat BUILD_DIR C projects ME964 branches trunk build Windows 6 1 CMAKE_BACKWARDS_COMPATIBILITY 24 CMAKE_BUILD_TYPE Debug e M at a b b b CMAKE_CXX_FLAGS_DEBUG_INIT D_DEBUG MDd Zi Ob0 Od CMAKE_CXX_FLAGS_INIT DWIN32 D_WINDOWS W3 Zm1000 EHsc GR ru nm at ab at CMAKE_CXX_FLAGS_MINSIZEREL_INIT MD O1 Ob1 D NDEBUG e Depwalker _ Press Configure to update and display new values in red then press Generate to generate selected build files ru n_depwal ker b at Configure Generate Current Generator Visual Studio 9 2008 Win64 CMAKE_SYSTEM_NAME indows 1 7 CUDA_GPU FLAGS g G0 00 gencode arch compute_10 code sm_10 compute_10 gencode arch compute_13 code Batch SCrl pts CO nfig u re CUDA_TOOLKIT_ROOT_DIR C Program Files NVIDIA GPU Computing Toolkit CUDA v3 2 th PATH 7 t CUDA_SDK_ROOT_DIR C Documents and Settings All Users Application Data NVIDIA Corporation NVIDIA GPU Compu e environ en FORCING CUDA CUDA TOOLKIT BIN DIR TO C Program Files NVIDIA GPU Computing Toolkit CUDA v3 2 bin variables to ensure acces aan project DLLs are Generating done loaded from the install bin directory and so MATLAB can find GP_Loader mex64 38 Example Project e Browse to location of top trunk directory e CMakeLists txt file then to e trunk build ME964 sIn project e trunk source cpp project1 source
6. git config global user email for all future repositories pdavis5 wisc edu you create on the computer you are using it gets set in your profile 660660 eee 6660 m 0000 A brief GIT How To 33 Add your files to git git add CMakeLists txt Commit the project to the local Baene repository a for all files m for a message En add my _dir cpp Create a bare clone of the repo git commit a m creating project List the config and look at back out of the local repo ee gr cdi remote origin url c projects ME9 Senese dennen Change the remote url to point to er the remote cae repository https git cae wisc edu git me964 git Push your code to the remote ___y git push origin master repository Username Password Counting objects 135 done Delta compression using up to 2 threads Compressing objects 100 119 119 done Writing objects 36 49 135 17 A brief GIT How To ese e Clone the remote repo to a new local copy e Make changes e Commit changes e Push changes to remote repository git clone https git cae wisc edu git me964 git my_checkout make changes Make changes git commit a m my message make more changes Make more changes git commit a m my more changes message git push origin master CMake een Build tools What do they do What is CMake Why use CMake What can CMake do Example Project Don t listen to
7. lt NNNN3 gt is an integer index Documentation associated with each policy describes the OLD and NEW behavior and the reason the policy was introduced Projects may set each policy to select the desired behavior When CMake needs to know which behavior to use it checks for a setting specified by the project If no setting is available the OLD behavior is assumed and a warning is produced requesting that the policy be set e Want to know more then see policies section of reference listed below e project lt projectname gt languageName1 languageName2 e Sets language to be used e Default C C e Not what I was expecting as projects can have multiple subprojects e find package lt package gt version EXACT QUIET REQUIRED COMPONENTS componenrts NO POLICY SCOPE o FIND PACKAGE CUDA e add subdirectory source_dir binary_dir EXCLUDE FROM ALLJ e add_subdirectory source cpp project_vanilla src project vanilla Adds the subdirectory source cpp project_vanilla src containing a CMakeLists txt file for the exe and library Example CMakeLists txt file to follow EXCLUDE_FROM_ALL removes from all target such as make all requiring a manual build command specifying target 43 Source http www CMake org CMake help CMake 2 8 docs html Example Project Using Vanilla CMake Fairly self explanatory which is nice Override where CMake would like to put the files default C Program Filles ME964 Inc
8. Git branch name commit id or tag URL src tgz Full path or URL of source URL_MD5 md5 MD5 checksum of file at URL TIMEOUT seconds Time allowed for file download operations Update Patch step UPDATE_COMMAND cmd Source work tree update command PATCH_COMMAND cmd Command to patch downloaded source Configure step SOURCE_DIR dir Source dir to be used for build CONFIGURE_COMMAND cma Build tree configuration command CMAKE_COMMAND CMake Specify alternative CMake executable CMAKE_GENERATOR gen Specify generator for native build CMAKE_ARGS args Arguments to CMake command line CMAKE_CACHE_ARGS args Initial cache arguments of the form Dvar string on Build step BINARY_DIR dir Specify build dir location BUILD COMMAND cma Command to drive the native build BUILD_IN SOURCE 1 Use source dir for build dir nstall step INSTALL DIR dir Installation prefix INSTALL_COMMAND cmd Command to drive install after build Test step TEST_BEFORE_INSTALL 1 Add test step executed before install step TEST_AFTER_INSTALL 1 Add test step executed after install step TEST_COMMAND cmd Command to drive test Output logging LOG_DOWNLOAD 1 Wrap download in script to log output LOG_UPDATE 1 Wrap update in script to log output LOG_CONFIGURE 1 Wrap configure in
9. likely need the parse_arguments function e http www itk org Wiki CMakeMacroParseArguments e You can probably guess what it is good for SET arguments hello OPTION3 world LISTS foo bar OPTION2 LIST1 fuz baz PARSE_ARGUMENTS ARG LIST1 LIST2 LIST3 OPTION1 OPTION2 OPTIONS arguments e The parameters are then dereferenced with syntax ARG_LIST1 and ARG_OPTION2 as an example CMake Commands sa e message STATUSIWARNINGJAUTHOR_ WARNING FATAL_ERROR SEND_ERROR message to display e Output shows up in Cmake GUI output window e Very handy when trouble shooting build scripts CMake Commands sa e if else endif expression then section COMMAND1 ARGS COMMAND2 ARGS elseif expression2 elseif section COMMAND1 ARGS COMMAND2 ARGS else expression else section COMMAND1 ARGS COMMAND2 ARGS endif expression e You might see this expression where beginning if and else need same expression never do this and only ever put expression in first if and not in trailing else elseif and endif etc e From CMake FAQ As of CMake 2 6 0 the ELSE and ENDIF constructs can be empty There are more than thoes shown below Just showing most commonly ones use Documentation is omitted see online refrence manual for more if lt constant gt if lt variable gt if NOT lt expression gt if lt expri gt AND lt expr2 gt if lt expr1 gt OR lt expr2
10. main int argc char arg wv Log what we received z Configuration Active Debug _ Common Properties Configuration Properties General Debugging C C General Optimization Preprocessor Code Generation Language Precompiled Headers Output Files Browse Information Advanced Command Line Linker Manifest Tool XML Document Generator Browse Information Build Events Custom Build Step Optimization Inline Function Expansion Enable Intrinsic Functions Favor Size or Speed Omit Frame Pointers Enable Fiber safe Optimizations Whole Program Optimization Optimization Select option for code optimization choose Custom to use specific optimization options Od O1 O2 Ox gpuPMatrixReconSingleProjection cu 2 gpuReconSingleProjectionPlugin_generated 6 GA INSTALL a E matrix serialize 4 Solution Explorer ez Class View Ready r cudaDevProps enumerate c cudaDevProps display cud mexPrintf GPU device en Specifies the project name 4 b K findino Ej hismuoua Cal 23 Looking at diffing VS project files 32 WHEN things go wrong sIn ee Microsoft Visual Studio Solution File Format Version 10 00 Visual Studio 2008 Project 8BC9CEB8 8B4A 1 1D0 8D11 00A0C91BC942 CudaCollision CudaCollision CudaCollision vcproj O8C6F31 1 7AA6 46EB BFB9 7F947F5DD014 EndProject Project 8BC9CEB8 8B4A 1 1D0 8D11 0
11. 480 GeForce GTX 470 GeForce GTX 460 GeForce GTX 260 GeForce GTX 260 GeForce GTX 275 GeForce GTX 280 GeForce GTX 285 GeForce GTX 295 GeForce 8800 GS Quadro Quadro 6000 Quadro 5000 Quadro 4000 Quadro FX 4800 Quadro CX Quadro FX 5800 Quadro FX 3800 Quadro FX 3700 Quadro FX 1800 Quadro FX 380 Quadro FX 580 Quadro FX 370 Quadro FX 380 LP Tesla Tesla C2050 Tesla C2070 Tesla C1060 Tesla 1070 GeForce 9600 GSO GeForce 8800 GT GeForce 9800 GT GeForce GTS 240 GeForce 8800 GTS 512 GeForce 9800 GTX GeForce 9800 GTX GeForce GTS 250 GeForce 9800 GX2 GeForce 9600 GS GeForce 9600 GSO 512 GeForce 9600 GT Ona Windows 64 bit system browse to C Program Files x86 NVIDIA Parallel Nsight 1 51 Common e Double click on the file named e DisableWpfHardwareAcceleration reg GeForce G210 GeForce 9400 GT GeForce 9500 GS GeForce GT 120 GeForce 9500 GT GeForce G100 GeForce 9300 GE GeForce 8400 GeForce 9300 SE GeForce 8400 GS GeForce 9300 GS GeForce GT 220 GeForce NVS 2100 GeForce G210 GeForce NVS 3100 GeForce 210 GeForce 310 e Known working from experience e Foxconn destroyer motherboard with onboard NVIDIA 780a SLI Chipset and 4 Tesla c1060s works just fine e Also now Remote Desktop debugging works without device enumeration issue e Headed GPU is not enumerated when running remote Nsight in Action Debugger MVIDIA NVIDIA Instructional Video http developer nvidia
12. LOG log EXPECTED_MD5 sum SHOW _PROGRESS 53 CMake Commands sa e String regex regular expression e String comparisons e To Upper Lower case string REGEX MATCH lt regular_expression gt lt output variable gt lt input gt lt input gt string REGEX MATCHALL lt regular_expression gt lt output variable gt lt input gt lt input gt string REGEX REPLACE lt regular_expression gt lt replace_expression gt lt output variable gt lt input gt lt input gt string REPLACE lt match_string gt lt replace_string gt lt output variable gt lt input gt lt input gt string COMPARE EQUAL lt string1 gt lt string2 gt lt output variable gt string COMPARE NOTEQUAL lt string1 gt lt string2 gt lt output variable gt string COMPARE LESS lt string1 gt lt string2 gt lt output variable gt string COMPARE GREATER lt string1 gt lt string2 gt lt output variable gt string ASCIl lt number gt lt number gt lt output variable gt string CONFIGURE lt string1 gt lt output variable gt ONLY ESCAPE_QUOTES string TOUPPER lt string1 gt lt output variable gt string TOLOWER lt string1 gt lt output variable gt string LENGTH lt string gt lt output variable gt string SUBSTRING lt string gt lt begin gt lt length gt lt output variable gt string STRIP lt string gt lt output variable gt string RANDOM LENGTH lt length gt ALPHABET lt
13. alphabet gt RANDOM_SEED lt seed gt lt output variable gt 54 ExternalProject ADD En e Adds external 3rdParty packages to your projects e Can download source from repositories SVN GIT CVS e Build and install source that It CMake friendly e There is an example though not currently working keeps rebuilding itself using boost and svn which can be activated with ME964 BOOST SVN CHECKOU T_BUILD for the curious e Once it was elusive and it s documentation could only be accessed by the command prompt ExternalProject_Add lt name gt Name for custom target DEPENDS projects Targets on which the project depends PREFIX dir Root dir for entire project LIST_SEPARATOR sep Sep to be replaced by in cmd lines TMP_DIR dir Directory to store temporary files STAMP_DIR dir Directory to store step timestamps Download step DOWNLOAD_DIR dir Directory to store downloaded files DOWNLOAD_COMMAND cma Command to download source tree CVS_REPOSITORY cvsroot CVSROOT of CVS repository CVS_MODULE mod Module to checkout from CVS repo CVS_TAG tag Tag to checkout from CVS repo SVN_REPOSITORY url URL of Subversion repo SVN_REVISION rev Revision to checkout from Subversion repo SVN_USERNAME john Username for Subversion checkout and update SVN_PASSWORD doe Password for Subversion checkout and update GIT_REPOSITORY url URL of git repo GIT_TAG tag
14. automatically rerun a script to delete the cache think this would be the optimal solution Brian J Davis http comments gmane org gmane comp lib boost CMake 821 2010 CMake cache ese e Cache is generated when all build parameters have been set in GUI e Cache generation can require multiple configure steps as when build parameters change others can be activated which require user to accept or allow the user to change e Changes are in red until accepted and new ones based on user changes will appear in red e Clearing the cache e File gt Delete Cache CMake cache ese e Why a cache e Speed no need to reparse all CMakeLists txt unless they change e There is a dependency on CMakeLists txt files e Consequences e Do not track VS project files or Makefiles CMake output with source control management SCM Show of hands Who is Using a SCM tool Should be everyone ows file explorer copy directory does not count nor does zip and copy e VS projects and Makefiles will be regenerated e Never Change CMake output Except from my understanding you can change the cache Though not a good idea unless careful what you change Cache is loaded when CMake is loaded to acquire previous build settings CMake cache sa e Cache and SET e To set variables in CMake SET is used set lt variable gt lt value gt CACHE lt type gt lt docstring gt FORCE PARENT SCOPE J e Example S
15. gt if TARGET target name if EXISTS file name if EXISTS directory name if IS_DIRECTORY directory name if IS_ABSOLUTE path if lt variable string gt MATCHES regex if lt variable string gt LESS lt variable string gt if lt variable string gt GREATER lt variable string gt if lt variable string gt EQUAL lt variable string gt if lt variable string gt STRLESS lt variable string gt if lt variable string gt STRGREATER lt variable string gt if lt variable string gt STREQUAL lt variable string gt if DEFINED lt variable gt if expression AND expression OR expression 52 CMake Commands een file WRITE filename message to write file APPEND filename message to write file READ filename variable LIMIT numBytes OFFSET offset HEX file STRINGS filename variable LIMIT COUNT nun KANA I numBytes LIMIT_OUTPUT numBytes LENGTH MINIMUM numBytes LENGTH MAXIMUM numBytes Na a a TG GEX regex NO HEX CONVERSION file GLOB variable RELATIVE path globbing expressions file GLOB RECURSE variable RELATIVE path FOLLOW_SYMLINKS globbing expressions file RENAME lt oldname gt lt newname gt file REMOVE file1 file REMOVE RECURSE filet file MAKE DIRECTORY directory1 directory2 file RELATIVE PATH variable directory file file TO_CMAKE PATH path result file TO_NATIVE PATH path result file DOWNLOAD url file TIMEOUT timeout STATUS status
16. install Cygwin or GNUWin32 Utils CMake Lists txt contains both the vanilla and modified projects Creates a test application and DLL called by the application eee ee eee eee eee ee JCMakeLists txt JCMakeLists txt example JCMakeLists txt vanilla Jgo Jgo bat install install bin Jinstall bin project vanilla exe Jinstall bin run_program bat Jinstall lib install lib libv lib JREADME txt source source cpp source cpp project_vanilla Jsource cpp project vanilla include source cpp project_vanilla include project_vanilla h source cpp project_vanilla src source cpp project_vanilla src CMakeLists txt source cpp project_vanilla src libv cpp source cpp project_vanilla src main cpp source cpp project_vanilla src project_vanilla cu source cpp project_vanilla src run_program txt 45 Vanilla CMake Example Cont e Main cpp below e project vanilla cu left include lt iostream gt include lt project_vanilla h gt int main void my_entry_function std cout lt lt all is well in the universe n include lt project_vanilla h gt include lt iostream gt include lt cuda h gt ies void project float data int index threadldx x blockDim x threadldx y data index index define BLOCK_SIZE 8 eee void my_entry_function void float dev_data size_t size BLOCK SIZE BLOCK SIZE sizeof float float host datafBLOCK SIZE BLOC
17. script to log output LOG_BUILD 1 Wrap build in script to log output LOG TEST 1 Wrap test in script to log output 55 LOG_INSTALL 1 Wrap install in script to log output Custom targets STEP_TARGETS sil st2 Generate custom targets for these steps Some points about CMake td Flexible and powerful through use of a few commands There are more CMAKE variables see doc for more info Build settings are local to the directory e What does this mean e Build settings specified are Global to the directory unless set_target_properties is used e set target properties useful when you have 2 libs which use same source file with ifdefs and you want to build them with different settings Settings can have build configuration specific settings such as e LINK_FLAGS_ lt CONFIG gt LINK_FLAGS_DEBUG e LINK FLAGS RELEASE Beware of CACHE FORCE and clear cache if you think something is not quite right IMO Needs the concept of namespaces as CMake variables can grow in large projects project is not what expected add_project does not work for third party packages such as vik dcmtk ITK etc and ExternalProject_Add must be used e This IMO does not allow to build for only what you need No true dependency checking across files What gets build is all or none Use fully qualified names for paths NOT relative e Try relative first but when it doesn t work switch to fully qualified names Tar was
18. wiki pages see TitleIndex Download in other formats Plain Text PDF Article PDF Book Printable HTML Trac wiki bug and feature tracking e Bug Tracking it Accessing Trac Integrate EXAMPLE_SVN_PROJECT Login Preferences Help Guide About Trac wiki Timeline Roadmap Browse Source WAAN search t Previous Ticket Back to Query Next Ticket Ticket 1 new defect Opened 13 months ago Last modified 13 months ago Atestticket Reported by Ovmed by Priority Milestone Version Severity Keywords Cc Blocking Blocked By Description With a fake problem Change History Changed 13 months ago by bpkroth In 3 This change shows an example of the repository s Trac integration commit push hooks by references the first ticket using the following message See 1 Note See TracTickets for help on using tic Download in other formats Comma delimited Text Tab delimited Text RSS Feed Trac wiki tracking e Online source browsing bug and feature sesso RERepos W 4 test html EXAMPLE SVN PRO x MW EXAMPLE SVN PROJECT Login Preferences Help Guide About Trac Last Change Annotate Revision Log root test html View revision Revision 1 85 bytes checked in by bpkroth 13 months ago Adding test files Line 1 lt html gt 2 lt head gt 3 lt title gt test lt title gt lt head gt 5 lt body gt
19. 0A0C91BC942 BulletValidation BulletValidation BulletValidation vcproj 8644F016 E5EF 432D 98C6 91D27D459746 EndProject Project 8BC9CEB8 8B4A 1 1D0 8D1 1 00A0C91BC942 DataGeneration DataGeneration DataGeneration vcproj AOB424D7 6CCD 465C A90E D5589E73954E EndProject Global GlobalSection SolutionConfigurationPlatforms preSolution Debug Win32 Debug Win32 Debug x64 Debug x64 Release Win32 Release Win32 Release x64 Release x64 EndGlobalSection GlobalSection ProjectConfigurationPlatforms postSolution 08C6F31 1 7AA6 46EB BFB9 7F947F5DD014 Debug Win32 ActiveCfg Debug Win32 08C6F31 1 7AA6 46EB BFB9 7F947F5DD014 Debug Win32 Build 0 Debug Win32 08C6F31 1 7AA6 46EB BFB9 7F947F5DD014 Debug x64 ActiveCfg Debug x64 08C6F31 1 7AA6 46EB BFB9 7F947F5DD014 Debug x64 Build 0 Debug x64 08C6F31 1 7AA6 46EB BFB9 7F947F5DD014 Release Win32 ActiveCfg Release Win32 A0B424D7 6CCD 465C A90E D5589E73954E Release Win32 Build 0 Release Win32 A0B424D7 6CCD 465C A90E D5589E73954E Release x64 ActiveCfg Release x64 A0B424D7 6CCD 465C A90E D5589E73954E Release x64 Build 0 Release x64 EndGlobalSection GlobalSection SolutionProperties preSolution HideSolutionNode FALSE EndGlobalSection EndGlobal 24 Looking at diffing VS project files WHEN thin gs go wrong sIn lt xml version 1 0 encoding Windows 1252 gt lt VisualStudioProject ProjectType Visual C Version 9 00 Na
20. 370 3 i GeForce GTX 295 Quadro FX 380 LP e Windows HPC Server 2008 32 or 64 bit hbe GeForce 8800 GT e Local debugging Headed Mode sors ores Tesla Tesla C2050 Tesla C2070 Tesla C1060 Tesla 1070 GeForce 8800 GTS 512 GeForce 9800 GTX GeForce 9800 GTX GeForce GTS 250 GeForce 9800 GX2 GeForce 9600 GS GeForce 9600 GSO 512 GeForce 9600 GT host and target on same machine e 2 GPUs each must be either a G92 GT200 or TT GPU See below for supported graphics cards e Remote debugging Headless Mode host and target on different machines e On the target machine 1 GPU on target machine must be a G92 GT200 or GT400 GPU e On the host machine with Visual Studio 1 GPU on host machine can be any GPU e Current supported cards at left GeForce G210 GeForce 9400 GT GeForce 9500 GS GeForce GT 120 GeForce 9500 GT GeForce G100 GeForce 9300 GE GeForce 8400 GeForce 9300 SE GeForce 8400 GS GeForce 9300 GS GeForce GT 220 GeForce NVS 2100 GeForce G210 GeForce NVS 3100 GeForce 210 GeForce 310 Nsight Requirements From http http developer nvidia com ParallelNs ight 1 51 UserGuide HTML webframe html Disable D3D acceleration for WPF applies to local debugging only Open Windows xplorer Browse to the Common folder Ona Windows 32 bit system browse to C Program Files NVIDIA Parallel Nsight 1 51 Common GeForce GeForce GTX 580 GeForce GTX 570 GeForce GTX 560 GeForce GTX
21. 6 project HELLO Recurse into the Hello and Demo subdirectories This does not actually cause another CMake executable to run The same process will walk through the project s entire directory structure add_subdirectory Hello add_subdirectory Demo 31 Source http www CMake org CMake help examples html What does CMake Look Like Make sure the compiler can find include files from our Hello library include directories HELLO SOURCE DIR Hello Make sure the linker can find the Hello library once it is built link_directories HELLO BINARY DIR Hello Add executable called helloDemo that is built from the source files demo cxx and demo _b cxx The extensions are automatically found add executable helloDemo demo cxx demo _b cxx Link the executable to the Hello library target link libraries helloDemo Hello 32 Source http www CMake org CMake help examples html What does CMake Look Like CMake provides a GUI CMake GUI Processes root CMakeLists txt file Not CMakelists txt or CMakelist txt or CMakeList txt or CMakelists txt or CMakellSts TxT remember cross platform Linux Allows user to interact with the build and change build parameters Build spec creator can specify their own parameters which appear in the GUI Where to build the binaries recommended out of source builds Delete Cache button was moved to File gt Delete Ca
22. ET MY STR HELLO CACHE STRING hello text FORCE e What does FORCE do e No matter what is typed in the GUI in an attempt to change the variable the variable will always be HELLO e Be careful with FORCE as remember the cache gets reloaded when CMake is run if you decide to change a value from FORCE to not FORCED then you need to delete the cache and regenerate e Anon FORCE example with use of booleans SET MY_BOOL YES CACHE BOOL my boolean fess the user to change MY_BOOL in the GUI and have the modified value change in the cache e Can also use the preferred OPTION MY_BOOL my boolean YES 36 Example Project Bon Checkout using GIT e hitps git cae wisc edu git me964 git Use CAE username and password Run go bat e Extracts CMake from zip archive downloaded from CMake website It is not modified e Launches CMake e Simply for ease of use to get started Configure CMake variables such as e ME964 BUILD BOOST e ME964 USE MATLAB_INTERFACE e ME964 GPU ARCH SM10 11 13 20 37 Example Project Ben 5 CMake 2 8 2 C projects ME964 branches trunk build NR gt e Click Configure ee OO d File Tools Options Help e Click Generate Where is the source code _ C projects ME964 branches trunk Where to build the binaries C projects ME964 branches trunk build as e Batch scripts are an EE M arch Ar 3 Remove Entry created for launching Name Value i
23. Edit Repository Settings Alliance Groups x rin rani Here you can create and edit settings for Repositories hosted f webservers a Email Taale A brief GIT How To HE e Give the repo a name e Set editing group if needed Find available computers o CAE Forms o Account Info Account Details Groups Login History Linux Setup Forwarding a Mailing Lists Mad Usage RRA AREAS o Printing o Disk Space File Manager Web Tools o Personal Wed Page gt MySQL Databases Virtual Hosts gt Virtual Hosts Wed Logs IN Repostories Resources o MSDN Academic Alliance General Tools Directory of Account Management Tools Account Tools Vacation Message TS My CAE Account Brian s CAE Account Account Tools gt Repos gt Manage Repository Manage Repository Use this form create or edit settings on a repository Indicates a required field See https kb wisc edu cae page php id 18796 for help Editing Group Groups must already exist Click Read Group See Editing Group notes above Read Satisfy Whether both all Read Group and Read Networks are required for valid user v read access either any or just Read Networks and any valid user Edi ng Group Are Trac Admins A brief GIT How To lacae e Create an editing group to allow others with cae logins to access your repository e Add group members
24. K_SIZE cudaMalloc amp dev_data size std cout lt lt entry_foo has been entered n dim3 numThreads BLOCK_SIZE BLOCK_SIZE dim3 numBlocks 1 1 1 project1 lt lt lt numBlocks numThreads gt gt gt dev_data cudaMemcpy host data dev_data size cudaMemcpyDeviceToHost for int row 0 row lt BLOCK_SIZE row for int col 0 col lt BLOCK_SIZE col std cout lt lt t lt lt host_data col row BLOCK_SIZE std cout lt lt std endl cudaFree dev_data 46 CMake 20 80 rule e Along the lines of Dan s 20 80 rule e This is more like the 80 1 rule 80 percent of the functions there aren t that many to do 1 of your total development work This 1 of the toal work is build specification And some of these are paired like if else elseif etc so maybe it s like the 40 1 half as much rule with the remaining 99 percent of the number in denominator going to coding in C which is what we should be doing anyway If you look at the example there are even fewer used but this is a simple example CMake allows things to get much much more complicated which is good Complexity when you need it simplicity when you don t add_custom_command 6 add custom target add definitions add dependencies add executable add library add subdirectory break cmake_policy configure _file else elseif endforeach endfunction endif endmacro endwhile
25. ME964 GIT Trac CMake amp CUDA Debugging 666 Spring 2012 eee 660060 Brian J Davis 6 PhD Candidate Biomedical Engineering 66066 Research Assistani 9 e 6 School of Medicine and Public Health 5 e Research Area Medical Physics bdavis5 wisc edu Dan Negrut 2012 ME964 UW Madison Brian J Davis 2012 What this talk is about What 355 hope you to gain from it Your armed with the knowledge to program a GPU now what How to manage track build and debug your CUDA GPU project Using tools like e GIT source control management version control software e Trac bug tracking and documentation wiki e CMake cross platform build specification test case and packaging release tool e Nsight cuda gdb CUDA debugging Though may not go in depth hopefully this will provide at least some exposure to the tools that are out there Source Control Management 333 SCM HE e We have resources at CAE Use them e CAE resources e hitps kb wisc edu cae page php id 22527 e Trac bug tracking with web based source browsing also supported e CAE provides Git HG Mercurial Bazarr and SVN if you have to Trac wiki bug and feature tracking e Wiki allows editing of project documentation through web browser EXAMPLE_SVN_PROJECT File Edit View History kmarks Tools AL EXAMPLE_SVN_PROJECT EXAMPLE_SVN_PROJECT Login Preferences Help Guide About T
26. Message Manna Lats Test git repo Mas usage i Printing Groups must already exist e Disk Space Click here to see your groups 2 Fre Manager or make a new one Web Tools Persons Wen Page 9 MYSQL Oetabases verrast Hosts verrast Hosts Web Logs Repositories Resources b avisS wise edu MSDN Academic Alliance Whether both all Read Group and Read Networks are required for read access either any or just Read Networks and any valid user vald user Trac Readers Can Make Tickets Trac site bem See Trac Interface Customization Site Appearance for syntax and details Leave blank to accept the default styles Trac style css See site html notes above Trac Header Logo Image An image to use as the Trac A favicon ico style image file EEn mn icon displayed in the browser s lo A brief GIT How To e GIT bash will be used for this example e htip msysgit github com e Create a directory for your source e Preferably a short path e Without spaces e used C projects ME964 ME964 2012 trunk 5 MINGW32 c project A brief GIT How To ese e Initialize a GIT repository 4 di d c projects ME964 ME964_2012 trunk e A git directory will be SIOE _2012 trun created git init e Set your username and git config global user name Brian J email address Davis e global can be used to set
27. SWIG C C C Mono Language integration in Linux Check system for build dependencies some do VS not so much e CUDA nvcc Object files to be created from source e Library dependencies VTK ITK etc e What are capabilities versions of C and C stdlib etc Whatever you command them to do MESSAGE Executing world domination script now execute_process COMMAND world_domination bat WORKING_DIRECTORY world_domination_scripts milky_way_galaxy earth INPUT_FILE world_domination cfg OUTPUT_FILE world_domination_result log ERROR_FILE world_domination_error log 21 Build Tools ese e What have used What comparisons can make BorlandBuilder 5 02 Builder C 4 and 6 MS VisualStudio GNU Make autoconf and friends BJam BoostBuildV2 part of Boost C e http www boost org boost build2 e Perforce Software not related to Boost Jam Tutorial only put here due to use of Jam http www perforce com perforce conferences us 2001 wingerd WPLa ura pdf have not used the Perforce version only Boost s version CMake 22 gt gt gt MY OPINIONS lt lt lt Based on What 10 years experience Great for simple projects Unwieldy for complex projects Modal Dialog boxes that can t be resized Build Spec is not searchable Which spec am changing all debug release Is this for 32 or x64 What did change that made the build break know I can diff the sin and prj slide We will t
28. Y which is the path to top of source tree where root CMakeLists txt file is located e Delete cache if necessary if you tried previous project and changed something e Configure and Generate project e Browse to e trunk build ME964 sIn project e trunk source cpp project1_ vanilla Source e Very simple example project is generated Example Project Using Vanilla CMake Root CMakeLists txt file check required version of CMake CMAKE_MINIMUM_REQUIRED VERSION 2 0 IF CMAKE_BACKWARDS_COMPATIBILITY GREATER 2 0 6 SET CMAKE BACKWARDS COMPATIBILITY 2 0 6 CACHE STRING Latest version of CMake when this project was released FORCE ENDIF CMAKE_BACKWARDS_COMPATIBILITY GREATER 2 0 6 if COMMAND cmake_policy cmake_policy SET CMP0003 NEW endif COMMAND cmake_policy Declare the project PROJECT ME964 SET MY_STR HELLO CACHE STRING hello text FORCE SET MY_BOOL YES CACHE BOOL my boolean add_subdirectory source cpp project_vanilla src project_vanilla 42 Example Project Using Vanilla CMake 5 e _cmake policy As CMake evolves it is sometimes necessary to change existing behavior in order to fix bugs or improve implementations of existing features The CMake Policy mechanism is designed to help keep existing projects building as new versions of CMake introduce changes In behavior Each new policy behavioral change is given an identifier of the form CMP lt NNNN gt where
29. ake a look at those next slide All seems hidden behind GUI which is difficult access change and maintain Especially with broad sweeping changes Ok there is project inheritance There is also nmake as an alternative Good for wear leveling of your mouse al through increased use of right clic A AA ae ze Se xoqiooL X TENEN E C7 Solution dvip4 20 projects a a ALL BUILD ga cpu_matrix test app 5 Wy Source Files cpu_matrix_test_app cpp CMakeLists txt fez cuda_memcpy_block_test lez dsacudautil H lez dsamexlib H lEz dsamexmatrixtest 6 GA ffo co A fftFilterPlugin S GA fmt_reg_plugin ca A GP_Loader gi gpu_backprojection_test_app 6 O CMake Rules S EY Source Files gpu_backprojection_test c CMakeLists txt a gpu_backprojection_test_app_ gpuBackprojection cu 5 gpuBackprojectionPlugin ca Gl CMake Rules 5 By Source Files gpuBackprojection cpp LJ CMakeLists tct gpuBackprojection cu 2 gpuBackprojectionPlugin_gen fez gpuReconPlugin GA gpuReconSingleProjectionPlugin H Cl CMake Rules a i Source Files LJ CMakeLists bt Visual Studio as a build tool I File Edit View Project Build Debug Tools Test Window Help J gt Debug KME EIER TEEECEFEEN DEBUG DISPLAY IE oF ey se Lv laf x Properties Global Scope cpu_matrix_test_app Property Pages cpu_matrix_test_app Project Properties ME x
30. bug e Heisenbug A bug that disappears or alters its behavior when one attempts to probe or isolate it This usage is not even particularly fanciful the use of a debugger sometimes alters a program s operating environment significantly enough that buggy code such as that which relies on the values of uninitialized memory behaves quite differently Antonym of Bohr bug Mandelbug Mandelbrot A bug whose underlying causes are so complex and obscure as to make its behavior appear chaotic or even non deterministic e Schroedinbug Schroedinger s Cat thought experiment A design or implementation bug in a program that doesn t manifest until someone reading source or using the pode In an unusual way notices that it never should have worked at which point the program romptly stops working for everybody until fixed Though like bit rot this sounds impossible it happens some programs have harbored atent schroedinbugs for years e Phase of the Moon bug The phase of the moon is sometimes spouted as a silly parameter on which a bug might depend such as when exasperated after trying to isolate the true cause The Jargon File documents two rare instances in which data processing problems were actually caused by phase of the moon timing Think Y2K Yes computers do manifest certain weird behavior based on the alignment of the planets Statistical Stat bug Statistical bugs can only be detected in aggrega
31. che in newer versions 2 6 When generating build specs use copious amounts of Delete Cache and wish it were still a button speed File Tools Options Help Where is the sourcecode C projects ME964 ME964_2012 trunk Where to build the binaries C projects ME964 ME964_2012 trunk build v Browse Build Search boost E Grouped T Advanced X Remove Entry Name Value c BOOST_SHORT_VERSION 141 BOOST_SYSTEM_LIB boost_system BOOST_VERSION 1410 ME964_BOOST_ADD_SUBDIRECTORY ME964_BOOST_EXTERNALPROJECT_ADD ME964_BOOST_JAM_BUILD RATALA NANINGCT COUN OLIFANT DET D lt 4 m j Press Configure to update and display new values in red then press Generate to generate selected build files Current Generator Visual Studio 9 2008 Win64 CMAKE SYSTEM NAME Windows A THIRD PARTY BASE DIR NATIVE C projects MES64 ME964 2012 trunk yvast pro SE THIRD PARTY BASE DIR C projects ME964 ME964_ 2012 trunk test_proj_third_pi WORKING DIR C projects MES64 ME964 2012 trunk test proj thir WORKING DIR C projects MES964 ME964 2012 trunk test proj thit wr r posted a desirement in the CMake Mantis bug tracker only to find out that all one has to do in CMake GUI is File gt Delete Cache then config config generate wait for CMake VS Macros to notice something is awry and update the projects still wish there were a button If could get a heart rate monitor to sense my leve frustration and
32. com parallel nsight videos Nsight in Action Profiler WAN NVIDIA NVIDIA Instructional Video http developer nvidia com parallel nsight videos cuda gdb e More evolved than Nsight though v2 0 is promising e Released before Nsight e DDD with cuda gdb e ddd debugger cuda gdb e Emacs below text is from the url at the bottom of the slide CUDA GBD works with GUD in Emacs and XEmacs No extra step is required besides pointing to the right binary To use cuda gdb the gud gdb command name variable must be set to cuda gdb annotate 3 Use M x customize variable to set the variable Ensure that cuda gdb is present in the Emacs XEmacs PATH http developer download nvidia com compute cuda 4 0 rc2 toolkit docs cud a gdb pdf pg 16 cuda gdb e Remote ssh for instance remote debug my single gpu on my laptop using a remote ssh session e have had success using this method e ssh X usernam wherever e Stop your display manager Ubuntu 10 10 x64 cmd shown below using gnome e sudo stop gdm e set PATH and LD_LIBARY_PATH as necessary e ddd debugger cuda gdb app name OpenCL er what En e Q Is there a OpenCL debugger There is some support for OpenCL in Parallel Nsight e Remember what said If it doesn t have a debugger don t use it e When OpenCL does then Il switch http developer nvidia com cuda faq
33. d entry_foo void float dev_data size_t size BLOCK_SIZE 19 float host data BLOCK SIZE 20 cudaMalloc amp dev data siz 21 22 std cout lt lt entry foo ha 23 dim3 numThreads BLOCK SIZE 24 dim3 numBlocks i 1 1 25 projecti lt lt lt numBlocks numT 26 Name 27 cudaMemcpy host data dev Namesthefile object d This is a CMake function written to simplify the common usage of creating an application NOT part of the vanilla CMake install 39 Example Project ase e What did add add project not fully implemented it s a Work in Progress WIP really just a place holder for now Goal was to have namespace resolution at least a form that would be possible in CMake by prepending variables with project name add_project_configuration allows specification of a configuration which can be inherited add_project_executable creates a executable and can inherit project configurations multiple add project library creates a library which compiles C C CUDA and can inherit configurations multiple patch patches files unpack unzips tar bz2 and zip e Remember CMake was unmodified these scripts are in the CMake project specific directory at root of tree e CMake build tool and related source is found in platform 3rdParty tools directory when extracted from zip archive 40 Example Project Using Vanilla 332 CMake sss e Browse to location of CMAKE_HOME_DIRECTOR
34. e Very simple example project is generated e Uses SAP my CMake code Submitted as feature request e http www CMake org Bug view php id 1 1807 e NEVER USE SEMICOLONS AFTER COMMANDS IN CMake can lead to all kinds of confusion as to where the error is add project executable the name of your executable project1 Defines if you need any DEFINES MY _DEF 1 A list of cu sources CU_SOURCES project1 cu A list of cpp sources CPP_SOURCES main cpp INCLUDE_DIRECTORIES include INSTALL_DIRECTORIES bin m lt P ME964 Microsoft Visual Studio pS jes File Edit View Project Build Debug Tools Test Window Help 2 projectl cu 3 Gd ZERO CHECK E Solution Explorer Zj Class View mp gpp NAHEN NE ae hAl se 2 Oel g DLA S J Solution ME964 4 projects D a GA ALL_BUILD D 5 e GA INSTALL S ga projectl 25 Source Files 3 EEN 5 CMakeLists tt g ir Ik b Debug x64 DEBUG_DISPLAY hd aI ke MET lij A G A Me z project1 cu x Properties va x 1 main cpp File Properties 2 2 slA j F 3 include lt iostream gt Belt a iz 4 include lt cuda h gt B Misc oe 5 Name main cpp m 6 __global_ void projecti floa Content False 3 7 E File Type C C Code E 8 int AMERS gep Full Path C projects ME964 bran_ 4 data index index Included In Project True Relative Path C projects ME964 brar define BLOCK SIZE 8 voi
35. execute_process export file find_file foreach function if include include_directories install link_directories macro message option project return set string target link libraries while add custom _command 47 6660 coco m eee CMake project regeneration a e lf VS is open and CMake Automatically reload and build NT CMake regenerates CMake has regenerated 5 sIn and or vcproj files project files the dialog cic to the left will appear ine o eload the whole selon and speld e CMake cannot be ng Ce el ey pon eh naa e used it is locked up pdhal madang nen until this dialog in VS is accepted Yes and any remaining Regenerate project dialogs that may appear Vanilla CMake Example Cont e run program txt which becomes run_program bat after configure_file e Note SOME_VAR usage Will be replaced with value defined in CMake when bat file is generated e cmd k e Just keeps command window from disappearing so commands can be typed after double clicking bat file in file explorer e PWD sets present working directory to current directory run_program ixt SET PWD CD echo SOME_VAR cmd k v Run through configure_file with some _var set to SET SOME VAR Hello World run_program bat 4 SET PWD CD echo Hello World 49 cmd k CMake Macros Functions and Parse Arguments e When writing your own functions and macros you ll
36. g ON dils out from under eye eae Matlab SO long dS size orig_ array G P Loader is set to size ret_array x if isempty find ret_array array build last disp TEST PASSED else disp TEST FAILED end ret_array GP_Loader plugin array MATLAB C interface e Enabeling ME964 USE MATLAB INTERFACE in CMake will generate projects boost 1 41 0 GP Loader matrix test app matrixlib mex interface plugin test mexmatrixlib utility Solution me964 13 projects 4 IA ALL BUILD H EA boost 1410 B A GP_Loader A INSTALL EA libv 4 A matrix_test_app I o a l LE ay Solution Explorer 2 Class View za Call Browser Find Results 1 Ready a 2 mes Nh Vo Sudo b D dd el 5 Wa Ur MATLAB C Interface ese mex_function is entry point that GP_Loader seeks to find Note that the standard MATLAB function is mexFunction as it is inside GP_Loader Shows use of print array print_dimensions and get data _ptr Print calls use LOG EVENT and are written to log file as defined by log_file_ name me964 log in event_logger cpp as built in the utility library Use mxReal for real data and mxComplex for complex data Complex data was tested with FFT library so this should work Here data tis typedef float data t Gateway function ifdef __cplusplus extern C pragma message building for C endif void mex_function int nl
37. hs mxArray plhs int nrhs const mxArray prhs try Check if there are the correct number of arguments if check_number_matricies NUM_ARGS nrhs return create a matrix object for the projection data mex_matrix lt data_t gt data_matrix amp prhs MATRIX_DATA INDEX LOG_EVENT LOG_STATUS matrix dimensions n data_matrix print_dimensions data_matrix print_array if nrhs gt 0 mex_matrix lt data_t gt ret_data_matrix amp plhs 0 data_matrix get_dimensions mxREAL memcpy ret_data_matrix get_data_ptr data_matrix get_data_ptr ret_data_matrix get_size_in_bytes sale std exception amp e LOG_EVENT LOG_ERROR Error s n e what LOG_EVENT LOG STATUS TEST END n ifdef cplusplus endif 61 CUDA Debugging HH e Bug types e Why use a debugger e Where did printf go e Current state of tools e NSight e cuda gdb Open C L might at this point be better off programming an 256x256x256 array of industrial robots to move around beads on a matched series of abacuses At least could physically see where the problem was occurring Brian J Davis NVIDIA Developer Zone posting NSIGHT Confused by shows know am confused 2011 Bug types Ben e Bohr bug A repeatable bug one that manifests reliably under a possibly unknown but well defined set of conditions Antonym of heisen
38. is a feature of the Windows operating system which detects response problems from a graphics card and recovers to a functional desktop by resetting the card If the operating system does not receive a response from a graphics card within a certain amount of time default is 2 seconds the operating system resets the graphics card Before TDR existed problems of this nature would have resulted in a system freeze and required a reboot of the operating system If TDR is enabled and you see the TDR error Wa Display driver stopped responding and has recovered this means that the Windows operating system reset the display driver refrence Nsight User manual TDR crashes will also be seen on long running kernels on single gou computers Headless Mode now called Remote Mode Used when there is no display Connections are made remotely from client running Nsight have not tried this yet as run headed mode with multiple GPUs 69 Nsight Requirements From http http developer nvidia com ParallelNs ight 1 51 UserGuide HT ML webframe html OS GeForce GeForce GTX 580 GeForce GTX 570 GeForce GTX 560 GeForce GTX 480 GeForce GTX 470 Quadro Quadro 6000 Quadro 5000 Quadro 4000 Quadro FX 4800 Quadro CX e Geforce GTX 460 Quadro FX 5800 Quadro FX 3800 e Windows Vista 32 or 64 bit with SP1 or Sia SI 2 Kasa ee GeForce GTX 275 Quadro FX 380 e Windows 7 32 or 64 bit or GeForce GTX 285 Quadro FX
39. lude directories Need to use CUDA_ADD_LIBRARY or CUDA ADD EXECUTABLE which is from part of FindCUDA when we called find_package CUDA Set link flags to export function in dll Specify where to install the app and lib in S CMAKE INSTALL PREFIX V bin and S ICMAKE INSTALL PREFIX lib respectively Configure a file which uses a variable in the file throug use of syntax SOME VAR o When Configured the place holder in the file will be replaced with the value LE FARDE WHERE CMake WOULD LIKE TO INSTALL THE FILES ET CMAKE_INSTALL_PREFIX CMAKE_HOME_DIRECTORY install CACHE STRING FORCE include_directories include SET MY_LIB_NAME libv SET MY_APP_NAME project_vanilla for normal C C code add_library would be used but since this contains a cu file CUDA_ADD_LIBRARY must be used CUDA_ADD_LIBRARY MY_LIB_NAME project_vanilla cu libv cpp need to export the function set_target_properties SN Ee NAME PROPERTIES LINK_FLAGS export my_entry_function add_executable MY_APP_NAME main cpp target_link_libraries MY_APP_NAME MY_LIB_NAME install TARGETS MY_APP_NAME DESTINATION bin install TARGETS MY_LIB_NAME DESTINATION lib SET SOME_VAR This is what gets put in run_program bat when configured 44 configure_file run_program txt CMAKE_INSTALL_PREFIX bin run_program bat Vanilla CMake e Directory listing If you want find and grep in Windows then
40. me CudaCollision ProjectGUID O8C6F31 1 7AA6 46EB BFB9 7F947F5DD014 RootNamespace CudaCollision Keyword x64Proj TargetFrameworkVersion 0 gt lt Platforms gt lt Platform Name x64 gt lt Platform Name Win32 gt lt Platforms gt lt ToolFiles gt lt DefaultToolFile FileName NvCudaRuntimeApi v3 2 rules gt _ Blah Blah Blah GOBS and GOBS more where this came from lt File RelativePath cuda_timer cu gt lt File gt lt Files gt lt Globals gt lt Globals gt lt VisualStudioProject gt 25 What does VS do eee e Ok well prj is better than sIn not that don t like looking at hash codes or anything e counted 698 lines ok well SciTE http www scintilla org SciTE html line numbering did of good wholesome xml e Seriously 698 lines of xml to specify 1 executable CollisionDetection to generate a handfull of command lines e Who s selling hardrives these days need to invest e The point here is that this is the text output which can be viewed and diffed with diff tools and should be preferably clean and it should be a relatively short time to figure out what changed and broke the build What is CMake sd e From http www CMake org Welcome to CMake the cross platform open source build system CMake is a family of tools designed to build test and package software CMake is used to control the software compilation process using simple pla
41. me go to the source hey man am just Spreading the word e Google Tech Talk e CMake CPack CTest CDash Open Source Tools to Build Test and Deploy C Software e htto AWwww youtube com watch v 8Ut9040dSCO08 amp feature youtube gdata am not affiliated in any way with Kitware am just trying to get my code to compile on Microsoft Windows and Linux 19 The Source oes e CMake by Kitware http www CMake org Documentation e http www cmake org cmake help documentation html e htto www cmake org cmake help cmake 2 8 docs html FAQ e htto Awww CMake org Wiki CMake FAQ Download e http www CMake org CMake resources software html Source Repository e http Awww CMake org Wiki CMake Git Tutorial e hitp www CMake org CMake help CMake tutorial html Go right to the source and ask the horse He ll give you the answer that you ll endorse He s always on a steady course Talk to Mr Ed Theme song Mr Ed 1961 1966 Build tools what do they do Check dependencies e You changed a source file and the obj file needs to be rebuilt which then rebuilds the dll or exe e Controls what gets built in what order Execute generators e Such as the compiler which coverts source to output files e Generate configuration files e Specify install and testing locations and put all files in correct locations e Generate code Lexx Yacc or Flex and Bison Extended Backus Naur Form EBNF context free grammars
42. mmand prompt cursor must have been exhausted had never seen the little guy do so much tearing across the screen to build a SrdParty Package Thankfully he was still blinking at the same rate as when he started tough little bugger e vowed never to use CMake after that Well then 2009 rolled around and the need to use VTK ITK demtk boost etc all of witch had versions which used CMake Quoting Homer Simpson not Greek poet of Iliad D oh What else is CMake ose e What is meant by family of tools e CTest and CDash e Automated test CTest and reporting CDash e http www cdash org CDash index php project CMake e CPack e Package software for distributions e We will focus on CMake in this talk Why use CMake esee e Cross platform support e Plain text files for build specification which can be tracked and diffed WinMerge Meld easily with source control tools git e http winmerge org e http meldmerge org e Code generation configuration file generation and text manipulation with configure_file e Powerful scripting e Create your own generator e Regular Expressions e Not an exhaustive list What does CMake Look Like The name of our project is HELLO CMakeLists files in this project can refer to the root source directory of the project as HELLO SOURCE DIR and to the root binary directory of the project as HELLO_ BINARY DIR cmake_minimum_required VERSION 2
43. nerate a lot of text How do read this text This text has to be copied over to the CPU Who s going to read all that text Even armed with grep not me Should be optimizing GPU code for calculation throughput not printf statements 65 urrent Tools From NVIDIA s Website http developer nvidia com to ols ecosystem Debugging There are likely more as this is not meant to be an 5 DEBUGGING amp PROFILING COMPANY ORGANIZATION BRIEF DESCRIPTION A single tool that can debug hybrid MPI OpenMP and CUDA applications on a single workstation or GPU cluster exhaustive list and discussion of every debugger This talk will focus on 2 TotalView NVIDIA CUDA GDB Allows Linux X86 64 users to debug both the CPU and the GPU code in CUDA applications using familiar TotalView GUI methods The CUDA GDB debugger is an extended version of the open source gdb debugger providing seamless native hardware debugging across CPUs and GPUs e Parallel Nsight e cuda gdb is Visual Profiler was covered in a previous talk Parallel Nsight Visual Profiler NVIDIA CUDA MEMCHECK NVIDIA Parallel Nsight is a free powerful plugin that allows programmers to develop for both GPUs and CPUs within Microsoft Visual Studio Visual Profiler is a cross platform performance profiling tool that delivers developers vital feedback for optimizing CUDA C C and OpenCL a
44. pplications CUDA MEMCHECK checks for misaligned memory out of bounds address 64 many other application errors Parallel Nsight Ben e CUDA C C D e b u g g n g All NVIDIA Parallel Nsight Professional features are now available free of charge in a no cost download e CUDA Kernel Feature Trace P rofi ng Integrated into Parallel Nsight Features No cost Download Visual Studio 2008 SP1 9 5 or Visual Studio 2010 e Data breakpoints eS 5 for C U DA C DirectX 10 11 Shader Debugging CO d e DirectX 10 11 Frame Debugging 9 O p e n C L K e rn el DirectX 10 NE nga ernel Trace Profiling Trace Profiling hed 9 OpenCL Kernel Trace Profiling OK but what about debugging DirectX 10 11 API amp HW Trace Data breakpoints for CUDA C C code Now with VS 2010 easten tas o S u ppo rt Tesla Compute Cluster TCC Support Forum Support All Version Upgrades 67 Nsight Monitor and Debugger 33 e Nsight monitor must be started before the program to be debugged can be launched e Nsight debugger attaches to monitor e Secured Connections e Allows only certain computers to connect e File synchronization e Needed if remote debugging and dlls config files etc are needed Nsight Configuration En e Nsight Monitor Headed Mode now called Local Mode Can be used when computer has more than 1 GPUs installed e WDDM TDR TDR stands for Timeout Detection and Recovery This
45. rac RES Timeline Roadmap Prose Source view Tickets Search Start Page Index History Last Change Welcome to Trac 0 11 7 Trac is a minimalistic approach to web based management of software projects Its goal is to simplify effective tracking and handling of software issues enhancements and overall progress All aspects of Trac have been designed with the single goal to help developers write great software while staying out of the way and imposing as little as possible on a team s established process and culture As all Wiki pages this page is editable this means that you can modify the contents of this page simply by using your web browser Simply click on the Edit this page link at the bottom of the page WikiFormatting will give you a detailed description of available Wiki formatting commands trac admin yourenvdir initenv created a new Trac environment containing a default set of wiki pages and some sample data This newly created environment also contains documentation to help you get started with your project You can use trac admin to configure gt Trac to better fit your project especially in regard to components versions and milestones TracGuide is a good place to start Enjoy The Trac Team Starting Points TracGuide Built in Documentation amp The Trac project Trac Open Source Project gt Trac FAQ Frequently Asked Questions TracSupport Trac Support For a complete list of local
46. supported in CMake E but not zip used for unpacking source zip and tarballs Watch for deprecated functions Mostly what see is consolidation consolidating functions into one and 56 increasing parameters which makes sense MATLAB C Interface ese e The example project provides a MATLAB C interface e Activate by enabling ME964 USE MATLAB INTERFACE by using search bar in Cmake GUI e Uses a template class mex_matrix lt T gt e mex_matrix lt float gt data_matrix amp prhs MATRIX_DATA_INDEX e include lt mexlib mex matrix h e Example simply copies a source array to a destination array however by using the T get_ptr function copying data to device memory is straight forward 57 MATLAB C interface HE e Including the full cuda matlab test example would have pulled in too many dependencies from my code base so have the example leaving off at the MATLAB C layer e mex_c_interface m in the directory source Matlab test cases mex c interface contains the matlab test code MATLAB C interface HA addpath genpath f ee e Sets the mex plugin zin to be loaded by y_dim 5 z dim 2 EOS WA GP Loader num_elements x_dim y dim z_dim array 1 num_elements e GP Loader allow helpe anal x_dim y dim z_dim for a generic dll me dims size orig_array loader to call the 1 mex fu nction and array single array plugin mex_interface_plugin_test allows swappin
47. tes and not in single runs of a section of code These are bugs that usually affect code that is supposed to produce random or pseudo random output e Source http en wikipedia org wiki Jargon_File Jargon File http Awww catb org jargon e http www dourish com goodies jargon html e The Meaning of hack http Awww catb org jargon html meaning of hack html 63 Why use a debugger ee e Clean code no need to sprinkle with printf ifdef DEBUG endif or macros e Zero in on the thread block and grid ID that is causing the problem and see state of variables e Set watch points and if equals less and more boolean operations etc e lf it Language does not have a debugger in this day and age don t use it i e don t waste my time except for playing Angry Birds but that s a choice e SAVE TIME SAVE TIME SAVE TIME That can be better utilized playing Angry Birds or sailing 64 Where did printf go ae e Removed prior to 3 0 not sure exactly release NVIDIA CUDA Linux Release Notes Version 3 1 e Added the ability to call printf from kernels This feature is supported only on the Fermi architecture e Even a better question why printf in the first place Let s think about this for a second Which thread in what block int the grid is this printf running e When does it run Might need it in he future so add a define ifdef endif Result messy code Without if statements this can ge
48. tform and compiler independent configuration files CMake generates native makefiles and workspaces mag can be used in the compiler environment of your choice Product of Kitware due to the need for a cross platform build environment for Insight Segmentation and Registration Toolkit ITK as part of the Visible Human Project Meta build HE e Meta build tool e A built tool that builds build files defined by build specifications CMakeLists txt files e CMakeLists txt files which generate Make Linux and friends and Nmake on Windows or project files VS e Borland Makefiles MSYS Makefiles MinGW Makefiles NMake Makefiles NMake Makefiles JOM Unix Makefiles Visual Studio 10 Visual Studio 10 Win64 Visual Studio 6 Visual Studio 7 Visual St udio bs NEL isual Studio 8 2005 Visual Studio 8 2005 Wind Visual Studio 9 2008 Visual Studio Watcom Wmake CodeBlocks MinGW Makefiles CodeBlocks NMake Makefi les CodeBlocks Unix Makefiles Eclipse CDT4 MinGW Makefiles Eclipse CDT4 NMake Makefiles Eclipse CDT4 Unix Makefiles e First experience before drinking the coolaid was with cygwin where CMake bootstraped itself built itself which was then used to generate the build files for ITK which were then used to build ITK using GNU Make This resulted in a 4 stage to compile Awesome Jbootstrap make make install Run CMake to generate Makefiles Build VTK using gnu make and makefiles e was flabbergasted and my co
Download Pdf Manuals
Related Search
Related Contents
Harbor Freight Tools 1000 lb. Capacity 9 in. x 72 in. Steel Loading Ramps, Set of Two Product manual traite des femmes Dossier pédagogique PDFファイル - 医薬品医療機器総合機構 Istruzioni per l`uso Copyright © All rights reserved.
Failed to retrieve file