vs2013+GTX1070+cuda8.0+cudnn_v5.1配置

来源:互联网 发布:香掌柜沉香淘宝 编辑:程序博客网 时间:2024/06/02 04:18

参考链接:
1. http://www.cnblogs.com/hzm12/p/6422701.html
2. http://blog.csdn.net/tina_ttl/article/details/51722983 windows7+visual studio 2013+CUDA7.5 编译caffe+配置matcaffe+配置pycaffe

下载微软版caffe: https://github.com/Microsoft/caffe
cudnn v5.1 链接:http://pan.baidu.com/s/1i4Xs5Tj 密码:bur8

问题解决:
1.错误 232 error C1083: 无法打开包括文件: “gpu/mxGPUArray.h”: No such file or directory
解决办法:http://blog.csdn.net/qq_27278153/article/details/53667756

  1. 要把
    1. cuda 驱动路径 如: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\include
    2. D:\caffe-windows\caffe-master\include(解决找不到caffe.hpp)
    3. c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include(解决找不到sstream,原因很可能是因为我装了vs2013后又装了vs2015,造成的问题)

加到matcaffe的包含目录中

注意:
1. !– CuDNN 4 and 5 are supported –
2. <*CuDnnPath>D:\caffe-master\cudnn-8.0-windows7-x64-v5.1</CuDnnPath>*

<?xml version="1.0" encoding="utf-8"?><Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">    <ImportGroup Label="PropertySheets" />    <PropertyGroup Label="UserMacros">        <BuildDir>$(SolutionDir)..\Build</BuildDir>        <!--NOTE: CpuOnlyBuild and UseCuDNN flags can't be set at the same time.-->        <CpuOnlyBuild>false</CpuOnlyBuild>        <UseCuDNN>true</UseCuDNN>        <CudaVersion>8.0</CudaVersion>        <!-- NOTE: If Python support is enabled, PythonDir (below) needs to be         set to the root of your Python installation. If your Python installation         does not contain debug libraries, debug build will not work. -->        <PythonSupport>true</PythonSupport>        <!-- NOTE: If Matlab support is enabled, MatlabDir (below) needs to be         set to the root of your Matlab installation. -->        <MatlabSupport>true</MatlabSupport>        <CudaDependencies></CudaDependencies>        <!-- Set CUDA architecture suitable for your GPU.         Setting proper architecture is important to mimize your run and compile time. -->        <CudaArchitecture>compute_35,sm_35;compute_52,sm_52</CudaArchitecture>        <!-- CuDNN 4 and 5 are supported -->        <CuDnnPath>D:\caffe-master\cudnn-8.0-windows7-x64-v5.1</CuDnnPath>        <ScriptsDir>$(SolutionDir)\scripts</ScriptsDir>    </PropertyGroup>    <PropertyGroup Condition="'$(CpuOnlyBuild)'=='false'">        <CudaDependencies>cublas.lib;cuda.lib;curand.lib;cudart.lib</CudaDependencies>    </PropertyGroup>    <PropertyGroup Condition="'$(UseCuDNN)'=='true'">        <CudaDependencies>cudnn.lib;$(CudaDependencies)</CudaDependencies>    </PropertyGroup>    <PropertyGroup Condition="'$(UseCuDNN)'=='true' And $(CuDnnPath)!=''">        <LibraryPath>$(CuDnnPath)\cuda\lib\x64;$(LibraryPath)</LibraryPath>        <IncludePath>$(CuDnnPath)\cuda\include;$(IncludePath)</IncludePath>    </PropertyGroup>    <PropertyGroup>        <OutDir>$(BuildDir)\$(Platform)\$(Configuration)\</OutDir>        <IntDir>$(BuildDir)\Int\$(ProjectName)\$(Platform)\$(Configuration)\</IntDir>    </PropertyGroup>    <PropertyGroup>        <LibraryPath>$(OutDir);$(CUDA_PATH)\lib\$(Platform);$(LibraryPath)</LibraryPath>        <IncludePath>$(SolutionDir)..\include;$(SolutionDir)..\include\caffe\proto;$(CUDA_PATH)\include;$(IncludePath)</IncludePath>    </PropertyGroup>    <PropertyGroup Condition="'$(PythonSupport)'=='true'">        <PythonDir>C:\Program Files\Anaconda3\envs\py2</PythonDir>        <LibraryPath>$(PythonDir)\libs;$(LibraryPath)</LibraryPath>        <IncludePath>$(PythonDir)\include;$(IncludePath)</IncludePath>    </PropertyGroup>    <PropertyGroup Condition="'$(MatlabSupport)'=='true'">        <MatlabDir>C:\Program Files\MATLAB\R2014a</MatlabDir>        <LibraryPath>$(MatlabDir)\extern\lib\win64\microsoft;$(LibraryPath)</LibraryPath>        <IncludePath>$(MatlabDir)\extern\include;$(IncludePath)</IncludePath>    </PropertyGroup>    <ItemDefinitionGroup Condition="'$(CpuOnlyBuild)'=='true'">        <ClCompile>            <PreprocessorDefinitions>CPU_ONLY;%(PreprocessorDefinitions)</PreprocessorDefinitions>        </ClCompile>    </ItemDefinitionGroup>    <ItemDefinitionGroup Condition="'$(UseCuDNN)'=='true'">        <ClCompile>            <PreprocessorDefinitions>USE_CUDNN;%(PreprocessorDefinitions)</PreprocessorDefinitions>        </ClCompile>        <CudaCompile>            <Defines>USE_CUDNN</Defines>        </CudaCompile>    </ItemDefinitionGroup>    <ItemDefinitionGroup Condition="'$(PythonSupport)'=='true'">        <ClCompile>            <PreprocessorDefinitions>WITH_PYTHON_LAYER;BOOST_PYTHON_STATIC_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>        </ClCompile>    </ItemDefinitionGroup>    <ItemDefinitionGroup Condition="'$(MatlabSupport)'=='true'">        <ClCompile>            <PreprocessorDefinitions>MATLAB_MEX_FILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>        </ClCompile>    </ItemDefinitionGroup>    <ItemDefinitionGroup>        <ClCompile>            <MinimalRebuild>false</MinimalRebuild>            <MultiProcessorCompilation>true</MultiProcessorCompilation>            <PreprocessorDefinitions>_SCL_SECURE_NO_WARNINGS;USE_OPENCV;USE_LEVELDB;USE_LMDB;%(PreprocessorDefinitions)</PreprocessorDefinitions>            <TreatWarningAsError>true</TreatWarningAsError>        </ClCompile>    </ItemDefinitionGroup>    <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">        <ClCompile>            <Optimization>Full</Optimization>            <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>            <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>            <FunctionLevelLinking>true</FunctionLevelLinking>        </ClCompile>        <Link>            <EnableCOMDATFolding>true</EnableCOMDATFolding>            <GenerateDebugInformation>true</GenerateDebugInformation>            <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>            <OptimizeReferences>true</OptimizeReferences>        </Link>    </ItemDefinitionGroup>    <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">        <ClCompile>            <Optimization>Disabled</Optimization>            <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>            <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>        </ClCompile>        <Link>            <GenerateDebugInformation>true</GenerateDebugInformation>        </Link>    </ItemDefinitionGroup></Project>
阅读全文
0 0