larroy commented on a change in pull request #15449: cuda/cuDNN lib version checking. Force cuDNN v7 usage. URL: https://github.com/apache/incubator-mxnet/pull/15449#discussion_r303681185
########## File path: src/common/cuda_utils.cc ########## @@ -0,0 +1,105 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/*! + * Copyright (c) 2019 by Contributors + * \file cuda_utils.cc + * \brief CUDA debugging utilities. + */ + +#include <mxnet/base.h> +#include "cuda_utils.h" + +#if MXNET_USE_CUDA == 1 + +namespace mxnet { +namespace common { +namespace cuda { + +// The oldest version of cuda used in upstream MXNet CI testing, both for unix and windows. +// Users that have rebuilt MXNet against older versions will we advised with a warning to upgrade +// their systems to match the CI level. Minimally, users should rerun the CI locally. +#if defined(_MSC_VER) +#define MXNET_CI_OLDEST_CUDA_VERSION 9020 +#else +#define MXNET_CI_OLDEST_CUDA_VERSION 10000 +#endif + +// Dynamic init here will emit a warning if runtime and compile-time cuda lib versions mismatch. +// Also if the user has recompiled their source to a version no longer tested by upstream CI. +bool cuda_version_check_performed = []() { + // Don't bother with checks if there are no GPUs visible (e.g. with CUDA_VISIBLE_DEVICES="") + if (dmlc::GetEnv("MXNET_CUDA_VERSION_CHECKING", true) && Context::GetGPUCount() > 0) { Review comment: @DickJC123 we have detected an error when running a GPU compiled MXNet in a CPU machine, when building mxnet is loaded to generate the operator bindings. My colleague will fill a ticket about this. Would be great to have your guidance if the underlying cudaGetDeviceCount can run without driver, as the call is failing. Our thinking is that before we were not calling this cuda function on load time. I think a possible solution is to add a function that checks if GPUs are available if the GPU count can't be called without GPUs which is a bit puzzling. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
