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

Added GPU acceleration support for Apple Silicon #62

Merged
merged 1 commit into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nbs/homography.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
"error_tol: float = 1e-8 # the optimisation error tolerance\n",
"\n",
"log_interval: int = 100 # print log every N iterations\n",
"device = K.utils.get_cuda_device_if_available()\n",
"device = K.utils.get_cuda_or_mps_device_if_available()\n",
"print(\"Using \", device)"
]
},
Expand Down
2 changes: 1 addition & 1 deletion nbs/image_matching_adalam.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"import torch\n",
"from kornia_moons.viz import *\n",
"\n",
"# device = K.utils.get_cuda_device_if_available()\n",
"# device = K.utils.get_cuda_or_mps_device_if_available()\n",
"device = torch.device(\"cpu\")"
]
},
Expand Down
3 changes: 1 addition & 2 deletions nbs/image_matching_disk.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,7 @@
"from kornia.feature.adalam import AdalamFilter\n",
"from kornia_moons.viz import *\n",
"\n",
"# device = torch.device(\"mps\") # it works also for Apple M1/M2\n",
"device = K.utils.get_cuda_device_if_available()\n",
"device = K.utils.get_cuda_or_mps_device_if_available()\n",
"print(device)"
]
},
Expand Down
4 changes: 2 additions & 2 deletions nbs/image_prompter.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
"from kornia.geometry.boxes import Boxes\n",
"from kornia.geometry.keypoints import Keypoints\n",
"from kornia.io import ImageLoadType, load_image\n",
"from kornia.utils import get_cuda_device_if_available, tensor_to_image"
"from kornia.utils import get_cuda_or_mps_device_if_available, tensor_to_image"
]
},
{
Expand All @@ -132,7 +132,7 @@
}
],
"source": [
"device = get_cuda_device_if_available()\n",
"device = get_cuda_or_mps_device_if_available()\n",
"print(device)"
]
},
Expand Down
Loading