天天看點

NVIDIA Jetson TK1學習與開發(六):如何安裝CUDA

本文介紹如何安裝cuda,以cuda6.0為例介紹。

download the .deb file for the cuda toolkit for l4t either using a web browser on the device, or download on your pc then copy the file to your device using a usb flash stick or across the network. (make sure you download the toolkit for l4t and not the

toolkit for ubuntu since that is for cross-compilation instead of native compilation).

on the device, install the .deb file and the cuda toolkit. eg:

add the 32-bit cuda paths to your .bashrc login script, and start using it in your current console:

verify that the cuda toolkit is installed on your device:

if you think you will write your own cuda code or you want to see what cuda can do, then follow this section to build & run all of the cuda samples.

install writeable copies of the cuda samples to your device's home directory (it will create a "nvidia_cuda-6.0_samples" folder):

build the cuda samples (takes around 15 minutes on jetson tk1):

run some cuda samples:

note: many of the cuda samples use opengl glx and open graphical windows. if you are running these programs through an ssh remote terminal, you can remotely display the windows on your desktop by typing "export display=:0" and then executing the program.

(this will only work if you are using a linux/unix machine or you run an x server such as the free "xming" for windows). eg:

note: the optical flow sample (hsopticalflow) and 3d stereo sample (stereodisparity) take rougly 1 minute each to execute since they compare results with cpu code.

some of the cuda samples use other libraries such as openmp or mpi or opengl.

if you want to compile those samples then you'll need to install these toolkits like this:

繼續閱讀