我试图用命令在Ubuntu上构建Tensorflow,bazel build --config=opt --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0" --config=cuda //tensorflow/tools/pip_package:build_pip_package
但运行后出现以下错误./configure:
Illegal ambiguous match on configurable attribute "deps" in //tensorflow/core/grappler/costs:utils:
@local_config_cuda//cuda:using_clang
@local_config_cuda//cuda:using_nvcc
Multiple matches are not allowed unless one is unambiguously more specialized.
ERROR: Analysis of target '//tensorflow/tools/pip_package:build_pip_package' failed; build aborted
INFO: Elapsed time: 30.960s
FAILED: Build did NOT complete successfully (91 packages loaded)
Run Code Online (Sandbox Code Playgroud)
我不确定发生了什么.似乎使用clang和nvcc之间存在冲突,但我认为在配置过程中我没有指定在任何地方使用nvcc../configure本应该没有任何问题.
奇怪的是,我无法在互联网上找到任何此类错误报告.
可能是因为我错误地安装了CUDA,还是更有可能是tensorflow配置错误?
我正在尝试通过 CUDA 代码将现有项目的一部分移植到 GPU。我知道 cmake 有选项(find_cuda...)来单独处理 .cu 文件,但我仍然试图弄清楚如何在现有项目的上下文中使用这个生态系统。
我的问题如下。假设我有一个带有 cmake 配置文件 (CMakeLists) 的现有 C++ 项目。优雅地(如果可能)包含 CUDA 内核的当前做法是什么?能否以某种方式构建 CMakeLists,仅当存在 GPU 时才编译 .cu 文件?
我目前的想法是创建一个单独的文件夹,其中只存在与CUDA相关的代码,然后将其编译为静态库。这是这样做的方式吗?
我正在学习Tensorflow(希望将它与我的聊天机器人集成),并希望运行此处的示例:
https://www.tensorflow.org/tutorials/recurrent
我下载了建议的存储库,安装了tensorflow(现在是cpu-only版本,但是也试过了--gpu)但是我坚持这个:
python ptb_word_lm.py --data_path=simple-examples/data/ --model=small --rnn_mode=basic
2017-09-21 17:38:09.856638: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
2017-09-21 17:38:09.856685: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
Traceback (most recent call last):
File "ptb_word_lm.py", line 532, in <module>
tf.app.run()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + …Run Code Online (Sandbox Code Playgroud) 我们有一个 Python 代码,其中涉及昂贵的线性代数计算。数据存储在 NumPy 数组中。该代码使用 numpy.dot 以及一些 BLAS 和 LAPACK 函数,当前可通过 scipy.linalg.blas 和 scipy.linalg.lapack 访问这些函数。当前代码是为CPU编写的。我们想要转换代码,以便一些 NumPy、BLAS 和 LAPACK 操作在 GPU 上执行。
我正在尝试确定执行此操作的最佳方法。据我所知,Numba 不支持 GPU 上的 BLAS 和 LAPACK 函数。看来 PyCUDA 可能是最佳途径,但我无法确定 PyCUDA 是否允许同时使用 BLAS 和 LAPACK 函数。
编辑:我们需要将代码移植到不同的 GPU 架构,包括 AMD 和 Nvidia。虽然 PyCUDA 似乎提供了所需的功能,但 CUDA(以及 PyCUDA)无法在 AMD GPU 上运行。
我使用 AWS p3 实例使用 GPU 加速训练以下模型:
x = CuDNNLSTM(128, return_sequences=True)(inputs)
x = Dropout(0.2)(x)
x = CuDNNLSTM(128, return_sequences=False)(x)
x = Dropout(0.2)(x)
predictions = Dense(1, activation='tanh')(x)
model = Model(inputs=inputs, outputs=predictions)
Run Code Online (Sandbox Code Playgroud)
训练后,我用 Keras 的save_model函数保存了模型,并将其移至没有 GPU 的单独生产服务器。
当我尝试在生产服务器上使用该模型进行预测时,它失败并显示以下错误:
没有注册任何 OpKernel 来支持具有这些属性的 Op 'CudnnRNN'。注册设备:[CPU],注册内核:
我猜这是因为生产服务器没有 GPU 支持,但我希望这不会成为问题。有什么办法可以在没有 GPU 的生产服务器上使用这个模型?
我正在尝试开始使用一些OpenCL编码.
我已经在我的计算机上安装了NVidia CUDA OpenCL,并设法构建了一个简单的"Hello World!" 使用Visual Studio 2017的应用程序.
我还安装了英特尔OpenCL SDK(安装警告我,我需要更新我的OpenCL驱动程序,但英特尔更新管理器告诉我一切都是最新的,所以我不确定这是否是一个问题).
现在每当我在PC上查询OpenCL平台时,都是如此:
std::vector< cl::Platform > platformList;
cl::Platform::get(&platformList);
Run Code Online (Sandbox Code Playgroud)
我只回到我的nVidia openCL平台,我的GPU是唯一的设备.我的CPU没有得到任何回报.
有人可以帮忙吗?是否可以在同一个项目中执行CPU和GPU OpenCL计算(在不同的OpenCL上下文中?我将如何进行此操作?
我正在尝试在Gentoo系统上从源代码安装tensorflow(我认为我需要这样做才能使用CUDA 9.1)。
我能够构建tensorflow,然后以以下用户身份安装它:
pip3 install --no-cache-dir --user /tmp/tensorflow_pkg/tensorflow-1.6.0rc1-cp35-cp35m-linux_x86_64.whl
Run Code Online (Sandbox Code Playgroud)
当我尝试导入tensorflow时,我得到:
>RuntimeError Traceback (most recent call last)
>RuntimeError: module compiled against API version 0xc but this version of numpy is 0xb
>
>ImportError Traceback (most recent call last)
>ImportError: numpy.core.multiarray failed to import
>
>ImportError Traceback (most recent call last)
>ImportError: numpy.core.umath failed to import
>
>ImportError Traceback (most recent call last)
>ImportError: numpy.core.umath failed to import
Run Code Online (Sandbox Code Playgroud)
所以我的猜测是tensorflow是针对不同于我的系统默认版本(1.13.3)的numpy版本构建的。
问题是如何解决?我对这个过程有很多陌生的知识,因此,如果有以下任何建议,我将不胜感激:
任何帮助表示赞赏!
我正在尝试打印我已使用的线程数(在我的代码中声明)以及我正在创建的块数。它们的类型为:dim3(我正在使用 C 编程。)
我的代码看起来像下面这样:
//Declared a NxN grid
*int N = 4; //Num of rows
int numThreads = 4;
dim3 dimBlock(numThreads);
dim3 dimGrid((N/dimBlock.x)+(!(N%dimBlock.x)?0:1));
Run Code Online (Sandbox Code Playgroud)
您能帮我了解如何在终端上打印此信息吗?使用 printf,要使用哪个说明符;就像我们使用 %d 表示 int,%f 表示 float 等。
我只是想下载,TensorRT但我看到有两个不同的版本GA和RC。它们之间有什么区别,当我将Windows 10计算机与Geforce GTX 960M图形卡一起使用时,应该选择什么版本?
导入 torch ( import torch) 时,我遇到以下错误消息:
OSError: [WinError 127] The specified procedure could not be found. Error loading "C:\Users\myUserName\anaconda3\lib\site-packages\torch\lib\jitbackend_test.dll" or one of its dependencies.
我尝试了这篇文章中的建议,但没有成功。
有什么想法如何修复它吗?
我的环境: