Compiling and setting up CUDA libraries on windows 10

I’m trying to compile the CUDA libraries under windows 10, I’ve got a tenuous grasp on what that entails. My ultimate goal is to get CUDA working under the Julia language (e.g. linking to certain CUDA DLLs such as [cudnn64_70.dll] in particular.

I’ve installed the latest CUDA package from NVIDIA, and installed Visual Studio 2013 (an apparent dependency). I’m not a day-to-day visual studio user.

Compiling a sample CUDA project seems like a good place to start: http://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/#compiling-sample-projects

To that end I’ve tried to open in Visual Studo 2103:

D:\MyProgramFiles\NVIDIA\CUDA_Samples_Simulations\nbody\nbody_vs2013.sln

I receive this error in Visual Studio:

D:\MyProgramFiles\NVIDIA\CUDA_Samples_Simulations\nbody\nbody_vs2013.vcxproj : error  : Unable to read the project file "nbody_vs2013.vcxproj".
D:\MyProgramFiles\NVIDIA\CUDA_Samples_Simulations\nbody\nbody_vs2013.vcxproj(36,5): The imported project "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\BuildCustomizations\CUDA 7.5.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

I can confirm that there’s no CUDA 7.5.props in that directory. But I don’t know what that directory is for or why such a file should exist there. I presume I’m missing some dependencies not mentioned in the documentation I’m following.

Any ideas on dependencies or a more comprehensive getting started guide I should be following?

Thanks,
David

I should also mention that the installation guide references a program to get started with called deviceQuery which should be found here:

C:\ProgramData\NVIDIA Corporation\CUDA Samples\v7.5\bin\win64\Release

On my system that would translate to:

D:\MyProgramFiles\NVIDIA\CUDA_Samples\bin\win64\Release

But there’s no deviceQuery there, just 3 files: {freeglut.dll, FreeImage64.dll, glew64.dll}. I do see a deviceQuery project in:

D:\MyProgramFiles\NVIDIA\CUDA_Samples_Utilities\deviceQuery

But it doesn’t open for the same reason that the nbody sample won’t open.

Your CUDA 7.5 is probably not installed correctly.

You must have Visual Studio (e.g. VS2013 community edition) installed first, then install CUDA. From your description it sounds like you reversed that order.

Once you can properly load a CUDA project file, be advised that all projects that you want to use must be compiled/built first. The installation guide makes it sound like some of the executables are already built for you but that is not correct.

Brilliant, I would not have known that. I re-installed CUDA and am now able to compile! Thank you very much for taking the time with this question, you’ve saved me many many hours.

Although I can compile things now, both deviceQuery.exe and nbody.exe hang when I run them. Both are suggested in the getting started guide.

I can run nvidia-smi.
I’ve tried rebooting.
I have not updated the WDDM timeouts on this OS (ran into that in matlab on another system), but that doesn’t seem a likely issue yet.

I do see a few “Unknown Error” and “Insufficient Permissions” in the nvidia-smi query, but I don’t understand it well enough to know if they’re concerning.

c:\Program Files\NVIDIA Corporation\NVSMI>nvidia-smi -q

==============NVSMI LOG==============

Timestamp                           : Sun May 01 18:19:16 2016
Driver Version                      : 353.90

Attached GPUs                       : 1
GPU 0000:01:00.0
    Product Name                    : GeForce GTX 970M
    Product Brand                   : GeForce
    Display Mode                    : Disabled
    Display Active                  : Disabled
    Persistence Mode                : N/A
    Accounting Mode                 : Disabled
    Accounting Mode Buffer Size     : 1920
    Driver Model
        Current                     : WDDM
        Pending                     : WDDM
    Serial Number                   : N/A
    GPU UUID                        : GPU-ce01a5b8-dee8-f62d-76d7-f871fb5a7858
    Minor Number                    : N/A
    VBIOS Version                   : 84.04.20.00.0A
    MultiGPU Board                  : No
    Board ID                        : 0x100
    Inforom Version
        Image Version               : N/A
        OEM Object                  : N/A
        ECC Object                  : N/A
        Power Management Object     : N/A
    GPU Operation Mode
        Current                     : N/A
        Pending                     : N/A
    PCI
        Bus                         : 0x01
        Device                      : 0x00
        Domain                      : 0x0000
        Device Id                   : 0x13D810DE
        Bus Id                      : 0000:01:00.0
        Sub System Id               : 0x11021462
        GPU Link Info
            PCIe Generation
                Max                 : 3
                Current             : 1
            Link Width
                Max                 : 16x
                Current             : 16x
        Bridge Chip
            Type                    : N/A
            Firmware                : N/A
        Replays since reset         : 0
        Tx Throughput               : Unknown Error
        Rx Throughput               : 0 KB/s
    Fan Speed                       : N/A
    Performance State               : P8
    Clocks Throttle Reasons
        Idle                        : Not Active
        Applications Clocks Setting : Not Active
        SW Power Cap                : Not Active
        HW Slowdown                 : Not Active
        Unknown                     : Not Active
    FB Memory Usage
        Total                       : 3072 MiB
        Used                        : 80 MiB
        Free                        : 2992 MiB
    BAR1 Memory Usage
        Total                       : 256 MiB
        Used                        : 232 MiB
        Free                        : 24 MiB
    Compute Mode                    : Default
    Utilization
        Gpu                         : Unknown Error
        Memory                      : Unknown Error
        Encoder                     : 0 %
        Decoder                     : 0 %
    Ecc Mode
        Current                     : N/A
        Pending                     : N/A
    ECC Errors
        Volatile
            Single Bit
                Device Memory       : N/A
                Register File       : N/A
                L1 Cache            : N/A
                L2 Cache            : N/A
                Texture Memory      : N/A
                Total               : N/A
            Double Bit
                Device Memory       : N/A
                Register File       : N/A
                L1 Cache            : N/A
                L2 Cache            : N/A
                Texture Memory      : N/A
                Total               : N/A
        Aggregate
            Single Bit
                Device Memory       : N/A
                Register File       : N/A
                L1 Cache            : N/A
                L2 Cache            : N/A
                Texture Memory      : N/A
                Total               : N/A
            Double Bit
                Device Memory       : N/A
                Register File       : N/A
                L1 Cache            : N/A
                L2 Cache            : N/A
                Texture Memory      : N/A
                Total               : N/A
    Retired Pages
        Single Bit ECC              : N/A
        Double Bit ECC              : N/A
        Pending                     : N/A
    Temperature
        GPU Current Temp            : 46 C
        GPU Shutdown Temp           : 96 C
        GPU Slowdown Temp           : 91 C
    Power Readings
        Power Management            : N/A
        Power Draw                  : 0.00 W
        Power Limit                 : N/A
        Default Power Limit         : N/A
        Enforced Power Limit        : N/A
        Min Power Limit             : N/A
        Max Power Limit             : N/A
    Clocks
        Graphics                    : 405 MHz
        SM                          : 405 MHz
        Memory                      : 324 MHz
    Applications Clocks
        Graphics                    : 1038 MHz
        Memory                      : 1600 MHz
    Default Applications Clocks
        Graphics                    : 1038 MHz
        Memory                      : 1600 MHz
    Max Clocks
        Graphics                    : 1037 MHz
        SM                          : 1037 MHz
        Memory                      : 2505 MHz
    Clock Policy
        Auto Boost                  : N/A
        Auto Boost Default          : N/A
    Processes
        Process ID                  : 596
            Type                    : Insufficient Permissions
            Name                    : Insufficient Permissions
            Used GPU Memory         : Not available in WDDM driver model

Solved: Avast strikes again!
Solution: Disable avast shields or go to Settings->Active Protection->File System Shield->Customize->Exclusions and add NVIDIA to the path.

I have a similar problem with Windows 10 and CUDA 9. The CUDA installer is not able to install CUDA along with Visual Studio Integration. The solution is to install CUDA with unselect Visual Studio Integration. After I got above error in Visual Studio, Solution for that is to copy “CUDA 9.0.props” and “CUDA 9.0.targets” to location “C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\BuildCustomizations”. How to get “CUDA 9.0.props” and “CUDA 9.0.targets” files > 1) Open CUDA 9 installer don’t install anything, 2) Now go Temp directory find CUDA folder and open(C:\Users<USER NAME>\AppData\Local\Temp\CUDA\CUDAVisualStudioIntegration\extras\visual_studio_integration\MSBuildExtensions) 4) Copy all files to above Visual Studio Folder.

and also install
C:\Users<USER NAME>\AppData\Local\Temp\CUDA\CUDAVisualStudioIntegration\NVIDIA_Nsight_Visual_Studio_Edition_Win64_5.4.0.17229

@khairnardm Thank you for this. I have been trying to get this installed all day and this worked! Additional note, if someone else stumbles upon this. The sample program deviceQuery that the NVIDIA installation guide for Windows 10 states to run will be in the Debug folder not the Release folder after building the project on Visual Studio.

Version:
Windows 10
CUDA 9.2
Visual Studio 2017 v15.8.0