CUDA Visual Studio 2010 Express build error

南笙酒味 提交于 2019-12-05 15:55:36
jz70

The following worked for me. Edit the file *C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\CUDA 5.0.prop*s. Search for PlatformToolset and add an entry for Windows7.1SDK. Set the value to 2010.

<CudaClVersion Condition="'$(PlatformToolset)' == 'Windows7.1SDK'">2010</CudaClVersion>

The answer is two-fold. The HANDLE_ERROR build error you're getting using the v100 platform is related to the HANDLE_ERROR function being defined in the additional headers for the book "Cuda By Example" - I recognize the example, so I assume that's the code you're trying to compile. You haven't included this filem because it's not listed in the book code listings ... a small oversight from the author(s), imho.

You can download the code examples, and the additional header "book.h" you need from the book page:https://developer.nvidia.com/content/cuda-example-introduction-general-purpose-gpu-programming-0

For reference, this is the HANDLE_ERROR code from book.h:

static void HandleError( cudaError_t err,
                     const char *file,
                     int line ) {
if (err != cudaSuccess) {
    printf( "%s in %s at line %d\n", cudaGetErrorString( err ),
            file, line );
    exit( EXIT_FAILURE );
  }
}
#define HANDLE_ERROR( err ) (HandleError( err, __FILE__, __LINE__ ))

This is because visual studio doesn't have the privilege to access the Temp folder.

navigate to C:\Users\userName\AppData\Local\Temp and change the access security rules of the current user (in this case it is userName) to full control

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!