Skip to content

Recruiting GPU not possible (coordinate-based meta-analysis) #819

@MaxKorbmacher

Description

@MaxKorbmacher

Summary

When fitting a coordinate-based meta-regression model (Google Collab, with correct GPU settings), GPUs are not recruited appropriately. Instead CPUs are used.

Here is the error message:
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! (when checking argument for argument mat2 in method wrapper_CUDA_mm)

Additional details

  • NiMARE version: latest

What were you trying to do?

Here is the code:

cbmr = CBMREstimator(
    group_categories=["motor"],
    moderators=[
        "moderator",
    ],
    spline_spacing=100,
    model=models.PoissonEstimator,
    penalty=False,
    lr=1e-1,
    tol=1e3, 
    device="cuda",  # "cuda" if you have GPU or "cpu" for CPU
)

What did you expect to happen?

GPU usage

What actually happened?

(mainly) CPU usage + error message
Yet, GPU availability confirmed with

!nvidia-smi
import torch
torch.cuda.is_available()
import tensorflow as tf
tf.test.gpu_device_name()

Reproducing the bug

Some code above, rest of the code is here:
https://colab.research.google.com/drive/1EVngYoYlryl-YcjmIEOjm0VBBplc-Qyw?usp=sharing

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssues noting problems and PRs fixing those problems.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions