Changes

Jump to: navigation, search

GPU610/DPS915 Student Resources

1,470 bytes added, 19:11, 22 February 2018
no edit summary
}
</pre>
 
= Visual Studio 2017 and CUDA 9.1 Problem =
I ran into this problem when trying to build '''thrust_sort.cu''' in the Thrust lecture. The only way I was able to build and run successfully was to create a '''CUDA 9.1 project'''. However, in the current version of Visual Studio 2017, unless you set the '''Platform Toolset''' to '''Visual Studio 2015 (v140)''', you will not be able to build and run CUDA 9.1 projects. This can be done by going to project properties, then to the General section, then changing the '''Platform Toolset'''. However, this is where I ran into a problem where Visual Studio would display an error and would not let me change the platform toolset. So I came up with the following workaround and it works:
*Close the solution.
*Using a text editor, open <project name>.vcxproj
*Add the following as the first element in the XML under the '''Project''' tag:
<nowiki><PropertyGroup>
<CUDAPropsPath Condition="'$(CUDAPropsPath)'==''">$(VCTargetsPath)\BuildCustomizations</CUDAPropsPath>
</PropertyGroup></nowiki>
*Replace all occurrences (there are 2 of them) of v141 with v140.
*Search for "CUDA 9.1.props" (you will find occurrences). Then replace the entire line with <code><nowiki><Import Project="$(CUDAPropsPath)\CUDA 9.1.props" /></nowiki></code> and <code><nowiki><Import Project="$(CUDAPropsPath)\CUDA 9.1.targets" /></nowiki></code> respectively.
*Re-open the solution. You should be able to add your .cu files and build and run.
100
edits

Navigation menu