I'm using NVIDIA Visual Profiler to profile a kernel on a Pascal GPU (as those aren't supported by Nsight Compute) - with CUDA 11.4 on a Devuan GNU/Linux 4 system.
When I run nvvp
, it crashes immediately, saying:
$ nvvp
java.lang.ExceptionInInitializerError
at org.eclipse.osgi.storage.Storage.<init>(Storage.java:97)
at org.eclipse.osgi.storage.Storage.createStorage(Storage.java:84)
at org.eclipse.osgi.internal.framework.EquinoxContainer.<init>(EquinoxContainer.java:75)
at org.eclipse.osgi.launch.Equinox.<init>(Equinox.java:31)
at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:295)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:231)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected void java.net.URLClassLoader.addURL(java.net.URL) accessible: module java.base does not "opens java.net" to unnamed module @21bcffb5
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:357)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199)
at java.base/java.lang.reflect.Method.setAccessible(Method.java:193)
at org.eclipse.osgi.storage.FrameworkExtensionInstaller.findMethod(FrameworkExtensionInstaller.java:52)
at org.eclipse.osgi.storage.FrameworkExtensionInstaller.findMethod(FrameworkExtensionInstaller.java:59)
at org.eclipse.osgi.storage.FrameworkExtensionInstaller.findAddURLMethod(FrameworkExtensionInstaller.java:43)
at org.eclipse.osgi.storage.FrameworkExtensionInstaller.<clinit>(FrameworkExtensionInstaller.java:37)
... 14 more
Why is this happening, and how can I circumvent/fix this error?
Additional information:
- The default JAVA VM is: openjdk 17-ea 2021-09-14.
CodePudding user response:
The InaccessibleObjectException
seems to be caused by using Java 17 to run Java code that is not ready for Java 17. Java 17 is more restrictive than previous Java versions, breaking backwards compatibility in this point.
Use Java 16 or 11 instead of Java 17.
CodePudding user response:
As @howlger suggests, this is caused by newer versions of Java being more restrictive than older ones with which NVVP was tested. So, run it with an older version:
- Download a Linux JDK from this archive at jdk.java.net (hopefully some version between 11 and 16 should do).
- Install it; suppose it's under
/path/to/jdk
. - Edit your
nvvp.ini
; it should be at/usr/local/cuda/libnvvp/nvvp.ini
. - Add:
to the file (it should not already have such a line).-vm /path/to/jdk/bin/java
- Run NVVP