enable cpu machine to run paddle in gpu lib

enable cpu machine to run paddle model in gpu lib
revert-20712-fix_depthwise_conv
Wilber 6 years ago committed by GitHub
parent 5219efb14f
commit 751812a674
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -39,6 +39,14 @@ inline std::string CudaErrorWebsite() {
}
static int GetCUDADeviceCountImpl() {
int driverVersion = 0;
cudaError_t status = cudaDriverGetVersion(&driverVersion);
if (!(status == cudaSuccess && driverVersion != 0)) {
// No GPU driver
return 0;
}
const auto *cuda_visible_devices = std::getenv("CUDA_VISIBLE_DEVICES");
if (cuda_visible_devices != nullptr) {
std::string cuda_visible_devices_str(cuda_visible_devices);

Loading…
Cancel
Save