I have a desktop PC w/ AM4 board an 2560x1440 monitor connected via HDMI. I have a Fedora 27 runfile CUDA installation and get the error mentioned in the subject preventing to run the samples.
This often comes about because the OpenGL context is created on a non-NVIDIA GPU (e.g. an intel iGPU). I don’t know if that is true in your case. I don’t know what a AM4 board is, I don’t know 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.
This seems like a repeat mostly of what is already covered in the first link in your question.
CUDA device [GeForce GTX 1060 6GB] has 10 Multi-Processors
CUDA error at fluidsGL.cpp:472 code=30(cudaErrorUnknown) “cudaGraphicsGLRegisterBuffer(&cuda_vbo_resource, vbo, cudaGraphicsMapFlagsNone)”
cudaErrorUnknown is not the usual error you would get when the OpenGL context and the CUDA context are on different GPUs (and anyway you only seem to have 1 GPU in your setup). (the typical error would be something like “no devices available”)
Are you able to run other CUDA sample codes without issue (e.g. vectorAdd) ?
When you installed the 396.51 driver, did you say Yes or No to installing the OpenGL libs? Are you certain that the nouveau driver has been properly removed?
Are you currently running a X display on the GTX 1060 ?
Yes, I am certain that nouveau is not running by using lsmod | grep nouveau. The driver does not ask that question, anyway all questions were answered “yes”.
I am not sure what is meant by running a X display. echo $XDG_SESSION_TYPE returns x11 and not wayland, if that is the question.
I could send the log file of the driver installation but do not know how to attach it. Thanks!