UserWarning: User provided device_type of 'cuda', but CUDA is not available. Disabling warnings.warn('User provided device_type of \'cuda\', but CUDA is not available. Disabling')

Hi, while training the model, I constantly get this warning:
UserWarning: User provided device_type of ‘cuda’, but CUDA is unavailable. Disabling warnings.warn(‘User provided device_type of ‘cuda’, but CUDA is not available. Disabling’)
which seems to indicate that I am running something on CUDA but my whole code has been running on the CPU. To prove that, I checked the .is_cuda property of all my tensors and is False.

dgl==0.9.0
torch==1.10.1

line loss_output.backward() generates this warning

Does your data loader have the device argument as cuda rather than cpu?

No, I don’t use device argument. Here is how I create DataLoader:

# Define training EdgeDataLoader
    train_dataloader = dgl.dataloading.DataLoader(
        graph,                                  # The graph
        train_eid_dict,  # The edges to iterate over
        sampler,                                # The neighbor sampler
        batch_size=batch_size,    # Batch size
        shuffle=True,       # Whether to shuffle the nodes for every epoch
        drop_last=False,    # Whether to drop the last incomplete batch
        num_workers=sampling_workers, # Number of sampling processes
    )

I also opened an issue on torch because I thought they were also relevant so maybe it helps, if not sorry: https://github.com/pytorch/pytorch/issues/83733

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.