Setting up CUDA environment in Visual Studio 2017

In this post I will briefly summarise two issues I came across while trying to setup the development environment for CUDA. CUDA is an environment that allows you to code the application with support of potent computational capabilities of your GPU-s. In my case, I wanted to utilise the power of NVIDIA GeForce 1050 Ti card. The idea of having this SDK is to facilitate a way for your application to distribute processing over parallel processing and multithreading. You can download CUDA SDK from https://developer.nvidia.com/cuda-downloads. (I used 10.1 version and Visual Studio 2017).
Having downloaded and installed CUDA SDK (which takes some time), I tried to compile the deviceQuery utility - the example that, if compiled ok, would show you the attributes of your GPU.
This is where the troubleshooting started. First of all, the compilation did not work due to missing Microsoft 10 SDK 10.0.15063.0 component. This can be easily installed by modifications in the Visual Studio. Go into the Control Panel->Programs->Programs and Features->right click on "Microsoft Visual Studio Installer" and select "Change".

That solved the first problem, but the next one was also tied to the compilation process- a number of include files were not found. So, I first searched to locate them on the disk.
I soon realised that "ucrt" was not added in the Visual Studio environment variable , so I moved on to append this path to the appropriate VS 2017 variable.

After this modification, the compilation finally generated valid deviceQuery.exe.
Upon starting the deviceQueery.exe, its execution did not identify any CUDA capable devices. I realised that the whole CUDA installation process somehow somewhere corrupted my original GeForce driver. deviceQuerry reported "error 999" - "unknown error". When I opened device manager and checked the driver capabilities of NVidia Driver, I noticed a little yellow exclamation point and a Windows message saying that the driver's signature was not recognised and file might have been maliciously modified. I had to manually update the GeForce driver and rerun the deviceQuery.exe. This time all worked as expected.
Last point I wish to make - the driver update was also quite cumbersome. First the NVidia utility reported it cannot scan the system so I had to use the GeForce Experience utility to create account and login into NVidia kind-of-support portal which scanned my system and downloaded and installed proper driver. Not sure why I had to put my birthdate (!) to download and install the driver.

Comments

Popular posts from this blog

Signature verification bypass vulnerability in some Huawei routers

Attacking encrypted VOIP (SIP) protocols

DNS insights - UDP vs TCP and EDNS