13

Initially the Java vm would not even start, but I fixed that by editing the nsight.ini file and removing

-XX:MaxPermSize=256m

and updating the

-Dosgi.requiredJavaVersion

so I now get the splash screen and can select a workspace directory.

I do so, and get a progress bar but it promptly crashes and gives no indication other than to look in the log file, the start of which says:

!SESSION 2016-12-09 20:30:40.686 -----------------------------------------------
eclipse.buildId=unknown
java.version=9-internal
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_GB
Command-line arguments:  -os linux -ws gtk -arch x86_64

!ENTRY com.nvidia.cuda.ide.build 4 0 2016-12-09 20:30:46.292
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: com.nvidia.cuda.ide.build [9]
  Unresolved requirement: Require-Bundle: org.eclipse.cdt.managedbuilder.core
    -> Bundle-SymbolicName: org.eclipse.cdt.managedbuilder.core; bundle-version="8.3.0.201409172108"; singleton:="true"
       org.eclipse.cdt.managedbuilder.core [108]
         Unresolved requirement: Require-Bundle: org.eclipse.cdt.core; bundle-version="[5.0.0,6.0.0)"
           -> Bundle-SymbolicName: org.eclipse.cdt.core; bundle-version="5.7.0.nvidia-qualifier"; singleton:="true"
              org.eclipse.cdt.core [88]
                Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=1.7))"

    at org.eclipse.osgi.container.Module.start(Module.java:434)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1561)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
    at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)

!ENTRY com.nvidia.cuda.ide.cdt 4 0 2016-12-09 20:30:46.294
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: com.nvidia.cuda.ide.cdt [10]
  Unresolved requirement: Require-Bundle: org.eclipse.cdt.managedbuilder.core; bundle-version="8.0.0"
    -> Bundle-SymbolicName: org.eclipse.cdt.managedbuilder.core; bundle-version="8.3.0.201409172108"; singleton:="true"
       org.eclipse.cdt.managedbuilder.core [108]
         Unresolved requirement: Require-Bundle: org.eclipse.cdt.core; bundle-version="[5.0.0,6.0.0)"
           -> Bundle-SymbolicName: org.eclipse.cdt.core; bundle-version="5.7.0.nvidia-qualifier"; singleton:="true"
              org.eclipse.cdt.core [88]
                Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=1.7))"

    at org.eclipse.osgi.container.Module.start(Module.java:434)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1561)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
    at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)

!ENTRY com.nvidia.cuda.ide.debug 4 0 2016-12-09 20:30:46.297
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: com.nvidia.cuda.ide.debug [11]
  Unresolved requirement: Require-Bundle: org.eclipse.cdt.core; bundle-version="5.3.0"
    -> Bundle-SymbolicName: org.eclipse.cdt.core; bundle-version="5.7.0.nvidia-qualifier"; singleton:="true"
       org.eclipse.cdt.core [88]
         Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=1.7))"

    at org.eclipse.osgi.container.Module.start(Module.java:434)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1561)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
    at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)

!ENTRY com.nvidia.cuda.ide.editor 4 0 2016-12-09 20:30:46.309
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: com.nvidia.cuda.ide.editor [12]
  Unresolved requirement: Require-Bundle: org.eclipse.cdt.ui; bundle-version="[5.8.0.nvidia,5.8.1)"
    -> Bundle-SymbolicName: org.eclipse.cdt.ui; bundle-version="5.8.0.nvidia-qualifier"; singleton:="true"
       org.eclipse.cdt.ui [111]
         Unresolved requirement: Require-Bundle: org.eclipse.cdt.core; bundle-version="[5.2.0,6.0.0)"
           -> Bundle-SymbolicName: org.eclipse.cdt.core; bundle-version="5.7.0.nvidia-qualifier"; singleton:="true"
              org.eclipse.cdt.core [88]
                Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=1.7))"

    at org.eclipse.osgi.container.Module.start(Module.java:434)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1561)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
    at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)

!ENTRY com.nvidia.cuda.ide.remote 4 0 2016-12-09 20:30:46.311
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: com.nvidia.cuda.ide.remote [13]
  Unresolved requirement: Import-Package: org.eclipse.remote.core
    -> Export-Package: org.eclipse.remote.core; bundle-symbolic-name="org.eclipse.remote.core"; bundle-version="1.0.0.201409111520"; version="0.0.0"
       org.eclipse.remote.core [263]
         Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=1.7))"

    at org.eclipse.osgi.container.Module.start(Module.java:434)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1561)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
    at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)

I installed nsight at the same time as cuda using the NVIDA .deb package repository they provide on their website.

I added it using:

dpkg -i <cuda_file>.deb

and installed using:

sudo apt update
sudo apt install cuda

Normal eclipse installations work perfectly, so any advice anyone has would be greatly appreciated!

Ben Turner
  • 725
  • 1
  • 6
  • 23
  • It looks to me like some necessary components are not on your machine, for whatever reason. I guess based on the tags you are using Ubuntu 16.04? Which CUDA version are you attempting to install? – Robert Crovella Dec 09 '16 at 21:26
  • You are right, I had the openjdk-8-jdk package installed, but nsight seems to require the oracle-java8 package... – Ben Turner Dec 09 '16 at 21:35

