Changes

Jump to: navigation, search

GPU610/DPS915 Student Resources

2,507 bytes added, 18:40, 22 February 2018
Visual Studio 2017 and CUDA 9.1 Problem
{{GPU610/DPS915 Index | 2014320171}}
The purpose of this page is to share useful information that can help groups with their CUDA projects.
==BLAS Documentation==
See the [[GPU610/DPS915_BLAS_Documentation | BLAS Documentation Page]]
 
For Documentation on Apple's implementation of BLAS see their
[https://developer.apple.com/library/mac/documentation/Accelerate/Reference/BLAS_Ref/Reference/reference.html docs] which are very easy to read and navigate.
==Getting Started on Mac==
====Troubleshooting====
Problem with CUDA driver version 5.0.24 on MacBook Pro 2012 [http://blogs.adobe.com/premiereprotraining/2012/08/known-issues-with-cuda-5-0-17-driver-including-crashes-and-kernel-panics.html Fix]
 
==Visual Studio Common Problems & Solutions==
=== Cannot Open cublas.lib ===
 
"lnk1104 cannot open cublas.lib"
 
Add cublas.lib to Linker Input.
 
If you included cublas.lib in the linker configuration, but VS cannot find the file you may be building
in Win32 instead of x64 (depending on CUDA installation directory). To build in x64:
# Project Properties (alt+enter)
# Click Configuration Options button
# Active Solution Platform -> Change the dropdown box to x64
# Close, OK
# Try to build now
(Boris Bershadsky + Yehoshua Ghitis)
 
=== Cuda Win32/x64 Library ===
 
After following the instructions,,provided in today's lecture, to setting up the library and include files in the project properties to run Cuda on VS 2012 Express at home, I still encounter
the linker error; "unable to find cuda_runtime.h". Googling around, there are two ways around this. By default, VS Studio uses the 32bit debugger, which you can change in project properties. You will have to
use the Win32 version of the library directives (ie in my case "C:\Program Files\NVIDIA Corporation\NvToolsExt\lib\Win32") with the default debugger. If use the x64 library files, change the debugger to 64bit (which I neglected and lost a good portion of time). Cheers.
 
-- Peter Huang
=Ubuntu 12.04 LTS and CUDA 5 Toolkit Installation Guide=
[http://www.svgalib.org/ svgalibs link]
== Nvcc nvcc cannot find header files ==
a.k.a. Dun Goofing where nvcc locates its header files - as experienced by Neil Guzman
Hope this helps anyone, as it insanely irritated me as changing up the environment path on windows did nothing.
 
== Cuda Win32/x64 Library ==
 
After following the instructions,,provided in today's lecture, to setting up the library and include files in the project properties to run Cuda on VS 2012 Express at home, I still encounter
the linker error; "unable to find cuda_runtime.h". Googling around, there are two ways around this. By default, VS Studio uses the 32bit debugger, which you can change in project properties. You will have to
use the Win32 version of the library directives (ie in my case "C:\Program Files\NVIDIA Corporation\NvToolsExt\lib\Win32") with the default debugger. If use the x64 library files, change the debugger to 64bit (which I neglected and lost a good portion of time). Cheers.
 
-- Peter Huang
== Dynamically Allocated Shared Memory ==
}
</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:
*If you haven't already done so, install the optional '''Visual Studio 2015 (v140)''' component which is available from the Visual Studio 2017 installer.
*From Visual Studio, create a CUDA 9.1 project, then 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" (you will find 2 occurrences). Then replace the first entire line with <code><nowiki><Import Project="$(CUDAPropsPath)\CUDA 9.1.props" /></nowiki></code> and the second entire line with <code><nowiki><Import Project="$(CUDAPropsPath)\CUDA 9.1.targets" /></nowiki></code>.
*Close the file in the text editor then re-open the solution in Visual Studio. You should now be able to add your .cu files, build and run.
100
edits

Navigation menu