CUDA 10 runtime problem (evidenced by Mandelbrot example)

Hi

I had been having problems uninstalling CUDA 10.1 and getting back to 10.0 but I do now have CUDA 10.0 installed and the nvidia control panel reports nvcuda.dll is 10.0.132 as expected now

(Win 10 64-bit home, GTX-108Ti)

(You will find more information on a StackOverlfow question I posted 10 days ago; see https://stackoverflow.com/questions/58235018/cuda-issue-how-to-clean-install-cuda-in-win-10-to-resolve-cudagetdevice-fail?noredirect=1#comment102988827_58235018)

Unfortunately there is a problem - with compiling/running CUDA. First, proof the setup is generally OK, then the bad example and question

I have built the recommended devicequery example in Visual Studio 2017 and the results were good

C:\ProgramData\NVIDIA Corporation\CUDA Samples\v10.0\bin\win64\Debug>devicequery
devicequery Starting…

CUDA Device Query (Runtime API) version (CUDART static linking)

Detected 1 CUDA Capable device(s)

Device 0: “GeForce GTX 1080 Ti”
CUDA Driver Version / Runtime Version 10.0 / 10.0
CUDA Capability Major/Minor version number: 6.1
Total amount of global memory: 11264 MBytes (11811160064 bytes)
(28) Multiprocessors, (128) CUDA Cores/MP: 3584 CUDA Cores
GPU Max Clock rate: 1607 MHz (1.61 GHz)
Memory Clock rate: 5505 Mhz
Memory Bus Width: 352-bit
L2 Cache Size: 2883584 bytes
Maximum Texture Dimension Size (x,y,z) 1D=(131072), 2D=(131072, 65536), 3D=(16384, 16384, 16384)
Maximum Layered 1D Texture Size, (num) layers 1D=(32768), 2048 layers
Maximum Layered 2D Texture Size, (num) layers 2D=(32768, 32768), 2048 layers
Total amount of constant memory: 65536 bytes
Total amount of shared memory per block: 49152 bytes
Total number of registers available per block: 65536
Warp size: 32
Maximum number of threads per multiprocessor: 2048
Maximum number of threads per block: 1024
Max dimension size of a thread block (x,y,z): (1024, 1024, 64)
Max dimension size of a grid size (x,y,z): (2147483647, 65535, 65535)
Maximum memory pitch: 2147483647 bytes
Texture alignment: 512 bytes
Concurrent copy and kernel execution: Yes with 2 copy engine(s)
Run time limit on kernels: Yes
Integrated GPU sharing Host Memory: No
Support host page-locked memory mapping: Yes
Alignment requirement for Surfaces: Yes
Device has ECC support: Disabled
CUDA Device Driver Mode (TCC or WDDM): WDDM (Windows Display Driver Model)
Device supports Unified Addressing (UVA): Yes
Device supports Compute Preemption: No
Supports Cooperative Kernel Launch: No
Supports MultiDevice Co-op Kernel Launch: No
Device PCI Domain ID / Bus ID / location ID: 0 / 1 / 0
Compute Mode:
< Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >

deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 10.0, CUDA Runtime Version = 10.0, NumDevs = 1
Result = PASS

HOWEVER when I build and run mandelbrot.exe I get this (note that cudnn64_7 v7.42 is here C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin, cudnn.h is here C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\include and cudnn.lib is here - all from cudnn-10.0-windows10-x64-v7.4.2.24.zip)

C:\ProgramData\NVIDIA Corporation\CUDA Samples\v10.0\bin\win64\Debug>mandelbrot.exe
[CUDA Mandelbrot/Julia Set] - Starting…
GPU Device 0: “GeForce GTX 1080 Ti” with compute capability 6.1

Data initialization done.
Initializing GLUT…
OpenGL window created.
Creating GL texture…
Texture created.
Creating PBO…
CUDA error at c:\programdata\nvidia corporation\cuda samples\v10.0\2_graphics\mandelbrot\mandelbrot.cpp:972 code=63(cudaErrorOperatingSystem) “cudaGraphicsGLRegisterBuffer(&cuda_pbo_resource, gl_PBO, cudaGraphicsMapFlagsWriteDiscard)”

What is wrong and how do I fix it?

VS info:

Microsoft Visual Studio Community 2017
Version 15.9.16
VisualStudio.15.Release/15.9.16+28307.858
Microsoft .NET Framework
Version 4.8.03761

Installed Version: Community

Visual C++ 2017 00369-60000-00001-AA356
Microsoft Visual C++ 2017

ASP.NET and Web Tools 2017 15.9.04012.0
ASP.NET and Web Tools 2017

Azure App Service Tools v3.0.0 15.9.03024.0
Azure App Service Tools v3.0.0

C# Tools 2.10.0-beta2-63501-03+b9fb1610c87cccc8ceb74a770dba261a58e39c4a
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools 1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Cookiecutter 15.9.18254.1
Provides tools for finding, instantiating and customizing templates in cookiecutter format.

JavaScript Language Service 2.0
JavaScript Language Service

Microsoft Azure Tools 2.9
Microsoft Azure Tools for Microsoft Visual Studio 2017 - v2.9.20417.1

Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft MI-Based Debugger 1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual C++ Wizards 1.0
Microsoft Visual C++ Wizards

Microsoft Visual Studio VC Package 1.0
Microsoft Visual Studio VC Package

MLGen Package Extension 1.0
MLGen Package Visual Studio Extension Detailed Info

NuGet Package Manager 4.6.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

NVIDIA CUDA 10.0 Wizards 10.0
Wizards to create new NVIDIA CUDA projects and source files.

NVIDIA CUDA 9.0 Wizards 9.0
Wizards to create new NVIDIA CUDA projects and source files.

ProjectServicesPackage Extension 1.0
ProjectServicesPackage Visual Studio Extension Detailed Info

Python 15.9.18254.1
Provides IntelliSense, projects, templates, debugging, interactive windows, and other support for Python developers.

Python - Django support 15.9.18254.1
Provides templates and integration for the Django web framework.

Python - IronPython support 15.9.18254.1
Provides templates and integration for IronPython-based projects.

Python - Profiling support 15.9.18254.1
Profiling support for Python projects.

Test Adapter for Boost.Test 1.0
Enables Visual Studio’s testing tools with unit tests written for Boost.Test. The use terms and Third Party Notices are available in the extension installation directory.

Test Adapter for Google Test 1.0
Enables Visual Studio’s testing tools with unit tests written for Google Test. The use terms and Third Party Notices are available in the extension installation directory.

TypeScript Tools 15.9.30718.2001
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools 2.10.0-beta2-63501-03+b9fb1610c87cccc8ceb74a770dba261a58e39c4a
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual Studio Code Debug Adapter Host Package 1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Tools for CMake 1.0
Visual Studio Tools for CMake

Julian

The issue is resolved as thanks to Robert Crovella…

See this StackOverflow question and comments…

https://stackoverflow.com/questions/58418573/nvidia-cuda-toolkit-10-0-cuda-error-code-63-cudaerroroperatingsystem-cause

Fixed/Solved/Resolved