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

parallel_for failed: cudaErrorNoKernelImageForDevice: no kernel image is available for execution on the device #4

Open
ztjsw opened this issue Jun 10, 2021 · 7 comments

Comments

@ztjsw
Copy link

ztjsw commented Jun 10, 2021

Hello there,
I ran the cuosqp but it aborts as following:

terminate called after throwing an instance of 'thrust::system::system_error'
  what():  parallel_for failed: cudaErrorNoKernelImageForDevice: no kernel image is available for execution on the device

My GPU is NVIDIA 1080Ti, the code is:

import cuosqp as osqp
import numpy as np
from scipy import sparse

# Define problem data
P = sparse.csc_matrix([[4, 1], [1, 2]])
q = np.array([1, 1])
A = sparse.csc_matrix([[1, 1], [1, 0], [0, 1]])
l = np.array([1, 0, 0])
u = np.array([1, 0.7, 0.7])

# Create an OSQP object
prob = osqp.OSQP()

# Setup workspace
prob.setup(P, q, A, l, u)

# Solve problem
res = prob.solve()

# Solve again
res2 = prob.solve()

I was wondering why this is and if there is anything I am doing wrong?

@gbanjac
Copy link
Collaborator

gbanjac commented Jun 10, 2021

Can you install the C version of cuOSQP given here: https://github.com/osqp/osqp/tree/cuda-1.0

What happens when you run the demo example?

@ztjsw
Copy link
Author

ztjsw commented Jun 11, 2021

I have builded the osqp with branch cuda-1.0. But it still returns the error:

-> % ./out/osqp_demo 
terminate called after throwing an instance of 'thrust::system::system_error'
  what():  parallel_for failed: cudaErrorNoKernelImageForDevice: no kernel image is available for execution on the device
[1]    15556 abort (core dumped)  ./out/osqp_demo

@gbanjac
Copy link
Collaborator

gbanjac commented Jun 11, 2021

Which version of the CUDA Toolkit do you have installed?

@ztjsw
Copy link
Author

ztjsw commented Jun 11, 2021

CUDA 10.2

@gbanjac
Copy link
Collaborator

gbanjac commented Oct 31, 2021

It seems that your GPU has the Pascal architecture, which has the CUDA compute capability 6.1.

What happens if you change this line to set(CMAKE_CUDA_ARCHITECTURES 61)?

@chuber11
Copy link

I had the same problem. Setting the CMAKE_CUDA_ARCHITECTURES did not help but i had to remove
", '--target', 'osqpstatic'"
from https://github.com/osqp/cuosqp/blob/master/setup.py#L104

@smithian
Copy link

Same problem here. In my case, using an A30, setting set(CMAKE_CUDA_ARCHITECTURES 80) and commenting out the conditional statement solved the problem.

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

4 participants