-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into run_translation
- Loading branch information
Showing
3 changed files
with
97 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Copyright (c) Meta Platforms, Inc. and affiliates. | ||
# All rights reserved. | ||
|
||
# This source code is licensed under the license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
import torch | ||
import dlib | ||
|
||
# Check if CUDA is available and if it's using a GPU | ||
if torch.cuda.is_available(): | ||
print("CUDA is available!") | ||
print(torch.__version__) | ||
print(torch.version.cuda) | ||
print(f"Device count: {torch.cuda.device_count()}") | ||
print(f"Current device: {torch.cuda.current_device()}") | ||
print(f"Device name: {torch.cuda.get_device_name(0)}") | ||
|
||
else: | ||
print("CUDA is not available.") | ||
print("Consider using a runtime with GPU acceleration in Colab.") | ||
|
||
|
||
# If dlib CUDA is available, print details | ||
if dlib.DLIB_USE_CUDA: | ||
print("dlib CUDA is available!") | ||
print(f"Number of dlib CUDA devices: {dlib.cuda.get_num_devices()}") | ||
else: | ||
print("dlib CUDA is not available.") |