Hello, I'm trying to execute the MatrixVectorMul example, and I get the following error java.lang.IllegalStateException: The MatrixVectorMul needs at least one GPU device while finding 0 GPU.
at org.apache.flink.util.Preconditions.checkState(Preconditions.java:193)
at org.apache.flink.streaming.examples.gpu.MatrixVectorMul$Multiplier.open(MatrixVectorMul.java:163)
at org.apache.flink.api.common.functions.util.FunctionUtils.openFunction(FunctionUtils.java:34)
at org.apache.flink.streaming.api.operators.AbstractUdfStreamOperator.open(AbstractUdfStreamOperator.java:102)
at org.apache.flink.streaming.runtime.tasks.RegularOperatorChain.initializeStateAndOpenOperators(RegularOperatorChain.java:107)
at org.apache.flink.streaming.runtime.tasks.StreamTask.restoreStateAndGates(StreamTask.java:818)
at org.apache.flink.streaming.runtime.tasks.StreamTask.lambda$restoreInternal$3(StreamTask.java:772)
at org.apache.flink.streaming.runtime.tasks.StreamTaskActionExecutor$1.call(StreamTaskActionExecutor.java:55)
at org.apache.flink.streaming.runtime.tasks.StreamTask.restoreInternal(StreamTask.java:772)
at org.apache.flink.streaming.runtime.tasks.StreamTask.restore(StreamTask.java:731)
at org.apache.flink.runtime.taskmanager.Task.runWithSystemExitMonitoring(Task.java:960)
at org.apache.flink.runtime.taskmanager.Task.restoreAndInvoke(Task.java:929)
at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:753)
at org.apache.flink.runtime.taskmanager.Task.run(Task.java:568)
at java.base/java.lang.Thread.run(Thread.java:840)
Suppressed: java.lang.NullPointerException: Parameter 'devicePtr' is null for cublasFree
at jcuda.jcublas.JCublas.cublasFreeNative(Native Method)
at jcuda.jcublas.JCublas.cublasFree(JCublas.java:291)
at org.apache.flink.streaming.examples.gpu.MatrixVectorMul$Multiplier.close(MatrixVectorMul.java:247)
at org.apache.flink.api.common.functions.util.FunctionUtils.closeFunction(FunctionUtils.java:41)
at org.apache.flink.streaming.api.operators.AbstractUdfStreamOperator.close(AbstractUdfStreamOperator.java:116)
at org.apache.flink.streaming.runtime.tasks.StreamOperatorWrapper.close(StreamOperatorWrapper.java:163)
at org.apache.flink.streaming.runtime.tasks.RegularOperatorChain.closeAllOperators(RegularOperatorChain.java:125)
at org.apache.flink.streaming.runtime.tasks.StreamTask.closeAllOperators(StreamTask.java:1132)
at org.apache.flink.util.IOUtils.closeAll(IOUtils.java:255)
at org.apache.flink.core.fs.AutoCloseableRegistry.doClose(AutoCloseableRegistry.java:72)
at org.apache.flink.util.AbstractAutoCloseableRegistry.close(AbstractAutoCloseableRegistry.java:127)
at org.apache.flink.streaming.runtime.tasks.StreamTask.cleanUp(StreamTask.java:1040)
at org.apache.flink.runtime.taskmanager.Task.lambda$restoreAndInvoke$0(Task.java:942)
at org.apache.flink.runtime.taskmanager.Task.runWithSystemExitMonitoring(Task.java:960)
at org.apache.flink.runtime.taskmanager.Task.restoreAndInvoke(Task.java:942)
... 3 more
I've made sure I've set the conf.yaml to use the gpu as external resource, cuda is installed on the machine, jcuda is in the lib folder, and other non flink jcuda examples run fine. Any idea what I could be doing wrong? Thank you!
Flink version 1.19, cuda version 11.8.0 java version 17.0