【问题标题】:Installing cuda via brew and dmg通过 brew 和 dmg 安装 cuda
【发布时间】:2016-11-28 17:08:00
【问题描述】:

在尝试按照以下指南在 MAC 上安装 nvidia 工具包后:http://docs.nvidia.com/cuda/cuda-installation-guide-mac-os-x/index.html#axzz4FPTBCf7X 我收到错误“Package manifest parsing error”,这导致了我:NVidia CUDA toolkit 7.5.27 failing to install on OS X。我卸载了 dmg,结果是安装程序不会启动,而不是收到“包清单解析错误”(它似乎短暂启动,然后退出)。

通过命令brew install Caskroom/cask/cuda(CUDA 7.5 install on Mac missing nvrtc)安装好像已经成功安装cuda了。

命令nvcc --version 返回:

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2015 NVIDIA Corporation
Built on Mon_Apr_11_13:23:40_CDT_2016
Cuda compilation tools, release 7.5, V7.5.26

我已经在/Developer/NVIDIA/CUDA-7.5/samples/1_Utilities 中构建了示例:

make -C bandwidthTest/

这个执行没有错误。

使用brew install Caskroom/cask/cuda 安装似乎是安全的安装方法?这种安装方法和通过 nvidia 的 DMG 文件安装有什么区别?

Caskroom 似乎是用于安装 GUI 应用程序的 brew 扩展:https://github.com/caskroom/homebrew-cask

IDE 是否也应该作为 cuda 安装的一部分安装?

【问题讨论】:

  • Nsight Eclipse Edition 是适用于 Linux 和 Mac 的 CUDA Toolkit Installer 的一部分。

标签: cuda gpu nvidia dmg


【解决方案1】:

现在您必须执行以下操作才能通过 brew 安装 cuda:

brew tap homebrew/cask-drivers
brew cask install nvidia-cuda

https://github.com/caskroom/homebrew-cask/issues/38325。 然后你还需要将以下内容添加到你的文件~/.bash_profile

export PATH=/Developer/NVIDIA/CUDA-9.0/bin${PATH:+:${PATH}}
export DYLD_LIBRARY_PATH=/Developer/NVIDIA/CUDA-9.0/lib${DYLD_LIBRARY_PATH:+:${DYLD_LIBRARY_PATH}}

http://docs.nvidia.com/cuda/cuda-installation-guide-mac-os-x/index.html

更新:具有激活 SIP(​​系统完整性保护)的 Mac OS X 的较新版本将阻止修改 DYLD_LIBRARY_PATH(请参阅https://groups.google.com/forum/#!topic/caffe-users/waugt62RQMU)。你可以通过

source ~/.bash_profile
env | grep DYLD_LIBRARY_PATH

如果此命令的输出为空,则 SIP 处于活动状态,您可能希望按照 https://www.macworld.com/article/2986118/security/how-to-modify-system-integrity-protection-in-el-capitan.html 中的说明停用它。完成此操作后,您应该会看到

env | grep DYLD_LIBRARY_PATH
DYLD_LIBRARY_PATH=/Developer/NVIDIA/CUDA-9.0/lib

【讨论】:

【解决方案2】:

这两种方法都从 NVidia 的同一个 .dmg 文件下载和安装。

homebrew-cask 框架是在 homebrew 范例中安装作为二进制文件分发的软件的首选方法。

这是我的理解。

【讨论】:

    【解决方案3】:

    使用DMG文件,如下:

    wget 'https://developer.download.nvidia.com/compute/cuda/10.2/Prod/local_installers/cuda_10.2.89_mac.dmg' && \
    hdiutil attach cuda_10.2.89_mac.dmg \
        -nobrowse \
        -mountpoint \
        /Volumes/CUDAMacOSXInstaller
    

    打开安装程序:

    open /Volumes/CUDAMacOSXInstaller/CUDAMacOSXInstaller.app
    

    在继续之前取消选中“CUDA 示例”。

    卸载和删除文件:

    hdiutil detach /Volumes/CUDAMacOSXInstaller && rm ./cuda_10.2.89_mac.dmg
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-05-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-04-10
      • 1970-01-01
      相关资源
      最近更新 更多