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

How to correctly call the official CUDA module of ceres? #1045

Open
LYK0520 opened this issue Jan 25, 2024 · 6 comments
Open

How to correctly call the official CUDA module of ceres? #1045

LYK0520 opened this issue Jan 25, 2024 · 6 comments
Assignees

Comments

@LYK0520
Copy link

LYK0520 commented Jan 25, 2024

options.dense_linear_algebra_library_type = ceres::CUDA;
To call cuda, only the simple code above is needed to implement the three methods, respectively the DENSE_QR, DENSE_NORMAL_CHOLESKY and DENSE_SCHUR.
It is worth noting that without the line of code,the program runs normally and caculates the correct result. But after adding the call code, DENSE_QR,DENSE_NORMAL_CHOLWSKY will report an error, DENSE_SCHUR can run but the gpu is not called. I have confirmed that I have cuda installed.
Snipaste_2024-01-25_16-27-59
Detailed examples of cuda calls are nowhere to be found in official documentation, and there doesn't seem to be much third-party explanation online. Is there a complete case explaining the call? I saw the official TEST in cuda_dense_cholesky_test.cc, but it was hard to understand.
If I have the honor to receive your reply, I will be very grateful! Thanks again!

@sandwichmaker
Copy link
Contributor

you should not have to do anything other than set
Solver::Options::dense_linear_algebra_library = ceres::CUDA.

What error are you getting when you enable CUDA?

@sandwichmaker sandwichmaker self-assigned this Jan 26, 2024
@LYK0520
Copy link
Author

LYK0520 commented Feb 2, 2024

I'm sorry I didn't follow you. The program runs smoothly when we don't use cuda; After cuda is used, only schur does not report errors, but also shows that the gpu usage is 0.
I'm sure I only added the line, but the cpu usage is always high and the gpu usage is 0. The IDE I use is 2022 visual studio. Is there any other configuration required for the program?

@sandwichmaker
Copy link
Contributor

sandwichmaker commented Feb 2, 2024 via email

@838619643
Copy link

I have a similar problem. Looking forward to the official answer.

@sandwichmaker
Copy link
Contributor

sandwichmaker commented Feb 4, 2024 via email

@AlexanderAKalinkin
Copy link

Hi Guys,
Have you ever thought about adding cuDSS as Direct Sparse Solver for GPU?
Thanks,

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