2013-10-14 4 views
7

मैं सिर्फ CUDA स्थापित किया है और निम्नलिखित किया गया है http://docs.nvidia.com/cuda/cuda-getting-started-guide-for-mac-os-x/index.htmlCUDA काम कर पाने के लिए कोशिश कर रहा है, नमूना helper_cuda.h नहीं मिल सकता है

सब कुछ काम करता है जब तक मैं करने के लिए ~/डेस्कटॉप ऐसे deviceQuery के रूप में एक नमूना कोड को कॉपी करें और संकलन करने की कोशिश ।

मैं संकलन पर निम्न त्रुटियों मिलती है:

/Developer/NVIDIA/CUDA-5.5/bin/nvcc -ccbin g++ -I../../common/inc -m64 -Xcompiler -arch -Xcompiler x86_64 -gencode arch=compute_10,code=sm_10 -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=\"sm_35,compute_35\" -o deviceQuery.o -c deviceQuery.cpp 
deviceQuery.cpp:23:25: error: helper_cuda.h: No such file or directory 
deviceQuery.cpp: In function ‘int main(int, char**)’: 
deviceQuery.cpp:111: error: ‘SPRINTF’ was not declared in this scope 
deviceQuery.cpp:116: error: ‘_ConvertSMVer2Cores’ was not declared in this scope 
deviceQuery.cpp:206: error: ‘checkCudaErrors’ was not declared in this scope 
deviceQuery.cpp:230: error: ‘checkCudaErrors’ was not declared in this scope 
deviceQuery.cpp:241: error: ‘checkCudaErrors’ was not declared in this scope 
make: *** [deviceQuery.o] Error 1 

कोड संकलन और CUDA निर्देशिका में चलाने के लिए और यह स्पष्ट है कि संकलक helper_cuda.h नहीं मिल रहा है, मैं यह नहीं मिल सकता है या तो किसी के पास कोई समाधान है?

उत्तर

18

जैसा कि आपके संकलन विकल्प -I../../common/inc, helper_cuda.h द्वारा इंगित किया गया है $CUDA_HOME/samples/common/inc/ में स्थित है।

आप एक स्वनिर्धारित जगह पर नमूने की प्रतिलिपि बनाना चाहते हैं, तो आप पूरे samples निर्देशिका कॉपी, या कुछ कोड को संशोधित/संकलन विकल्प common/ dir में कर्मचारियों को शामिल करने के लिए है।

0

http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#environment-setup

NVIDIA CUDA टूलकिट स्रोत के रूप में नमूना कार्यक्रम भी शामिल है। आपको उन्हें ~/NVIDIA_CUDA-8.0_Samples में बदलकर और टाइपिंग को संकलित करके संकलित करना चाहिए। जिसके परिणामस्वरूप बाइनरी ~/NVIDIA_CUDA-8.0_Samples/bin

के तहत रखा जाएगा बस सुनिश्चित हो:

$ export PATH=/usr/local/cuda-8.0/bin${PATH:+:${PATH}}

$ export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64\ ${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

$ nvcc -V

संस्करण को दिखाने चाहिए।

$ cd ~/some_path/NVIDIA_CUDA-8.0_Samples

$ make

संबंधित मुद्दे