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 python - CUDA issue - how to clean install CUDA in Win 10 to resolve cudaGetDevice() failed - Stack Overflow)

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…

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

Fixed/Solved/Resolved

I am having the problem described by the OP. Could someone please post the answer here? There is a link to Stackflow, but the answer has been removed from Stackflow “due to moderation,” whatever that means. There are several links given in the moderation message, but as far as I can tell they don’t answer the question.

@AB4EJ_2 Since it was my post that got deleted (by a bot - ?because no answers? I don’t know) I can still see it… there was no separate “answer” only this exchange of comments; I hope they help you too.

  • Do you have any other GPUs in that system? For example, do you have intel integrated graphics built into the motherboard, or any other intel or AMD GPU? Is the graphics display being hosted by (i.e. displayed on a display that is cabled/connected to) the GTX 1080Ti ?

Robert Crovella

  • @RobertCrovella Yes; motherboard has Intel UHD Graphics 630. Setup has 3 monitors: mandelbrot’s window was on the display linked to the Intel; (other “monitors” are a desktop display and a 4k TV); no further GPUs

Julian Moore

  • That’s the problem. The CUDA/Graphics interop sample codes require that the graphics context and the CUDA context be running on the same (NVIDIA) GPU.

Robert Crovella

  • @robertcrovella Aha! I shall try again when I get home then. If confirmed it should be an answer that I can then accept ftom you - thanks. I was unaware of that constraint… Where are such things described?

Julian Moore

  • @RobertCrovella You were right. I had to designate a GPU driven monitor as primary (because the mandelbrot window opens on the primary screen) but it then produced a fractal image. Thank you.

Julian Moore

Not sure you would have been pinged correctly - so “replying” again: see my answer above