DickJC123 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_r302657800
 
 

 ##########
 File path: src/common/cuda_utils.cc
 ##########
 @@ -0,0 +1,108 @@
+/*
+ * 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) {
+    int linkedAgainstCudaVersion = 0;
+    CUDA_CALL(cudaRuntimeGetVersion(&linkedAgainstCudaVersion));
+    if (linkedAgainstCudaVersion != CUDA_VERSION)
+      LOG(WARNING) << "cuda library mismatch: linked-against version " << 
linkedAgainstCudaVersion
 
 Review comment:
   So 'yes' there would be a warning if the user built against 10.1, but ran 
with 10.2.  These warnings can be turned off with an environment variable 
setting MXNET_CUDA_VERSION_CHECKING=0.  The idea behind the 'advisory' is that 
the user may want to rebuild to get the new functionality present in 10.2, or 
perhaps to avoid work-arounds for any issues of 10.1.  It's probably more 
useful with the CUDNN version checks, where we have far more compile guards 
based on version minor numbers.  Do you feel these warnings would be unwelcome 
to users?

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to