Problems in openGL with CUDA 10.1 graphical examples on Debian Buster, GTX 1050 Ti, Dell laptop G3

Hi, folks!

I just installed CUDA Toolkit 10.1 on my Dell laptop, and I could run all examples, except the opengl graphic examples (in 2_Graphics). On simpleGL, I got:

simpleGL (VBO) starting…

GPU Device 0: “GeForce GTX 1050 Ti” with compute capability 6.1

CUDA error at code=999(cudaErrorUnknown) “cudaGraphicsGLRegisterBuffer(vbo_res, *vbo, vbo_res_flags)”
CUDA error at code=400(cudaErrorInvalidResourceHandle) “cudaGraphicsUnregisterResource(vbo_res)”

And all examples return similar error (cudaGraphicsGLRegisterBuffer).

lspci gives:

lspci |grep VGA
00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 630 (Mobile)

nvidia-smi gives:
Wed Oct 23 19:37:06 2019
| NVIDIA-SMI 418.87.00 Driver Version: 418.87.00 CUDA Version: 10.1 |
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| 0 GeForce GTX 105… Off | 00000000:01:00.0 Off | N/A |
| N/A 42C P8 N/A / N/A | 0MiB / 4040MiB | 0% Default |

| Processes: GPU Memory |
| GPU PID Type Process name Usage |
| No running processes found |

lsmod |grep nvidia gives:

nvidia_uvm 929792 0
nvidia 18235392 19 nvidia_uvm
ipmi_msghandler 65536 2 ipmi_devintf,nvidia

glxinfo |grep OpenGL gives:

OpenGL vendor string: VMware, Inc.
OpenGL renderer string: llvmpipe (LLVM 7.0, 256 bits)
OpenGL core profile version string: 3.3 (Core Profile) Mesa 18.3.6
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.1 Mesa 18.3.6
OpenGL shading language version string: 1.40
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.0 Mesa 18.3.6
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00
OpenGL ES profile extensions:

I have just one GPU a Geforce GTX 1050 Ti, and I need to run those examples in order to do my research in CUDA.

Thanks in advance.


Are you running the latest version of Debian Buster 10.1 because I’m thinking this might be a library dependency issue.


Yes, I’m running the latest stable version.

Here is my sources.list:

cat /etc/apt/sources.list

deb cdrom:[Debian GNU/Linux 10.1.0 Buster - Official amd64 NETINST 20190908-01:07]/ buster main

deb cdrom:[Debian GNU/Linux 10.1.0 Buster - Official amd64 NETINST 20190908-01:07]/ buster main

deb buster main contrib non-free
deb-src buster main contrib non-free

deb buster/updates main contrib non-free
deb-src buster/updates main contrib non-free

buster-updates, previously known as ‘volatile’

deb buster-updates main contrib non-free
deb-src buster-updates main contrib non-free


deb buster-proposed-updates non-free main contrib
deb buster contrib

Hi, mikeroyal!

Do I need to upgrade to Debian testing?



Hi, mikeroyal!

I’ve changed the sources and I’ve upgraded some packages, but nothing changed. Here is my sources.list:




Debian Main Repos

deb testing main contrib non-free
deb-src testing main contrib non-free

deb testing-updates main contrib non-free
deb-src testing-updates main contrib non-free

deb testing-security main
deb-src testing-security main




3rd Party Binary Repos

###Debian Multimedia
deb [arch=amd64,i386] bullseye main non-free

deb bionic main
deb-src bionic main

###Google Chrome Browser
deb [arch=amd64] stable main

###Open Shot
deb bionic main

deb-src bionic main

###Pantheon Desktop
deb [arch=amd64] testing-daily main contrib

###Paper GTK Theme
deb bionic main
deb-src bionic main

###Papirus GTK Theme
deb bionic main
deb-src bionic main

###Sublime Text
deb apt/stable/

###Visual Studio Code
deb [arch=amd64] stable main


deb buster-proposed-updates non-free main contrib
deb buster contrib

Any ideas?

Is there any Nvidia Moderator here to help?

Hi, can anyone help?

Since you’re on a Dell laptop, this might apply

[i]This often comes about because the OpenGL context is created on a non-NVIDIA GPU (e.g. an intel iGPU).
…if you have any non-NVIDIA GPUs, and I don’t know if your OpenGL context is getting created on a non-NVIDIA GPU.

The CUDA/OpenGL interop sample codes require that the OpenGL context and the CUDA context get created on the same NVIDIA GPU[/i]

If this is your problem, you can control how your application is selecting the GPUs as described here:
Sorry, I see there’s no linux version, but here’s a few (untested) links related to Hybrid mode (and the older Optimus mode)


Also, check for incompatible nouveau drivers

lsmod | grep nouveau

As a side note (not likely your issue), NVIDIA is recommending using NVIDIA Nsight Graphics

You have an intel graphics device that acts (usually) as the primary graphics adapter for your Optimus laptop. It’s typical for the OpenGL context to be created on that adapter, and in that case any sample code that uses cuda-graphics interop won’t work

Depending on the design of your laptop, it may or may not be possible to get the NVIDIA dGPU to fully take over the graphics tasks so that the OpenGL context gets created on the NVIDIA GPU. You may wish to study system BIOS setting on your laptop to see if there are high-performance graphics modes that you can enable. You may also wish to investigate the use of the nvidia-prime utility. If you install the nvidia-prime utility, you may then be able to do sudo prime-select nvidia to get the nvidia GPU to become the primary adapter.

I won’t be able to give detailed instructions to perform these steps, however there are many writeups on the web that you can refer to. Optimus laptop hardware designs vary, so a particular set of instructions may or may not have the desired effect on your laptop.

On windows, the general recommendation is to use an optimus profile to control the graphics behavior on an app-by-app basis, and this is documented elsewhere as well.