Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working with a global context #99

Open
digikar99 opened this issue Apr 10, 2021 · 0 comments
Open

Working with a global context #99

digikar99 opened this issue Apr 10, 2021 · 0 comments

Comments

@digikar99
Copy link

Hi! New to both cuda and cl-cuda. I was looking for a way to avoid with-cuda; what I'm puzzled with is that the following works at the REPL, but doesn't work with C-x C-e in SLIME (at least not until it is run at least once at the REPL):

(init-cuda)
(setq *cuda-device* (get-cuda-device 0)
      *cuda-context* (create-cuda-context *cuda-device*)
      *nvcc-options*
      (if (cl-cuda.api.context::arch-exists-p *nvcc-options*)
          *nvcc-options*
          (cl-cuda.api.context::append-arch *nvcc-options* 0)))
(alloc-memory-block 'float 1)

The last statement yields the following error:

CU-MEM-ALLOC failed with driver API error No. 201.
CUDA_ERROR_INVALID_CONTEXT
   [Condition of type SIMPLE-ERROR]

Restarts:
 0: [RETRY] Retry SLIME REPL evaluation request.
 1: [*ABORT] Return to SLIME's top level.
 2: [ABORT] abort thread (#<THREAD "repl-thread" RUNNING {100F7C1DD3}>)

Backtrace:
  0: (CL-CUDA.DRIVER-API::CHECK-CUDA-ERROR CL-CUDA.DRIVER-API:CU-MEM-ALLOC 201)
  1: (ALLOC-DEVICE-MEMORY FLOAT 1)
  2: (ALLOC-MEMORY-BLOCK FLOAT 1)

Any reason why this happens?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant