我正在尝试设置JCuda并执行示例添加内核。当我在编译JCudaVectorAdd后尝试执行JCudaVectorAdd.java时,我收到以下错误:
Exception in thread "main" java.lang.NoClassDefFoundError: jcuda/driver/JCudaDriver
at JCudaVectorAdd.main(JCudaVectorAdd.java:38)
Caused by: java.lang.ClassNotFoundException: jcuda.driver.JCudaDriver
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 1 more
我已经创建了一个bash文件,其中包含我执行的步骤以到达我所在的位置:
#!/bin/bash
# This system has multiple Cuda instances, so we need to load the correct one
module load cuda-9.2
# Try to remove any jcuda zip files that may have been created previously
rm $HOME/jcuda.zip
# Get jcuda zip file from online, storing into $HOME directory
wget http://www.jcuda.org/downloads/JCuda-All-0.9.2.zip -O $HOME/jcuda.zip
# Remove the 0.9.2 directory in case it exists to get ready for a clean install
rm -rf $HOME/jcuda/JCuda-All-0.9.2
# Unzip the file and store within jcuda directory. NOTE: The version number will be maintained as jcuda/JCuda-ALL-0.9.2.zip, so multiple versions of jcuda can be installed using this script
unzip $HOME/jcuda.zip -d $HOME/jcuda
# Remove the zipped file now that it is no longer needed
rm $HOME/jcuda.zip
# Move into the newly create jcuda directory
cd $HOME/jcuda/JCuda-All-0.9.2/
# Get the example Main program for Vector addition from Jcuda site
wget http://www.jcuda.org/samples/JCudaVectorAdd.java
似乎我在某个地方遗漏了一个步骤,尽管我对java或cuda / jcuda不够熟悉,无法确定我错过了什么。任何人都可以为我指出如何解决此问题的方向,无论是其他步骤是否正在修改我执行的步骤?
收到一只叮咚
相关分类