Fix errors when no CUDA devices are available#1334
Merged
soumith merged 1 commit intopytorch:masterfrom Apr 23, 2017
Merged
Conversation
Fixes pytorch#1267 This fixes a number of issues when PyTorch was compiled with CUDA support but run on a machine without any GPUs. Now, we treat all errors from cudaGetDeviceCount() as if the machine has no devices.
soumith
approved these changes
Apr 23, 2017
eqy
pushed a commit
to eqy/pytorch
that referenced
this pull request
Jan 20, 2022
This PR relaxes the constraint so that arbitrary padding sizes can be used as long as output domains don't get larger than input domains.
hubertlu-tw
pushed a commit
to hubertlu-tw/pytorch
that referenced
this pull request
Nov 1, 2022
* update ngc link and dockerhub container tag * update * update * update * Update README.md Co-authored-by: Masaki Kozuki <mkozuki@nvidia.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1267
This fixes a number of issues when PyTorch was compiled with CUDA
support but run on a machine without any GPUs. Now, we treat all errors
from cudaGetDeviceCount() as if the machine has no devices.
Now all tests pass with:
CUDA_VISIBLE_DEVICES= ./run_test.shI also changed _cuda_init and _cuda_sparse_init to return None on success and raise an exception on failure. Previously, they set the exception but returned a Python bool False which isn't allowed.
We should probably add a smoke test for the PyTorch compiled with CUDA but run without any GPUs (or with no visible device).