CUDA debugging in NSight Eclipse in Linux - c++

I would like to debug some CUDA code in Linux. However, I came across an error that pertains to X11 not being able to share the GPU with the NSight visual debugger using Eclipse Nsight.
However today I came across this.
3.4.2. Single-GPU Debugging with the Desktop Manager Running
CUDA-GDB can be used to debug CUDA applications on the same GPU that
is running the desktop GUI.
Note: This is a BETA feature available on Linux and supports devices
with SM3.5 compute capability. There are two ways to enable this
functionality:
Use the following command: set cuda software_preemption on Export the
following environment variable: CUDA_DEBUGGER_SOFTWARE_PREEMPTION=1
Either of the options above will activate software preemption. These
options must be set prior to running the application. When the GPU
hits a breakpoint or any other event that would normally cause the GPU
to freeze, CUDA-GDB releases the GPU for use by the desktop or other
applications. This enables CUDA-GDB to debug a CUDA application on the
same GPU that is running the desktop GUI, and also enables debugging
of multiple CUDA applications context-switching on the same GPU.
Note: The options listed above are ignored for GPUs with less than
SM3.5 compute capability.
From here: http://docs.nvidia.com/cuda/cuda-gdb/index.html#single-gpu-debugging-with-desktop-manager-running
Question:
So before I ask my project manager for a new compute SM3.5 compute capability graphics card, can anyone verify that this is working?
Does it work well?
My platform is Centos 7.0, Intel 64-bit.

I got the card, anyway in CentOS 7 it works well. There's some slowdown when it goes into the kernel, but it does what I wanted it to. I can see the variable values inside the kernel.
One thing though, as of today 18/2/2016, I cannot press "stop" when debugging kernels. It hangs the whole system. Oh well, it did say it is a beta feature.

Related

CUDA Manjaro Nvidia gtx 970 Bus error (core dumped) [duplicate]

I am trying to use CUDA with GTX 570.
I am using Ubuntu 14.04 and CUDA has been installed successfully.
I think I should use desktop or gui interface with on-board VGA
and run GTX 570 solely for CUDA, but seems not working well. (I set up on-board VGA as default in BIOS, but after installing CUDA, Ubuntu only provide gui in GTX 570 port.)
So, is it okay to use GTX 570 for both gui and CUDA? What is the standard way to use it?
If your on-board VGA is still active at boot time, and only goes dark when Ubuntu loads, then it should be possible via a rearrangement of your xorg.conf file, to get Ubuntu to use the on-board VGA for display also. In this case, you would remove all reference to the GTX570 from your xorg.conf, and this is the best approach.
You can use the GTX570 for both display and CUDA.
There will be two areas of limitation:
Interactivity - when running CUDA apps, your display will be unresponsive. For learning purposes, most CUDA kernels run for significantly less than 1 second, so this is not likely to be much of an issue for you (the display will freeze while the CUDA kernel is running). But if you want to run longer CUDA kernels, your system will be unresponsive during that time, and you may even run into Linux watchdog timeout issues. This document may also be interesting reading for you.
Debugging - When there is no X-server that is using the GTX570, then it can be easily used for debugging. However, you will not be able to debug (e.g. set breakpoints in CUDA device code) your CUDA apps when the GUI/display is also running on the GTX570.

OpenGL Profiler for mac with xcode 8

