In short, I need to understand how to configure eclipse to run "optirun gbd" instead of "gdb". An explanation of what exactly I'm trying to accomplish follows.
I need to run my debug app in eclipse such that it will use the nvidia optimus card instead of the integrated card. My app requires opengl support that is only available this way.
I've got a laptop with an nvidia optimus video card. I'm running linux (ubuntu). I've successfully set up bumblebee such that I can take advantage of the optimus technology. This requires that, to use the nvidia card, I run a given program "foo" with the program "optirun:" optirun foo.
I need to configure eclipse to launch my program in debug mode under optirun. If I run from command line: optirun gdb app everything works as expected.
Edit: Changing the "GDB Debugger" field inside the debug configuration to optirun gdb does not work. Lanching eclipse by optirun eclipse does, however. But this is a detriment to battery life.
Go to "Debug Configurations", open "Debugger" tab. Change "GDB debugger" from gdb to optirun gdb.
Works in Eclipse Juno, Ubuntu 12.04.
Since I'm sure eclipse uses the shell to execute the program, a workaround is to alias gdb to optirun gdb in ~/.bashrc
I look into this issue today and I found another solution. As long as you have Bumblebee installed (http://www.bumblebee-project.org/) and you know you can attach optirun to an executable (try with glxgears for example) you can attach it to cuda-gdb.
What I did is create a script:
#!/bin/bash
optirun /usr/local/cuda/bin/cuda-gdb $*
And save it to /usr/local/cuda/bin or somewhere else it doesn't matter, with the appropriate permissions for execution (755).
What it does is very simple, it runs optirun cuda-gdb args where args is whatever the command line sends it.
In terminal just run opti_cuda-gdb with or without arguments.
For example I named it opti_cuda-gdb and placed it in that directory (which conveniently is added to the path if CUDA is properly configured).
If you use an IDE to develop, like say Netbeans, point the debbuger executable to that script.
I've been successfully compiled and debbuged code using CuSparse and CuBlas with NetBeans running in a SAMSUNG SF410 with Nvidia Optimus and Ubuntu 11.04 and 11.10.
I'm open to provide further details if you think I omitted something.
Related
I try to build a reproducible automated build environment based on Debian 8.1 Jessie.
I created a boot iso image based on a netinstall image and put a preseed.cfg file in int for automatic installation.
I managed to get it bootable with BIOS and UEFI and can install a KDE Developer Debian in VMWare Workstation 11 fully automated.
I have also a server iso image to install a debian Server with Jenkins, both with BIOS and UEFI Boot.
But after the installation, the Version with UEFI Boot shows a black Screen when started.
I can blindly log in, start the gui with "startx" and see my installed xfce desktop. When i quit xfce the console is usable and visible.
I tried suggested bootparameters "nomodeset" and "vga=Linux" that i found with google to no avail.
I also tried to debug the boot prozess, to find out which command leads to a blank screen, but i did not find the right place to delay the processes at bootup so i can see when the messages dissapear (quiet bootparameter was removed :-)
I also tried to reset the console to no avail.
Can anybode point me to a tool that does the same "switching" like X so the console is useable?
Can anybody give me some hints how to debug the bootprocess to find out which command is causing this behaviour?
I dont want to install X because this should be a headless server system later.
I managed to get my system to boot using the kernel command line modprobe.blacklist=vmwgfx, or placing 'blacklist vmwgfx' in /etc/modprobe.d/*.conf
I assume it is some bug in the vmwgfx module, however as this workaround works for me I have no immediate need to investigate further.
I am running Xubuntu on a 64 bit machine. When trying to debug a Beaglebone using gdb (via Eclipse) I get the following error message:
"Remote 'g' packet reply is too long"
See here for more details:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=509479
At the host I am using gdb-multiarch.
When start it, it announces:
"This GDB was configured as "x86_64-linux-gnu"."
Can you please tell me how to configure GDB to work with a 32 bit target? Any other thoughts?
Thank you.
As far as I know the BeagleBone uses an ARM processor.
You'll have to get the ARM version (more precise: version for debugging ARM processors) of GDB to debug - you cannot do this with the x86 version.
For Windows the ARM version is available in the "WinARM" packet.
Maybe for Linux such a packet does not exist and you'll have to re-compile GDB.
Add "set architecture arm" to the .gdbinit file referenced in Eclipse under Debug Configurations -- Debugger -- GDB command file. Make sure the .gdbinit file can be found at run-time by making sure GDB command file contains full path to file.
I encountered a similar issue trying to set up cross compilation through Eclipse with a Ubuntu 12.04 Host VM running on a Mac connecting to a Beaglebone Black target. When trying to debug my project, I would get the same "Remote 'g' packet reply is too long" error. What solved this issue for me was to go into the Debug Configuration for your project, select the Debugger tab, and replace gdb to gdb-multiarch the GDB debugger field.
I am new to threading (multicore programming). I was told that programming with parallel process threads can only be done on linux systems, and not windows? Is that true?
I have a Windows 7 system. My homework is the use pthreads to do matrix multiplication in C++. Is there any way for me to do it on my Windows 7?
Also, my teacher asked my to use gedit. How do I run codes in Gedit? I do not see a compile button, and do not know what I can do in place of the compilation command in linux?
Thanks.
gedit is just a text editor , maybe your teacher use it in order to write code.
For implementing pthread you can use a IDE such like codeblocks , it's free.
open a new project , and in build option -> lincker setting add : pthread , finally include in your project "pthread.h" then you can create , destroy .threads as you want
If you want to do it in Windows 7, Install a virtual machine and any ubuntu (Linux variant). Use the virtual machine to access ubuntu from windows7 itself. And then install gcc and gedit tools on your ubuntu. Write a code on gedit, save it and then from the command prompt run the following command to compile it:
gcc code.c -o code
code will be your executable.
I installed cuda 5 in my Ubuntu 12.10 and it is working well, I can compile and debug through cuda-gdb in terminal as well. I'm trying to use nsight, it compiles and executes my code with no issues, but when I try to debug I got the following error
Error in final launch sequence
Failed to execute MI command:
-gdb-set cuda api_failures ignore
Error message from debugger back end:
Undefined set cuda command: "api_failures ignore". Try "help set cuda".
Undefined set cuda command: "api_failures ignore". Try "help set cuda".
I'm using ubuntu 12.10 64 bits and launching cuda executables and nsight with optirun (bumblebee) because I have a GTX 675M (optimus). I installed cuda-gdb throught apt-get, I got version 4.2:
frederico#zeus:~/Dropbox/coisas/projetos/delta_cuda$ cuda-gdb --version
NVIDIA (R) CUDA Debugger
4.2 release
Portions Copyright (C) 2007-2012 NVIDIA Corporation
GNU gdb (GDB) 7.2
I think this is not a problem since I can use it alone (without nsight). I changed nsight to launch cuda-gdb with optirun as well, keep receiving the same error.
The problem was the version of cuda-gdb, I had to use cuda-gdb version 5. It comes with the toolkit version 5, just did a symbolic lick to /usr/bin and it's working.
It is possible to debug CUDA programs with nsight and bumblebee.
(nsight v.5.0.0, bumblebee 3.2.1, Debian sid)
You just have to replace the debugger command line (CUDA GDB Executable) in:
Project Explorer -> right click on your project -> select "Debug as" -> click on "Debug configurations..." -> select "Debugger" tab
CUDA GDB Executable: optirun --no-xorg cuda-gdb
(another possibility is to make a small shell script like the one that follows: /usr/bin/opti-cuda-gdb)
#!/bin/bash
optirun --no-xorg /usr/bin/cuda-gdb $*
This way optirun does not start a virtual screen for gdb, the GPU is not accepting graphics and debug is possible.
Hope that helps!
There's no need to create this link.
You can select the cuda-gdb executable used by nsight in the Run/Debug Configurations... Menu.
In this menu, click on your application under C/C++ Application, then choose the Debugger tab where you can browse your filesystem and set the path to the cuda-gdb-5.0 executable.
How to enable debugger in fp-ide? I read somewhere that I should compile fp-ide from sources, but I don't know how to do this. Can someone help me?
Get the generic linux tar installer (fpc-2.6.0.x86_64-linux.tar) for FPC from http://www.freepascal.org/down/x86_64/linux-hungary.var It comes with a precompiled IDE with integrated debugger support and it works fine at least on 12.04 LTS.
I wasn't able to find a PPA for fp-ide, but I can describe how the CLI IDE is compiled on Arch Linux as documented in the repository. Do note that compiling will not enable the debugger in the CLI, as it seems to be an incompatibility between gdb and fp (fp-ide) according to e.g. this bug report in Debian. On Arch Linux, the fpc package also doesn't support the debugger in fp by design (it is explicitly disabled using the NOGDB flag).
Anyhow, here goes the compilation process:
Make sure you have FreePascal installed already, as you need it to compile the IDE
Download the source tarball
Extract the tarball to a location of your convenience and cd into that directory
Execute the following code from within your shell:
pushd fpcsrc/compiler
fpcmake -Tall
popd
make build
make -j1 install
# in Arch, the switch "NOGDB=1" is present in both make lines
That should compile the IDE and install it (you can even try to integrate it in dpkg by using checkinstall instead of make install, but take a look at the Arch PKGBUILD to see an example of what might be needed).
But why do you use the command line IDE fp instead of lazarus? With lazarus you can also make console applications and it offers much more features (e.g. working debug support).