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

knn_graph returns empty edge_index when other gpus are used #222

Open
YanivDorGalron opened this issue Jul 28, 2024 · 2 comments
Open

knn_graph returns empty edge_index when other gpus are used #222

YanivDorGalron opened this issue Jul 28, 2024 · 2 comments

Comments

@YanivDorGalron
Copy link

While using torch_cluster knn_graph function I get an empty edge_index depending on the order of the gpus used.

gpus != 0 will work only after gpu 0 has been used.

torch.version '2.4.0+cu121'
torch_cluster.version '1.6.2'

import torch
from torch_cluster import knn_graph
work_list = [0, 1]
will_not_work_list = [1, 0]
lst = will_not_work_list
for i in lst:
    # Example input tensor
    x = torch.rand((1000, 3))
    device = torch.device(f'cuda:{i}' if torch.cuda.is_available() else 'cpu')
    x = x.to(device)
    edge_index = knn_graph(x, k=5)
    print(edge_index.device)

Would highly appreciate your response

Thanks in advance,
Yaniv

@rusty1s
Copy link
Owner

rusty1s commented Jul 29, 2024

This should be hopefully fixed once we build a new version including #213.

@rusty1s
Copy link
Owner

rusty1s commented Jul 29, 2024

Can you install from source to see if this fixes your issues?

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

2 participants