I've been previously using OpenGL profiler for mac to debug my graphics work and it was working like a charm with xcode 7.2.
I then upgraded xcode to version 8 when it came out, and the profiler was gone. I redownloaded it, but ever since I have not been able to record any trace or stop at any breakpoint, and therefore cannot inspect any resource anymore either.
There is currently no profiler after the one developed for xcode 7.2.
Is there any way to use the last OpenGL profiler with xcode 8.x?
Thanks in advance.
You can find here a similar post on the apple developer forum.
A bug repport is currently under revision.
The only way I found to use OpenGL Profiler on macOS 10.12 is to
enable remote profiling from the preferences. (checkbox is disabled
while you don't set a password) Once enabled, you can connect to it
using another machine (it may be 10.12) and attach profiler to the
running application you want to debug.

How to remove/disable glXCreatePbuffer in Linux

I am trying to debug an opengl error that i have and i decided to use Nvidia Linux Graphics Debugger. My laptop has Nvidia Optimus but i manged to fix everything to make things work with dGPU using Fedora 22.
I am new to Linux developing and I tend to use wrappers when it comes to doing something because I started developing the same project in windows and linux at the same time. I find it easyer for some small things to use windows compared to linux but I would like to more and stay there. :D
When i try to capture a frame with Linux Graphics Debugger I get this error.
Detected unsupported operations that may cause errors or a crash during capture.
First seen unsupported operation: glXCreatePbuffer
I did some googleing and i found out what is the operation. I get the same error with all applications that use OpengGl.
My problem is how to disable this. I am using SDL2 GLEW and FreeGlut.

OpenCL development on Intel CPU/GPU under Linux

I have an intel i7 haswell cpu, and I would like to start exploring OpenCL development. In particular, I am interested to run OpenCL code on the integrated GPU.
Unfortunately, by now, I was not able to find any SDK on Intel's site..
May you provide some links, together with a summary of the current status of OpenCL tools for the Linux platform and Intel hardware?
I think this would be useful to many other people..
Thanks a lot!
Intel does not provide free support for OpenCL on their iGPUs under Linux - you have to buy the Intel Media Server Studio, minimum $499. On Windows, you can download a free driver to get OpenCL capability for the iGPU: https://software.intel.com/en-us/articles/opencl-drivers#philinux.
Note that you can use any OpenCL SDK you want - it doesn't have to be Intel. The SDK is only useful for building your program. For running an OpenCL program, you need an appropriate runtime (driver) from the manufacturer. The AMD SDK will give you access to the CPU as an OpenCL device, but not the iGPU.
There is Open Source OpenCL implementation for Intel GPUs on Linux called Beignet, maintained by bunch of guys from Intel.
Sadly, couldn't personally try and check if Your's GPU is properly supported, but on their wiki they states:
Supported Targets
4th Generation Intel Core Processors "Haswell", need kernel patch currently, see the "Known Issues" section.
Beignet: self-test failed" and almost all unit tests fail. Linux 3.15 and 3.16 (commits f0a346b to c9224fa) enable the register whitelist by default but miss some registers needed for Beignet.
This can be fixed by upgrading Linux, or by disabling the whitelist:
# echo 0 > /sys/module/i915/parameters/enable_cmd_parser
On Haswell hardware, Beignet 1.0.1 to 1.0.3 also required the above workaround on later Linux versions, but this should not be required in current (after 83f8739) git master.
So, it's worth a shoot. Btw, it worked well on my 3rd generation HD4000.
Also, toolchain and driver in question includes bunch of GPU-support test cases.
For anyone who comes across this question as I did, the existing answers have some out-of-date information; Intel now offers free drivers for Linux on the site posted above: https://software.intel.com/en-us/articles/opencl-drivers#philinux
The drivers themselves are only supported on 5th, 6th and 7th gen Core processors (and a bunch of other Celerons and Xeons, see link), with earlier processors such as 4th gen still needing the Media Server Studio.
However, they now offer a Linux Community version of Media Server Studio which is free to download.
They also have a Driver Support Matrix for Intel Media SDK and OpenCL which has some useful information about compatibility: https://software.intel.com/en-us/articles/driver-support-matrix-for-media-sdk-and-opencl
You may check intel open source Beignet OpenCL library: http://arrayfire.com/opencl-on-intel-hd-iris-graphics-on-linux/
For me (ubuntu 15.10 + Intel i5 4th generation GPU) it works quite well.
P.S.
Also I must say that I managed to download "media server" for linux a couple of months ago (but didn't used it yet). So you may check it also.

nsight debugging with OpenGL interop

Usually I program on Linux, now I'v setup a Windows environment just to debug with the nsight version of Visual Studio.
But when I try to start the debugger (either Graphics or CUDA Debugging), it doesn't work. The CUDA debugger just disconnects and the Graphics debugger disconnects with
FrameDebugger: Unsupported operation encountered; saving compatibility log to 'C:\Users\##\Documents\NVIDIA Nsight\nvcompatlog.txt'
The file then says
cuGraphicsGLRegisterImage (Registering GL textures for CUDA-Interop is unsupported)
Does it mean there is no way to debug CUDA, when there is interop present? It's hard to believe and so I want to make sure the problem is not on my computer only.
cuGraphicsGLRegisterImage is not supported in Graphics Debugger as the nvcomlog.txt said.
The Cuda Debugger should work. Please contact devtools-support#nvidia.com, you may be asked for the code.