Artifact file not found error with NVIDIA NSight

Problem

I tried to install the Vrapper plugin to NVIDIA NSight. Everything went fine until the last step, which gave this error:

An error occurred while installing the items
session context was:(profile=cider, phase=org.eclipse.equinox.internal.p2.engine.phases.Install, operand=null --> [R]org.eclipse.equinox.launcher.gtk.linux.x86_64 1.1.200.v20120913-144807, action=org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions.InstallBundleAction).
The artifact file for osgi.bundle,org.eclipse.equinox.launcher.gtk.linux.x86_64,1.1.200.v20120913-144807 was not found.

Solution

Go to ~/.eclipse. One of the subdirectories here holds the configuration files for NSight. The other subdirectory might be for Eclipse, if you have installed it and are using it. Delete the NSight subdirectory. Open NSight again and try installing Vrapper. It worked this time for me.

Tried with: Vrapper 0.44, NVIDIA NSight 5.5 and Ubuntu 14.04

How to exclude a file from build in Eclipse

There are some source files which you might like to have in your Eclipse project, but might not want them to be built. Or sometimes you might want some files to be built for a certain build configuration and want it to be excluded from another build configuration.

To do this, right-click on the file in the Project Explorer, choose Resource Configurations > Exclude from Build and choose the configurations that you want. To completely exclude the file, choose all the available configurations.

Tried with: NVIDIA Nsight 5.5 and Ubuntu 12.04 LTS

How to create Eclipse project from existing source

When you create a project in Eclipse (or NVIDIA Nsight), it creates a new directory in your workspace and creates the files there. If you have your source files arranged under a directory in some other location, you might prefer to work on them without Eclipse copying them over to its workspace directory.

To achieve this, do not use the import option! Instead create a new project, in its dialog uncheck the Use default location option and provide the root directory of your source code. The entire contents of your source directory will appear in the newly created project. Do not fear, they have not been copied. Instead, Eclipse has created .project, .cproject and other hidden files and directories in your source directory, so that it can work from there. Also, any new files or directories you create under your source directory will automatically appear in your Eclipse project.

Another alternative to this approach is to create a Makefile project, which works similarly.

Tried with: NVIDIA Nsight 5.5.0 and Ubuntu 12.04 LTS

How to specify option to host compiler using nvcc

Options specified to host compiler in Nsight
-std=c++11 option specified to host compiler in Nsight

nvcc is the CUDA compiler driver that is used to compile both .cu and .cpp files. There are many options that be specified to nvcc for device code compilation. To specify options to the host compiler, place them after the option -Xcompiler.

If you are using Nsight, go to Project > Properties > Build > Settings > Tool Settings > NVCC Compiler > Build Stages. Add the compiler options that you want to the Preprocessor options (-Xcompiler) section.

Tried with: Nsight 5.5 and Ubuntu 12.04 LTS

How to specify host compiler for nvcc

Host compiler specified in Nsight
Host compiler specified in Nsight

nvcc is the compiler driver used to compile both .cu and .cpp files. It uses the cl.exe (on Windows) or gcc (on Linux) executable that it can find as the compiler for host code. Sometimes, you may want to specify a different host compiler or a different version of the host compiler to be used to compile the host code.

To do that, specify the full path of the compiler executable to the --compiler-bindir or the -ccbin option of nvcc.

If you are using Nsight, go to Project > Properties > Build > Settings > Tool Settings > NVCC Compiler > Build Stages. Specify the path of the compiler in the field Compiler Path.

Tried with: NSight 5.5 and Ubuntu 12.04

Workspace unavailable error in Eclipse

Workspace unavailable error of Eclipse
Workspace unavailable error of Eclipse

Problem

You open Eclipse or NSight and it greets you with this error:

Workspace unavailable
Workspace at in use or cannot be created, choose a different one

Solution

Eclipse creates a .metadata/.lock file in your workspace directory when it is open. If this file was not deleted when you closed Eclipse, you can get this error. Delete that file and you should be able to open Eclipse without any error.

Tried with: NSight 5.5.0 and Ubuntu 12.04 LTS

Vrapper plugin for Eclipse

Vrapper is a plugin that adds Vim-like editing features to Eclipse. It also works with IDEs that are built upon Eclipse, like Nsight Eclipse for example.

Install and use

  • To install Vrapper, go to Help -> Install new software -> Add and add the URL: http://vrapper.sourceforge.net/update-site/stable

  • Eclipse downloads and displays the plugins. Choose Vrapper. Note: Do not choose Vrapper – Split Editor Plugin if you are not on Eclipse 4.x. Do not choose Vrapper – Java Extensions or Vrapper – Python Extensions if you do not have those features in Eclipse. The rest of the install is straightforward.

  • If you feel the need to customize some Vim settings for Vrapper, do them in ~/.vrapperrc. Only the settings listed in the Vrapper configuration page are supported.

Vrapper features

Apart from the usual Vim features, here are some Vrapper-specific features I like to use:

  • Eclipse bookmarks can be set easily by using Vim mark feature with uppercase letter.

  • GVim can be opened on the current file and line by using the command :vim

Tried with: Vrapper 0.36.0, NSight 5.5 and Ubuntu 12.04 LTS

How to increase heap space of Eclipse

Problem

You find that Eclipse (or NVIDIA Nsight) spends too much time on indexing your source files. Or it sometimes complains about not having enough heap space. Or it throws an error message that says:

GC overhead limit exceeded

Eclipse (or Nsight) is a java program, so it runs on your Java Virtual Machine (JVM). These symptoms typically indicate that the JVM is not having enough heap space for its objects.

Solution

When Eclipse is invoked, it passes the parameters set in its eclipse.ini file to the JVM. So, you can speed up or improve the performance of Eclipse by changing these parameters passed to the JVM.

First, find out where is the eclipse.ini file on your system. On my Ubuntu, I find that it is at /usr/lib/eclipse/eclipse.ini. For Nsight, the file is named nsight.ini and I found it at /usr/local/cuda-5.5/libnsight.

I found that the default parameters for the heap space were set as this:

-Xms40m
-Xmx256m
-XX:MaxPermSize=256m

That is, the heap begins with a size of 40MB initially and can reach a maximum of 256MB. And it can use a maximum of 256MB of space for storing objects that are permanent during runtime. These limits are ridiculously small for modern systems with 4-8GB of RAM!

I increased them to:

-Xms512m
-Xmx2048m
-XX:MaxPermSize=1024m

This starts the heap at 512MB and can increase upto 2GB and so on. I found that the heap space problems stopped after doing this.

Tried with: Eclipse 3.7.2, NVIDIA Nsight 5.5.0 and Ubuntu 12.04 LTS