I want to develop a program using CUDA but I am getting lost by install instructions on NVidia's site.
So here is what I have:
Windows 10 laptop with a NVidia GPU GeForce GTX 870M
(both OS and GPU driver are up to date)
Visual Studio 2017, Version 15.8 (also up to date) _MS_VER=1915
On this webpage, I found out that my GPU is CUDA enabled (good news) with "Compute capability" 3.0. What does it mean?
I know that CUDA versions are sensitive to the version of Visual Studio used, so
my question is simple:
what version of CUDA should I download and install? and can I build and run programs with my version of Visual Studio?
As far as I know, no version of the CUDA Toolkit currently supports Visual Studio 15.8. The latest CUDA 9.2 supposedly supports up to Visual Studio 15.6. Note that the issue of Visual Studio support really only concerns the NVCC compiler and Visual Studio Integration. There's nothing preventing you from, e.g., using the CUDA Driver API with whatever compiler you wish (including the latest version of VS).
One way around these issues used to be to put your CUDA code into a separate static library, build that with the VS 2015 compilers, and link it to the main project which could be built using VS 2017.
Make sure you have selected the VC++ 2015.3 v14.00 (v140) toolset for desktop package in Visual Studio Installer:
You can then switch the toolset to use for each project in Project Properties > General:
Unfortunately, I've recently encountered some issues with linking binaries built with VS 2015 to binaries built with the VS 2017 15.8 compilers, so that path might no longer work (seemed to be related to the new "Just My Code Debugging" feature). But then, binary compatibility across compiler versions was never really something to rely on in the first placeā¦
Another solution would be to downgrade your Visual Studio to 15.6.
The compute capability of a device basically tells you what generation of GPU architecture you're dealing with and which features you can rely on. Or in the words of the CUDA Programming Guide:
The compute capability of a device is represented by a version number, also sometimes called its "SM version". This version number identifies the features supported by the GPU hardware and is used by applications at runtime to determine which hardware features and/or instructions are available on the present GPU.
More details on individual compute capabilities/architectures can be found, e.g., here.
Related
I have tried and installed every possible combination of Intel SDK toolkits and Visual Studio (2017/19/21) in the hope that the OpenCL integrations (project templates, compiler, and header and libraries) would be added as described here:
https://www.intel.com/content/www/us/en/developer/articles/guide/quick-getting-started-guide-for-opencl-sdk-integration-in-iss-2019.html
It is not quite clear to me what toolkit is currently needed, the links to the Intel OpenCL SDK does not give a download link, but if found elsewehre it installs some version of an Intel System Studio. If trying to download the OpenCL tools I'm redirected to an Intel oneAPI for IoT which does not set up the bindings, and the Base oneAPI does not do it either.
Any help or ideas here would be appreciated?
I am trying to compile a existing CMake project using Cuda v8.0 that I found online. To do that, I use CMake GUI version. (I am currently running Windows 10, with Visual Studio 2017). The "Configure" step always givs me the following error message:
No CMAKE_CUDA_COMPILER could be found.
I have cuda 8.0 installed (altogether with other Cuda versions that I removed from my path), CuDNN also in my path. And I expect at some points to generate Visual studio project files that I could then use to compile the project...
What could cause that error?
EDIT
Upon request, I uploaded the CMakeOutput.log there : https://framabin.org/?c532b10d2a4aef54#NkJZItfUfPwMP6BHCiP5DhQS40duM4AhsKR+bWHN0tE=
Alright! With #raul-laasner help, I think I have the solution of my problems!
The first one was indeed that my Cuda version was not correctly identified. And I am not sure at this stage that one was found at all. My environment variables where probably ignored also. I had to specify the CMAKE_CUDA_COMPILER option to "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v8.0/bin/nvcc.exe".
Then, the problem was that I was using a too recent version of Visual Studio. For starters, Cuda v8.0 is not compatible with Visual Studio 2017: Cuda 8.0 with Visual Studio 2017. But even with the most recent version of Cuda, my Visual Studio is too recent. Meaning: NVIDIA lags behind when it comes to the Visual Studio versions... And now, Microsoft plans to update the _MSC_VER on most of the upgrade. Thus, I had two choices:
Downgrade Visual Studio to a compatible version.
Use more recent version of Cuda (9.2) and modify the c:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\include\crt\host_config.h to change the upper limit of the _MSC_VER verification.
By doing the second option, I managed to configure and compile the project. I am not sure though that I won't have later problems with this "hacky" way. But at least, I've been on a further step!
For me, this issue was caused by nvcc(x64 version) doesn't support x86 platform and was fixed by specifying the platform for cmake:
$build> cmake .. -G"Visual Studio 15 2017 Win64"
My understanding is that the VC++ redists are essentially updates to some core Windows files, and that over time MS "catches up" by incorporating past versions into new versions/updates to Windows. For instance I'd probably expect anything built with VC++ 2005 wouldn't need me to install the redist on target PCs these days.
Can anyone provide definitive reference for which versions of Windows include which VC++ redist versions?
Also, is the redist approach something MS still employ in the newest versions of VC++ e.g. 2012 and later?
None of the files distributed with modern versions of Visual Studio are updates to files that ship with Windows.
Windows does ship with a C runtime, which is used internally and (for reasons of backwards compatibility) by applications built with Visual Studio 6 or earlier versions. Later versions of Visual Studio each have their own runtime, none of which are shipped with Windows.
Currently I am new to CUDA I have NVIDIA tesla c2075 card I install CUDA toolkit for windows. Now I don't have visual studio. I want to run and test CUDA programs without using visual studio.
The only officially supported compiler for use with CUDA on windows is cl.exe, the compiler that ships with visual studio. It also comes with the express (free) versions of visual studio. Is there a reason you don't want to do this?
You can also get the tools and set up a command-line compile environment using the Microsoft Windows SDK.
I've a couple of Makefile projects on my visual studio (express) 2005/2008 (doesn't matter for now) to compile some application using the MinGW GCC compiler. I don't want to use the MS compiler because there are features that only are available on GCC.
Now I'd like to debug from inside VS since I'm coding from it but this requires me to use GDB (it works from the command line) but i prefer to use the IDE tools.
Is there a way to do this? Even if the Express version is limited and doesn't support it can it be done using the full version?
If you prefer IDE working under Windows you may be interested in Code Blocks or Qt Creator. They are free.
There are commercial dev-tools for Unixes too: MagicC++ (IDE), debuggers like TotalView, Allinea, Zero-bugs, UndoDB ...
If you want to stay with Visual Studio check this WinGDB. It is not supported by Express edition (extensions are not supported at all). But Microsoft have recently released free Visual Studio Community (has almost all features of Professional Edition), which is free and can be legally used by students/hobbyists/startups - free for individuals for developing commercial applications, free for organizations for developing open source applications, free for organizations (for up to 5 individual users) for developing commercial applications only if the organization has less than 250 computers and has less than $10M annual revenue. Refer VS 2013 Community License for more information.
By the way VirtualBox may be very helpful (I debug (Open)Solaris or Linux as VBox machines very frequently) ;-).
Normally you cannot use it with Visual Studio Express, as VS Express does not support third-party add-ins and will only work with Microsoft debugger (requiring symbol information from Microsoft compiler).
However, you can make Visual Studio Professional (or higher) work with GDB by installing a third-party plugin such as VisualGDB.
Note that there are several ways to get Visual Studio Professional for free:
If your software company is a product-oriented startup, you can get free Visual Studio via BizSpark
If you are a student, you can also get a free Visual Studio license via DreamSpark
As far as I know, you can only debug from within the IDE if you have compiled your code with the Microsoft compiler. Otherwise, the Visual Studio debugger doesn't have a clue what to do with the GDB debug information.