How to debug CUDA using eclipse Nsight with only one GPU - eclipse

I'm getting an error: "all cuda devices are used for display and cannot be used while debugging"
(Using Ubuntu)
Is there ANY way to use Nsight eclipse with only one GPU for debugging?
I have seen solutions like
"sudo service lightdm stop"
to kill X but that kills Nsight eclipse too so what's the point?
Update: Since it is not possible to debug with the same GPU that runs X, I have to ask: How does one go about using ANOTHER computer in his home network to "remotely" access Ubuntu in such a way that the X desktop rendering will be performed by the Guest computer while letting the host GPU run the debugger?

In general, it's not supported to debug on the same GPU that is hosting an X display. From the nsight getting started guide: "A GPU that is running X11 (on Linux) or Aqua (on Mac) cannot be used to debug a CUDA application and will be hidden from the application ran in the debugger. Such GPU can still be used for profiling GPU applications. "
I believe there is actually different behavior amongst different window managers, however. I have a laptop with Quadro1000M and RHEL 6.2 (with GNOME), with CUDA 5.0, and I am able to get into the debugger in nsight EE (Project...Build Project followed by Run...Debug). At that point I can step through and set breakpoints in host code. And if I run the code to completion I get proper output. However, you still can't debug device code. If you set a breakpoint in the device code (and hit that breakpoint), you will hang the X session.
EDIT: CUDA 5.5 and beyond now support the ability to debug on a single cc3.5 or higher GPU.

It seems that you can use CUDA 5.5 to debug CUDA programs in a machine with only one GPU.
See section 1.7.3.2. CUDA-GDB of CUDA_Toolkit_Release_Notes

Another approach which might work is to use the onboard video output for the display.
That way you use the onboard graphics for the display and the GPU for debugging.
For this you have to:
Go to BIOS and change the primary display adapter to "On-Board" (this varies from manufacturer to manufacturer)
Physically connect you display to the on-board display output feed
Restart and then run Nsight
If you are using a system with no on-board graphics, then you are out of luck!
This guy here has been able to get it up and running in Windows with Visual studio and Nsight plugin.
P.S. You would probably need to edit your xorg.conf to make X use onboard graphics instead of your Nvidia GPU.

Related

