#include "CudaMgr/CudaMgr.h"
#include "QueryEngine/NvidiaKernel.h"
#include <algorithm>
#include <boost/stacktrace.hpp>
#include <cassert>
#include <iostream>
#include <stdexcept>
#include "Logger/Logger.h"
Go to the source code of this file.
std::string get_cuda_home |
( |
void |
| ) |
|
Definition at line 405 of file CudaMgr.cpp.
References LOG, and logger::WARNING.
Referenced by UdfCompiler::compileToGpuByteCode().
406 static const char* CUDA_DEFAULT_PATH =
"/usr/local/cuda";
407 const char* env =
nullptr;
409 if (!(env = getenv(
"CUDA_HOME")) && !(env = getenv(
"CUDA_DIR"))) {
411 if (boost::filesystem::exists(boost::filesystem::path(CUDA_DEFAULT_PATH)))
412 env = CUDA_DEFAULT_PATH;
415 if (env ==
nullptr) {
416 LOG(
WARNING) <<
"Could not find CUDA installation path: environment variables "
417 "CUDA_HOME or CUDA_DIR are not defined";
422 auto cuda_include_dir = env + std::string(
"/include");
423 auto cuda_h_file = cuda_include_dir +
"/cuda.h";
424 if (!boost::filesystem::exists(boost::filesystem::path(cuda_h_file))) {
425 LOG(
WARNING) <<
"cuda.h does not exist in `" << cuda_include_dir <<
"`. Discarding `"
426 << env <<
"` as CUDA installation path.";
430 return std::string(env);