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

AE2d test() throws exception on non-GPU environment #21

Closed
wagavulin opened this issue Jan 8, 2022 · 1 comment
Closed

AE2d test() throws exception on non-GPU environment #21

wagavulin opened this issue Jan 8, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@wagavulin
Copy link

Hello. I tried to run test.sh of Dimensionality_Reduction/AE2d on my PC which doesn't have GPU, but failed with the below error message.

terminate called after throwing an instance of 'c10::Error'
  what():  No CUDA GPUs are available

It's because test() in AE2d/test.cpp calls torch::cuda::synchronize() regardless of device type. I think it should be called only on GPU environment. For example:

        if (!device.is_cpu()) torch::cuda::synchronize();
@koba-jon koba-jon added the bug Something isn't working label Jan 8, 2022
@koba-jon
Copy link
Owner

koba-jon commented Jan 9, 2022

Thank you for reporting the bug and solution.
I changed the source code and confirmed that it works normally.

I reflected it in master branch, and the modified code was archived as support/v1.10.1.
https://github.com/koba-jon/pytorch_cpp/tree/support/v1.10.1

Thank you so much!

@koba-jon koba-jon closed this as completed Jan 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants