Index of /wiki/ParallelComputingSpring2015/o/stanford/assignments/mp1/

NameLast ModifiedSize
UpParent Directory
FileMakefile2022-06-01 22:51 2k
Filemp1-part1.cu2022-06-01 22:51 5k
Filemp1-part2.cu2022-06-01 22:51 5k
Filemp1-part3.cu2022-06-01 22:51 7k
[TXT]mp1-util.h2022-06-01 22:51 2k
[TXT]mp1_questions.txt2022-06-01 22:51 2k
Welcome to the first Machine Problem! DUE DATE: Thu April 8, 11:59pm SUBMISSION INSTRUCTIONS ========================= You can submit an assignment from any of the cluster machines by using our submit script. Th submit script bundles the entire current directory into a submission. Thus, you use it by CDing to a the directory for your assignment, and running: > cd *some directory* > /usr/class/cs193g/bin/submit mp1 This will submit the current directory as your assignment. You can submit as many times as you want, and we will use your last submission. RUNNING THE ASSIGNMENT ======================= We want to get you up to speed with the nitty gritty details of the environment required by CUDA. We've (hopefully) simplified this by including a Makefile that configures the environment for the pups cluster machines. We will provide a more general makefile in later problems. You can use what we've provided in three ways: 1) RUNNING ON PUPS USING OUR MAKEFILE: ====================================== To compile the three problems (mp1-part1.cu, mp1-part2.cu and mp1-part3.cu), run: > make all This will generate a "part1", "part2" and "part3" executable. When you run this from the shell, it will most probably complain about some shared library. To run any of the problems, you can also use the makefile, like so: > make run1 > make run2 > make run3 This will set the correct shared library path, and run each of the executables. 2) MODIFYING MAKEFILE FOR YOUR OWN MACHINE: =========================================== The details of the installation comes from CUDA's "Getting Started" guides, available here: http://developer.nvidia.com/object/cuda_3_0_downloads.html You can modify our makefile for your own use (which assumes you're running on Mac or Linux), by setting the NVCC and LD_LIBRARY_PATH variables in the makefile to their correct paths for your machine. For 64-bit installations: LD_LIBRARY_PATH := /usr/local/cuda/lib64 For 32-bit installations: LD_LIBRARY_PATH := /usr/local/cuda/lib 3) SETTING GLOBAL ENVIRONMENT FOR CUDA WORK: ============================================= Since you probably want to configure your computer to do cuda work in general, or you might not want to always use the makefile to run an executable, you can set the required environmental variables for your shell using your .profile or .bashrc file. You want to set the nvcc compiler to be part of your path, and you want to set your LD_LIBRARY_PATH to point to the folder where the "libcudart.so" file is. For c-shell variants (the default on pups): setenv PATH $PATH:/usr/local/cuda/bin setenv LD_LIBRARY_PATH /usr/local/cuda/lib For bash variants (the default on macs): export PATH=$PATH:/usr/local/cuda/bin export LD_LIBRARY_PATH=/usr/local/cuda/lib If you're on a 64-bit architecture, you need to use the lib64 directory rather than the lib directory. Any issues should be addressed to the class mailing list (a TA will answer it), or during office hours.
Proudly Served by LiteSpeed Web Server at wrfranklin.org Port 443