2011-02-02 4 views
2

をコンパイル:CUDAは、次のように私は私の最初のCUDAコードを記述誤り

#include<iostream> 

__global__ void kernel() 
{ 
} 

int main() 
{ 
    kernel<<<1, 1>>>(); 
    std::cout<<"hello world"<<std:endl; 
    system("pause"); 
    return 0; 
} 

をそして、私はこれらの2つのページ上の指示に従って次のVisual Studio 2008のセットアップ:

しかし、コンパイルした後にエラーが発生します。私は問題が何か、あるいはどこが間違っているのか分からない。以下は、32ビットWindows 7システムで実行されているビルド出力ウィンドウの内容です。

1>------ Build started: Project: CUDA, Configuration: Debug Win32 ------ 
1>Compiling with CUDA Build Rule... 
1>"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v3.2\\bin\nvcc.exe" -gencode=arch=compute_10,code=\"sm_10,compute_10\" -gencode=arch=compute_20,code=\"sm_20,compute_20\" --machine 32 -ccbin "d:\Program Files\Microsoft Visual Studio 9.0\VC\bin" -Xcompiler "/EHsc /W3 /nologo /O2 /Zi /MT " -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v3.2\\include" -maxrregcount=32 --compile -o "Debug/main.cu.obj" main.cu 
1>main.cu 
1>Catastrophic error: cannot open source file "C:/Users/露隆/AppData/Local/Temp/tmpxft_000011e4_00000000-8_main.compute_10.cpp1.ii" 
1>1 catastrophic error detected in the compilation of "C:/Users/露隆/AppData/Local/Temp/tmpxft_000011e4_00000000-8_main.compute_10.cpp1.ii". 
1>Compilation terminated. 
1>Project : error PRJ0019: A tool returned an error code from "Compiling with CUDA Build Rule..." 
1>Build log was saved at "file://c:\Users\丁\AppData\Local\NVIDIA Corporation\NVIDIA GPU Computing SDK 3.2\C\src\CUDA\Debug\BuildLog.htm" 
1>CUDA - 1 error(s), 0 warning(s) 
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== 

この問題を解決するために手伝ってください。 SDK srcディレクトリでいくつかの例を実行しましたが、コンパイルしてdeveicQueryの例を正常に実行できますが、BandWithTestをコンパイルしようとすると、同じエラーが発生します。

+2

[CUDAプロジェクトをコンパイル中にcpp1.iiファイルを開くことができません](http://stackoverflow.com/questions/3615750/unable-to-open-cpp1-ii-file-while-compiling-cuda-プロジェクト) –

答えて

2

ディレクトリ名に非ラテン文字が含まれている可能性があります。問題が発生している可能性があります。そのような文字がないディレクトリにツールキットとプロジェクトを入れてみることはできますか?また、TMPDIR環境変数とTEMPDIR環境変数(私はそれらを正しく記憶していると思います)をラテン専用パスにも指す必要があります。

問題が解決しない場合は、ここに投稿してバグを提出してください(既に登録済みの開発者になる必要があります)。

+0

私は同意します - コンパイラはオープンできないために失敗します(通常、ディレクトリが存在しない、ディレクトリが見つからない、またはファイルが読み取り専用のフラグが立てられていることを意味します)。あなたの場合、私はそれが上記の理由だと推測しています。 – Marm0t

関連する問題