问题
I am trying to run the first example in rootbeer
library, which you can find from here.
The issue is, even though I followed all of their instructions, I am getting the following message when I am trying to run the Jar
root@ubuserver3:/home/ubuadmin/JavaJars/HelloWordGPU# java -jar HelloWorldGPU.jar
OpenJDK Client VM warning: You have loaded library /usr/lib/libcuda.so.319.37 which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
Exception in thread "main" java.lang.NullPointerException
at org.trifort.rootbeer.runtime.Rootbeer.run(Rootbeer.java:104)
at ScalarMult.test(ScalarMult.java:13)
at Main.main(Main.java:17)
I am not a Linux person, so I do not understand how to execute this command properly. I also don't understand what they mean by that message, because this is the first time I am on GPU programming. But I know messing with GPU with wrong commands would be a problem.
回答1:
Type: execstack --version
to check if you already have execstack installed.
If you get command not found type: sudo apt-get install execstack -y --force-yes
Type sudo execstack -c <file>
e.g sudo execstack -c /usr/lib/libcuda.so
回答2:
1: Check execstack version using following command to find execstack installed or not
execstack --version
2: If execstack not installed then install using following command
sudo apt-get install execstack -y --force-yes
3: After successful installation execute following command
sudo execstack -c <filepath>
eg: sudo execstack -c /usr/lib/libjpcap.so
回答3:
make sure you are not running 32-bit jar on 64-bit jvm first
回答4:
Make sure you are not running 32-bit Java. If you run java -d64, the 32-bit version will print an error.
来源:https://stackoverflow.com/questions/22345891/stack-guard-might-have-disabled