Closed marc-s-schwartz closed 2 years ago
You don't say specifically what the error is, but this may be the issue with jcuda and newer OSX. Apple being Apple, they keep breaking things (gratuitously IMO). You should have these exclusions in your project deps:
[[org.jcuda/jcuda-natives :classifier "apple-x86_64"] [org.jcuda/jcublas-natives :classifier "apple-x86_64"]]]
Thanks so much for your reply. I've included the exclusions, but still see the same error:
Show: Project-Only All
Hide: Clojure Java REPL Tooling Duplicates (31 frames hidden)
2. Unhandled clojure.lang.Compiler$CompilerException
Error compiling uncomplicate/clojurecuda/info.clj at (1:1)
#:clojure.error{:phase :compile-syntax-check,
:line 1,
:column 1,
:source "uncomplicate/clojurecuda/info.clj"}
Compiler.java: 7652 clojure.lang.Compiler/load
RT.java: 381 clojure.lang.RT/loadResourceScript
RT.java: 372 clojure.lang.RT/loadResourceScript
RT.java: 459 clojure.lang.RT/load
RT.java: 424 clojure.lang.RT/load
core.clj: 6115 clojure.core/load/fn
core.clj: 6114 clojure.core/load
core.clj: 6098 clojure.core/load
RestFn.java: 408 clojure.lang.RestFn/invoke
core.clj: 5897 clojure.core/load-one
core.clj: 5892 clojure.core/load-one
core.clj: 5937 clojure.core/load-lib/fn
core.clj: 5936 clojure.core/load-lib
core.clj: 5917 clojure.core/load-lib
RestFn.java: 142 clojure.lang.RestFn/applyTo
core.clj: 669 clojure.core/apply
core.clj: 5974 clojure.core/load-libs
core.clj: 5958 clojure.core/load-libs
RestFn.java: 137 clojure.lang.RestFn/applyTo
core.clj: 669 clojure.core/apply
core.clj: 5996 clojure.core/require
core.clj: 9 uncomplicate.clojurecuda.core/eval27026/loading--auto--
core.clj: 9 uncomplicate.clojurecuda.core/eval27026
core.clj: 9 uncomplicate.clojurecuda.core/eval27026
Compiler.java: 7181 clojure.lang.Compiler/eval
Compiler.java: 7170 clojure.lang.Compiler/eval
Compiler.java: 7640 clojure.lang.Compiler/load
RT.java: 381 clojure.lang.RT/loadResourceScript
RT.java: 372 clojure.lang.RT/loadResourceScript
RT.java: 459 clojure.lang.RT/load
RT.java: 424 clojure.lang.RT/load
core.clj: 6115 clojure.core/load/fn
core.clj: 6114 clojure.core/load
core.clj: 6098 clojure.core/load
RestFn.java: 408 clojure.lang.RestFn/invoke
core.clj: 5897 clojure.core/load-one
core.clj: 5892 clojure.core/load-one
core.clj: 5937 clojure.core/load-lib/fn
core.clj: 5936 clojure.core/load-lib
core.clj: 5917 clojure.core/load-lib
RestFn.java: 142 clojure.lang.RestFn/applyTo
core.clj: 669 clojure.core/apply
core.clj: 5974 clojure.core/load-libs
core.clj: 5958 clojure.core/load-libs
RestFn.java: 137 clojure.lang.RestFn/applyTo
core.clj: 669 clojure.core/apply
core.clj: 5996 clojure.core/require
hello_world.clj: 1 dragan.rocks.lafp.part-1.hello-world/eval27018/loading--auto--
hello_world.clj: 1 dragan.rocks.lafp.part-1.hello-world/eval27018
hello_world.clj: 1 dragan.rocks.lafp.part-1.hello-world/eval27018
Compiler.java: 7181 clojure.lang.Compiler/eval
Compiler.java: 7170 clojure.lang.Compiler/eval
Compiler.java: 7640 clojure.lang.Compiler/load
REPL: 1 dragan.rocks.lafp.part-1.hello-world/eval27014
REPL: 1 dragan.rocks.lafp.part-1.hello-world/eval27014
Compiler.java: 7181 clojure.lang.Compiler/eval
Compiler.java: 7136 clojure.lang.Compiler/eval
core.clj: 3202 clojure.core/eval
core.clj: 3198 clojure.core/eval
interruptible_eval.clj: 87 nrepl.middleware.interruptible-eval/evaluate/fn/fn
AFn.java: 152 clojure.lang.AFn/applyToHelper
AFn.java: 144 clojure.lang.AFn/applyTo
core.clj: 667 clojure.core/apply
core.clj: 1977 clojure.core/with-bindings*
core.clj: 1977 clojure.core/with-bindings*
RestFn.java: 425 clojure.lang.RestFn/invoke
interruptible_eval.clj: 87 nrepl.middleware.interruptible-eval/evaluate/fn
main.clj: 437 clojure.main/repl/read-eval-print/fn
main.clj: 437 clojure.main/repl/read-eval-print
main.clj: 458 clojure.main/repl/fn
main.clj: 458 clojure.main/repl
interruptible_eval.clj: 115 nrepl.middleware.interruptible-eval/evaluate
interruptible_eval.clj: 150 nrepl.middleware.interruptible-eval/interruptible-eval/fn/fn
AFn.java: 22 clojure.lang.AFn/run
session.clj: 218 nrepl.middleware.session/session-exec/main-loop/fn
session.clj: 217 nrepl.middleware.session/session-exec/main-loop
AFn.java: 22 clojure.lang.AFn/run
Thread.java: 829 java.lang.Thread/run
1. Caused by java.lang.Exception
No namespace: uncomplicate.clojurecuda.internal.constants
core.clj: 4222 clojure.core/refer
core.clj: 4205 clojure.core/refer
RestFn.java: 139 clojure.lang.RestFn/applyTo
core.clj: 669 clojure.core/apply
core.clj: 5955 clojure.core/load-lib
core.clj: 5917 clojure.core/load-lib
RestFn.java: 142 clojure.lang.RestFn/applyTo
core.clj: 669 clojure.core/apply
core.clj: 5978 clojure.core/load-libs
core.clj: 5958 clojure.core/load-libs
RestFn.java: 137 clojure.lang.RestFn/applyTo
core.clj: 669 clojure.core/apply
core.clj: 5996 clojure.core/require
info.clj: 9 uncomplicate.clojurecuda.info/eval27034/loading--auto--
info.clj: 9 uncomplicate.clojurecuda.info/eval27034
info.clj: 9 uncomplicate.clojurecuda.info/eval27034
Compiler.java: 7181 clojure.lang.Compiler/eval
Compiler.java: 7170 clojure.lang.Compiler/eval
Compiler.java: 7640 clojure.lang.Compiler/load
RT.java: 381 clojure.lang.RT/loadResourceScript
RT.java: 372 clojure.lang.RT/loadResourceScript
RT.java: 459 clojure.lang.RT/load
RT.java: 424 clojure.lang.RT/load
core.clj: 6115 clojure.core/load/fn
core.clj: 6114 clojure.core/load
core.clj: 6098 clojure.core/load
RestFn.java: 408 clojure.lang.RestFn/invoke
core.clj: 5897 clojure.core/load-one
core.clj: 5892 clojure.core/load-one
core.clj: 5937 clojure.core/load-lib/fn
core.clj: 5936 clojure.core/load-lib
core.clj: 5917 clojure.core/load-lib
RestFn.java: 142 clojure.lang.RestFn/applyTo
core.clj: 669 clojure.core/apply
core.clj: 5974 clojure.core/load-libs
core.clj: 5958 clojure.core/load-libs
RestFn.java: 137 clojure.lang.RestFn/applyTo
core.clj: 669 clojure.core/apply
core.clj: 5996 clojure.core/require
core.clj: 9 uncomplicate.clojurecuda.core/eval27026/loading--auto--
core.clj: 9 uncomplicate.clojurecuda.core/eval27026
core.clj: 9 uncomplicate.clojurecuda.core/eval27026
Compiler.java: 7181 clojure.lang.Compiler/eval
Compiler.java: 7170 clojure.lang.Compiler/eval
Compiler.java: 7640 clojure.lang.Compiler/load
RT.java: 381 clojure.lang.RT/loadResourceScript
RT.java: 372 clojure.lang.RT/loadResourceScript
RT.java: 459 clojure.lang.RT/load
RT.java: 424 clojure.lang.RT/load
core.clj: 6115 clojure.core/load/fn
core.clj: 6114 clojure.core/load
core.clj: 6098 clojure.core/load
RestFn.java: 408 clojure.lang.RestFn/invoke
core.clj: 5897 clojure.core/load-one
core.clj: 5892 clojure.core/load-one
core.clj: 5937 clojure.core/load-lib/fn
core.clj: 5936 clojure.core/load-lib
core.clj: 5917 clojure.core/load-lib
RestFn.java: 142 clojure.lang.RestFn/applyTo
core.clj: 669 clojure.core/apply
core.clj: 5974 clojure.core/load-libs
core.clj: 5958 clojure.core/load-libs
RestFn.java: 137 clojure.lang.RestFn/applyTo
core.clj: 669 clojure.core/apply
core.clj: 5996 clojure.core/require
hello_world.clj: 1 dragan.rocks.lafp.part-1.hello-world/eval27018/loading--auto--
hello_world.clj: 1 dragan.rocks.lafp.part-1.hello-world/eval27018
hello_world.clj: 1 dragan.rocks.lafp.part-1.hello-world/eval27018
Compiler.java: 7181 clojure.lang.Compiler/eval
Compiler.java: 7170 clojure.lang.Compiler/eval
Compiler.java: 7640 clojure.lang.Compiler/load
REPL: 1 dragan.rocks.lafp.part-1.hello-world/eval27014
REPL: 1 dragan.rocks.lafp.part-1.hello-world/eval27014
Compiler.java: 7181 clojure.lang.Compiler/eval
Compiler.java: 7136 clojure.lang.Compiler/eval
core.clj: 3202 clojure.core/eval
core.clj: 3198 clojure.core/eval
interruptible_eval.clj: 87 nrepl.middleware.interruptible-eval/evaluate/fn/fn
AFn.java: 152 clojure.lang.AFn/applyToHelper
AFn.java: 144 clojure.lang.AFn/applyTo
core.clj: 667 clojure.core/apply
core.clj: 1977 clojure.core/with-bindings*
core.clj: 1977 clojure.core/with-bindings*
RestFn.java: 425 clojure.lang.RestFn/invoke
interruptible_eval.clj: 87 nrepl.middleware.interruptible-eval/evaluate/fn
main.clj: 437 clojure.main/repl/read-eval-print/fn
main.clj: 437 clojure.main/repl/read-eval-print
main.clj: 458 clojure.main/repl/fn
main.clj: 458 clojure.main/repl
interruptible_eval.clj: 115 nrepl.middleware.interruptible-eval/evaluate
interruptible_eval.clj: 150 nrepl.middleware.interruptible-eval/interruptible-eval/fn/fn
AFn.java: 22 clojure.lang.AFn/run
session.clj: 218 nrepl.middleware.session/session-exec/main-loop/fn
session.clj: 217 nrepl.middleware.session/session-exec/main-loop
AFn.java: 22 clojure.lang.AFn/run
Thread.java: 829 java.lang.Thread/run
Hi @maku-no-heya
Please make sure you've read the Appendix at the end of the book: Setting up the environment and the JVM. There are a few remarks about CUDA and MacOS (including exclusions etc.)
As for your particular problem (assuming you've set up everything correctly in project.clj and your system following the appendix) you probably only need to comment lines of code (including the require part of the ns) that are not supported on your system (in this case, those related to cuda and clojurecuda). Additionally, the code is meant to be evaluated in the REPL, line by line, not the whole file at once. There are lines that explicitly demonstrate bad code that throws exceptions.
Thanks so much, Dragan. I will close this issue, read the appendix, and figure it out. I've resolved this kind of stuff many times before. You and @jsa-aerial have given me some great tips. I hope you are well and I appreciate your brilliant books and libraries.
-Maku
Hi Dragan, I bought your brilliant NLAFP book with the source code and have a 2019 MacBook Pro with the following specs:
I do not have Nvidia hardware, but I'd like to run your examples as efficiently as I can. Your example code currently does not compile because of the dependency on CUDA.
What configuration do you recommend for my hardware (perhaps OpenCL?) and do you have an example or version of the NLAFP code that uses an alternative compute configuration?
Many thanks in advance.