3 Answers3

14

Expending on comments on Ben Turner answer, this what worked for me (Ubuntu 18.04, cuda 10.1). from this thread on Nvidia forum, just install:

sudo apt install openjdk-8-jdk

and that's it.

running from terminal:

nsight -vm /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java

and if you want to start Nsight from GUI, modify /usr/share/applications/nsight.desktop like so

Exec=/usr/local/cuda-10.1/bin/nsight -vm /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
Haim Itzhayek
  • 181
  • 2
  • 9
  • Worked with Ubuntu 19.10, CUDA 10.1, and a previous installed JRE11. Sweet! – smcs Nov 05 '19 at 12:34
  • Hold on, I did have to remove Openjdk 11 eventually. – smcs Nov 05 '19 at 12:42
  • +1 for the GUI line. I updated by CUDA 'stuff', and it updated the SDK but broke the drivers. Re-installed the drivers (which bumped everything to CUDA 10.2) but it lost the above jvm ref – winwaed Nov 23 '19 at 03:29
  • Works for me (Ubuntu 18.04, didn't remove openjdk-11). Also, I have a couple of tweaks. 1) You can use just `openjdk-8-jre` instead of `openjdk-8-jdk`. 2) Instead of modifying the command line with `-vm ...`, you can add it to `/usr/local/cuda-10.0/libnsight/nsight.ini`, which is a renamed `eclipse.ini`: https://wiki.eclipse.org/Eclipse.ini#Specifying_the_JVM. This way it works both from the terminal and the GUI. – lapis May 09 '20 at 21:43
  • This worked for me on Ubuntu 21.04. Note that I saw that `openjdk-17-jdk` exists, and tried it first, but that crashed out pronto with a `java.lang.ExceptionInInitializerError`. The OpenJDK version 8 is still available as a package in Ubuntu 21.04. – user2023370 Dec 20 '21 at 13:39
11

So turns out that the openjdk-8-jdk package is not what's needed to work with nsight.

You need to install the oracle-java8-installer:

sudo apt install python-software-properties
sudo add-apt-repository ppa:webupd8team/java
sudo apt update
sudo apt install oracle-java8-installer

Once done, nsight miraculously springs into life!

Ben Turner
  • 725
  • 1
  • 6
  • 23
  • This worked for me on Ubuntu 18.04. I suspect Pingmin Fenlly Liu's answer would also have worked. I assume that my Java version has been set to oracle-java8 by following the above commands, and that if it changed again things would stop working. The python-software-properties package is no longer supported and apt suggests that software-properties-common replaces it. – TafT Feb 11 '19 at 14:05
  • it does not work on ubuntu 18.04. There's no more a package oracle-java8-installer. – cleuton May 24 '19 at 10:46
  • 2
    `sudo apt install openjdk-8-jdk` on ubuntu 18.04 as of June 2019 – Vineet Bansal Jun 28 '19 at 20:21
  • 5
    From Nvidia's forum: And after the installation, you may use the command below to run your Nsight: `nsight -vm /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java` -- worked for me. CUDA 10.1 Ubuntu 18.04 in Sept 2019. – aafulei Sep 28 '19 at 17:16
  • @aafulei FWIW, I also have CUDA 10.2 installed alongside in Ubuntu 20.04 in June 2020. The defailt is still 10.1. 10.2 still needs jvm8. Your answer works like this: /usr/lib/cuda-10.2/bin/nsight -vm /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java – emsr Jun 02 '20 at 18:41
4

Solution summary:

Use Java 7/8, not Java 9/10/11, for Nsight Ecplipse Edition at present.

Details:

I installed the CUDA 10.0, with auto-installed Nsight 10.0 and java-11-openjdk(its java version is 10.0.2 actually), on Ubuntu 18.04, and I got this error too. Then I found when I used oracle jdk 7/8(make the link from /usr/bin/java to my oracle jdk 7/8 path), Nsight worked well, but jdk 11 not.

And by seeing your java 9 in the error log, so we should use the Java 7/8, not 9/10/11, for Nsight at present, because the Nsight Eclipse and its plugins is not up-to-date for java 9/10/11.

Notes:

You may want to change the exec cmd("Exec=/usr/local/cuda-10.0/bin/nsight") in the "/usr/share/applications/nsight.desktop", to avoid other issues for system java compatibility.

I just change the cmd to "Exec=/ddisk/program/cuda/nsight.sh", and set the java 7/8 home in the shell script, and then run the "nsight" . Because if I change the /usr/bin/java link directly on my Ubuntu 18.04, it leads the Thunderbird's secure message extension "Enigmail"(pep-json-server) to high CPU and Mem usage.

#!/bin/bash

# nsight.sh

# Java paths.
# NOTE: We should use java 7 or 8 for Nsight Eclipse Edition 10.0.
#export JAVA_HOME=/ddisk/program/java/latest
export JAVA_HOME=/ddisk/program/java/java7
#export JAVA_HOME=/ddisk/program/java/java8
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=$JAVA_HOME/lib:$JRE_HOME/lib:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar
export PATH=$JAVA_HOME/bin:$PATH

# Run the Nsight Eclipse.
#nsight
/usr/local/cuda/bin/nsight