OpenBSD Unsupported Video Signal [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
Spent a couple hours this evening on the #openbsd irc channel troubleshooting a display issue. Couldn't figure this one out though we had fun trying!
Specs:
USB Stick and Openbsd 6.2 Image
Known good,
Openbsd image installed successfully from this USB, to a virtual env on a separate device, using these instructions
Desktop computer
Motherboard, 64bit Intel processor
On-board graphics only
Currently running Ubuntu 16.04.03 Server
BIOS (legacy enabled) set to boot USB first
Monitor
40" Toshiba LCD TV Model 40UX600U
Symptoms
Start computer on Ubuntu server, displays just fine, no issues
Boot to Openbsd USB stick, bios screen runs, self check passes then monitor displays "Unsupported Video Signal". This is not an Openbsd message, but rather from the monitor itself.
Done so far
Cleanly formatted USB (under supervision)
Installed from USB to virtual env on separate device, no issues, loads Openbsd just fine.
Boot computer to Ubuntu, display works perfect
Boot computer to Openbsd USB, display shows error message above.
Unplug and replug VGA cable
Power off, power on monitor
Suspicions
- Pg. 88 of the Toshiba monitor manual shows a table of Acceptable Signal Formats for PC IN. My hunch is the graphics driver is incompatible with this monitor.
Questions
Is there anything I can do to make this monitor work with a new Openbsd 6.2 install?
How can I check Openbsd monitor compatibility before embarking next time?
Ubuntu has KMS support for the nVidia graphics card but OpenBSD only has support for the old UMS driver. The OpenBSD kernel (probably, I'm not sure) is using 640x480 as resolution and the Linux kernel is using the highest resolution supported by your monitor.
You have two options to "fix" the problem. Install OpenBSD on another computer or with a different monitor (you can also use a laptop with a USB<->HDD adapter), when the installer ask if you want graphics support (or something like that, I don't remember), reply yes. Finish the installation and reboot. Then move the HDD to the original computer and power on the machine. You will see the same message but at some point the system will run xenodm (a graphical launcher for X11 sessions, like xdm), then the monitor will work fine. Unfortunately, you can't see the console messages.
Don't change xorg.conf, your problem is not only related to the monitor. Another option (quite better, imho) is to buy a cheap used ATI graphics card and just install OpenBSD. The ATI graphics cards are fully supported (except the newest ones) and have KMS support. You will only see the message during two or three seconds and after of that, you will see the console. Maybe you will need run the installer on a different computer or with a different monitor, but everything will work fine after of that.
Anyway, OpenBSD uses only a standard mode for the basic console. It doesn't make weird unsupported things. So, probably your monitor has some kind of problem with the lowest VGA resolution/frequency. The problem is that the OpenBSD kernel can't change to a higher resolution during the boot process because it doesn't support the nVidia cards at the kernel level. It uses a userland driver for the nVidia cards, like the Linux/BSD/Unix traditionally used to use.
If you have an old (like 10 years or so) Linux LiveCD/installer, try to run it on your computer. You will see the same problem.

Can I develop with VS Code on the new Samsung Chromebook Pro?

Thinking more about leaving my MBP at home and instead taking the new Samsung Chromebook PRO to Starbucks for the day.
Is this fantasy or will VS Code run properly on this new machine? I see options for the Arm chip based PLUS model but nothing for the PRO.
Is a port available and if so how has development been, good?
UPDATE
I guess this is a hard question to answer? Essentially, I just want to leave my heavy MBP that always needs a power outlet at home. Just want to head out with a light weight machine and work on it anywhere.
The PRO does run Linux but I have not verified clearly that VS Code can run in this environment. Being in Canada I have no access to the PRO yet, can only order it from USA at this point, which I might do once I know the verdict to my question.
My team and I have been experimenting heavily with the Samsung Chromebook Pro and have been actively switching our development environments completely over to the Chromebook ecosystem (away from Mac). Personally I run a combination of Atom and NeoVim with a complete development environment for Node.js, Postgres, and Redis on my Chromebook Pro.
For any desktop IDE you'll need to run Crouton which means you'll have to put your Chromebook into developer mode which is less secure. If you don't want to do that your only options are either use something like Caret (which will only do basic text editing) or to use some sort of cloud-based IDE; ones I know of: Cloud9, Codenvy, Shiftedit, and Eclipse Che (an open source one that just recently caught my eye).
The good news is Crouton can run effectively anything that Linux can (especially since the Pro has an x86 processor), and from what I can tell VSCode supports Ubuntu, the default Linux distribution for Crouton. You can even set up the Crouton Extension to put your GUI programs into Chrome tabs or windows within ChromeOS using Xiwi.
Anything with a GUI running in Crouton is going to hurt performance and battery life on Chromebook since ChromeOS is finely tuned for running specifically the Chrome Browser. I don't expect you run out and learn a terminal-based editor today if you haven't already, but I highly recommend at least getting comfortable using the terminal for quick editing, using git, and running simple shell commands. That will save you that sweet Chromebook battery life and a bit of frustration dealing with a somewhat-quirky Xiwi and Crouton Extension.
If you're willing to work out a few kinks the Chromebook Pro development experience is pretty great. It's truly a quality piece of hardware and ChromeOS is fantastic with the addition of the ability to run Android apps.
UPDATE (9/19/17):
There is another option now for at least getting server environments running on ChromeOS without using developer mode. It's called Termux, an Android app, which can bind to a local port and can be interfaced with via SSH. You can read more on the blog post we came across here: https://blog.lessonslearned.org/building-a-more-secure-development-chromebook/ You will, however, have to use a terminal-based text editor like VIM or a native ChromeOS one like Caret, so it will not run GUI editors like VSCode or Atom.
Check out https://coder.com
It's basically VS Code running on a remote server, accessible through a browser.
I've just started playing around with it and looks like a perfect fit for a Chromebook. And it's open source too :)
You can now (with the Linux-beta for chromeOS) quite easily run vscode locally on a chromebook, see this step-by-step guide: https://blogs.sap.com/2018/10/16/set-up-vs-code-on-chrome-os-for-local-application-programming-model-development/

Configuring QT Creator on Windows 7 (Raspberry pi is target)

So I will start off by saying that I do NOT want know how to setup or run QT on the pi. I am specifically trying to setup Qt Creator 4.0.3 (Based on Qt 5.7.0 (MSVC 2013, 32 bit)) to write and compile C++ and the run it on the Raspberry pi 2. I have found that running qt on the pi is far to slow.
I have searched for two days to find the right toolchain download for qt/raspberry and its corresponding qt configuration. Nothing seems to work. I have found what seems like a thousand dead ends searching the web. I can write and compile apps for windows console fine. But finding information to cross compile for raspberry seems to be an elusive Unicorn!
Does anyone have this working??? If so which of the many toolchains did you use? And please help me replicate your QT configuration. The closest I have come is using the GCC ARM Embedded toolchain but I cant seem to get the QT options set correctly and I believe that only gets me part of the way there. My ultimate goal is to control GPIO and use the RadioHead library.
Thanks in advance!
I also wanted to do that, and I actually achieved it, It's called "cross-compilation", you build on the Main PC and then compile it to the target.
Initially I wanted to use my main PC with windows 10, but I ended creating a linux partition on my pc to do it since I didn't found any way to do it with windows.
Qt has a very comprehensive tutorial with Qt5 and RaspberryPi2 (both with linux), the only problem is you need linux on your pc to do it. If you want to do this I would suggest following this steps:
Create a linux partition with the same os as in the pi (for example raspbian and debian) and name the username (in linux) "pi" and the password "raspberry". This will help you with external libraries.
Install Qt for Linux on your new partition
Follow Qt's tutorial on https://wiki.qt.io/RaspberryPi2EGLFS
The tutorial is really straightforward, I really recommend it.
Good Luck.

clGetPlatformIDs error -1001 when called in PostgreSQL UDF

I'm trying to write an OpenCL function that would be executed inside PostgreSQL. To do this i create DLL from my OpenCL code and link it to postgres using User-Defined Function mechanism. Everything goes well until clGetPlatformIDs is called. Function returns error -1001, which I read that indicates problem with finding OpenCL drivers.
I've tried to compile the same code(i had to remove some postgres magic) to exe and runed it with success - all platforms were found correctly, so I assume that i have correctly set up SDK and drivers.
I am runing PostgreSQL 9.1 on windows 7 x64. I am also using Nvidia CUDA SDK 4.2 with Visual Studio 2010 and running my code on GeForce GTS 450.
It's MSFT's problem with Windows, Services, GPUs, Security and device drivers.
You can't run PostgreSQL as a service on Windows AND see any GPUs. You are hitting Session O Isolation which does NOT allow any 'graphics' device access from a Windows Service. You can start PostgreSQL as a process (not a service) or put the server on Linux.
See http://www.scribd.com/doc/58343489/Windows-Session-0-Isolation-Impact-on-GPU-as-Service
Also there are other important reasons to run on Linux, as Windows will want to reboot your GPU if the screen is not accessed before the timeout period. See
http://msdn.microsoft.com/en-us/library/windows/hardware/ff570088%28v=vs.85%29.aspx
NVida have a non-graphics GPU device driver for specific Tesla cards on Windows. These cards don't have any video output. So they aren't considered to be graphics device drivers.
Maybe the libraries try to locate the SDK using some environment-variables and the environment is not inherited inside the PostegreSQL context.
So try to dump the environment from your two codes and check if any OpenCL/Cuda variables is available in your standalone program and missing in your PostegreSQL UDF.

Windows Phone 7 emulator on a VM?

It seems that the Windows Phone 7 SDK doesn't support running inside a VM. On Parallels, the entire VM simply crashes when the emulator is starting up.
Around the web, though, a few people have reported that they were able to use it by changing a lot of the VM settings.
What do I have to change to be able to run it? I'm specially interested in Parallels, but VMWare or any other simulator that run on OSX if fine for me!
The WinPhone7 (and WinPhone8) emulator is itself a VM and few (if any) general-purpose VM's will host another VM infrastructure, which is why it crashes Parallels etc.
If you want to have the emulator run from within a different VM to the one MS provides, then you're into the realm of extracting images, toggling bits and trying to tack it into your VM of choice. Of course, the chances of the emulator then working as expected with no residual issues is as close to nil as makes no difference ;)
[Update 2013-01-30] VMWare5 & Parallels Desktop 8 now support running Hyper-V guest VM's. This is particularly useful for those wanting to develop against the Windows Phone 8 SDK which runs Windows Phone 8 guest VM's on Hyper-V.
Here's a guide to how to run Visual Studio 2012 & Windows 8 SDK (inc. the Windows Phone 8 Hyper-V-based emulator) in VMWare5 or Parallels desktop 5: Link
Note: Running Windows & Hyper-V inside a VM will be slower than running natively. Dual-booting into Windows (using Boot Camp on OSX) is stil the recommended method of developing for the Windows platform, especially if you want to use Hyper-V guest VM's.
I'm working in VMware Fusion with Expression Blend 4 RC AND the emulator.
works like a charm!
As others have said, WP7 is itself a virtual machine. Even if you can get it to run inside a virtual machine like Parallels, the performance will be abysmal. If your computer supports hardware virtualization, the emulator runs really smooth, without it it's very very sluggish. Running it inside another VM will make it even more sluggish - I am guessing to the point that it's unusable.
I know this is not the answer you want to hear, but I would recommend running Windows in Bootcamp, you will have much better experience developing and emulating.
I'm not so sure about compatibility for long term development, but in last september, I remembering trying the Windows Phone 7.1beta SDK on VirtualBox (I'm using mac SL), a free virtual machine from oracle (previously by Sun) and it works well there.
I just do a regular install of Windows 7 Home Basic (any Win7 except Starter will do, CMIIW) in the VBox with no tweaking at all, install the GuestAddition inside win7 (provided by VBox), then install the SDK. I create new WP project, arrange UI, make some codes as usual, then run it in emulator. Surprisingly, the emulator works fairly well and showing the app I've developed.
I'm not even experience any lag (my macbook is i5, 4GB ram, the VBox setting is dual core, 2GB ram, note that no other heavy mac process is on the run, so I solely run the VBox ... and iTunes for listening musics).
So if you still want to try WP SDK 7.1 on VM, why don't you try VirtualBox? My current VBox is installed with Windows 8 and have no extra space to reinstall the win7+WPSDK. If you do give a try on VBox, please report the result here to inform everyone.
I've run the Android emulator inside a VM before. It was slower, but still usable to test basic apps. Also, the Android emulator was then slow to where you couldn't tell a difference from between native or from within running Eclipse from within a virtual machine running Linux
x86-to-x86 emulation tends to be pretty fast nowadays due to both Intel and AMD CPUs having hardware to help it along. A lot of x86-to-x86 emulation also doesn't do a full emulation (see Android's emulator to see how a full emulator runs in comparison). In the x86-to-x86 case, the faster ones will try to pass as many instructions to the host OS so that a chunk of the code runs natively
People have made claims like 80-95% performance, which is pretty good. If you have a 3.2 GHz CPU, you get knocked down to around a 2.4 GHz equivalent of your CPU. That's not bad at all, and I honestly don't notice that much overhead running in a good x86-to-x86 VM
The biggest reason why the WP emulator has problems with VMs doesn't have to deal with it being a VM-in-a-VM, but it's most likely that it requires DirectX 10. This might have to do with XNA, which is Microsoft's really nifty gaming API that lets you easily port between Windows, WP, and the Xbox 360. A lot of VM programs don't support hardware 3d acceleration
On another note: if you want to use a low-end system, AMD CPUs may fare better since AMD doesn't tend to disable hardware virtualization features in their lower-end CPUs
If you're deploying to a device, you should be able to use a VM, since it's the emulator that has issues being a VM itself.
We have successfully deployed, and performance is acceptable in our environment, virtual Windows 8.1 Pro Desktop under VMware vSphere 5.5 (ESXi 5.5), and have the Windows 8 SDK and Emulator working correctly with no performance issues. (In Education - to University Labs for Windows Phone development).
The issue experienced by most, is you most have the Hypervisor pass through the Intel-VT into the VM, to effecticely create Nested Hypervisors. This is possible using VMware vSphere 5.5.
This option is available in virtual machine version 10, enabled in the vSphere Web Client - Enable Hardware Virtualisation.