交叉编译到旧的CUDA工具包版本? [英] Cross compile to older CUDA toolkit version?

查看:305
本文介绍了交叉编译到旧的CUDA工具包版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在共享机器上,没有root。

I'm on a shared machine and don't have root.

我的代码因以下CUDA错误而死机

My code dies with the following CUDA error

CUDA驱动程序版本不足CUDA运行时版本

我想为旧的工具包构建我的程序。我会假设这是可能的,因为商业应用程序分发支持早于最新的工具包(?)。

I want to build my program for the older toolkit. I would assume that this is possible as commercial applications are distributed with support for something earlier then the latest toolkit (?).

我玩过 arch 标志,但没有成功。

I have played around with the arch flag, but have no success.

nvcc -arch=compute_13 fun.cu
nvcc -arch=compute_20 fun.cu

要编译到早期工具包版本的标志是什么?
在我的例子中,我有一个版本 4 工具包,但我相信驱动程序只有版本 3

Whats the flag to compile to an earlier toolkit version? In my case I have a version 4 toolkit, but I believe the driver only does version 3.

推荐答案

我不知道命令行标志或类似选项告诉CUDA 4.x工具包的行为,例如,一个CUDA 3.x工具包。

I'm not aware of command line flags or similar options to tell a CUDA 4.x toolkit to behave as if it were a CUDA 3.x toolkit, for example.

正如你所发现的,对于特定版本的工具包,特定的驱动程序版本需要。

And as you've discovered, for a particular version of the toolkit, a particular driver version (or newer) is required.

一种方法是自行安装您所需的工具包。您不需要root权限,但您的用户目录中将需要一些磁盘空间。从归档中选择所需的工具包,然后将其安装到用户目录空间中的本地目录。 (工具包将提示您输入安装位置,并获得您可以执行的其他工具包安装选项: sh< toolkit filename> --help )。将工具包安装到本地目录后,例如/ home / user / cuda,然后修改您的PATH以包括/ home / user / cuda / bin(在任何其他cuda目录之前,如/ usr / local / cuda / bin),并且您的LD_LIBRARY_PATH包括/ home / user / cuda / lib和/ home / user / cuda / lib64(在任何其他cuda lib目录之前)。如果要使这些目录永久,可以编辑.bashrc文件或使用类似的方法,具体取决于distro / shell。然后,您应该能够正常键入nvcc编译命令。如果你在任何特定的库,如cublas等链接,你将需要指向本地目录中的cublas库使用-L编译器/链接器开关照常。

One approach would be to install your desired toolkit on your own. You don't need root privilege for this, but you will need some disk space in your user directories. Select a desired toolkit from the archive and install it onto a local directory in your user directory space. (The toolkit will prompt you for an install location, and to get additional toolkit install options you can do: sh <toolkit filename> --help). Once you have installed the toolkit to your local directory, e.g. /home/user/cuda, then modify your PATH to include /home/user/cuda/bin (before any other cuda directories, such as /usr/local/cuda/bin) and your LD_LIBRARY_PATH to include /home/user/cuda/lib and /home/user/cuda/lib64 (before any other cuda lib directories.) If you want to make these permanent you can edit your .bashrc file or use a similar approach, depending on distro/shell. You should then be able to type your nvcc compile commands normally. If you are linking in any specific libraries like cublas, etc. you will need to point to the cublas library in your local directory using the -L compiler/linker switches as usual.

驱动程序不受任何影响,cuda工具包也没有安装在社区位置,如/ usr / local / cuda。如果您还原了PATH和LD_LIBRARY_PATH环境变量,则应该恢复以前使用社区位置中安装的cuda工具包的功能。

The driver is not affected by any of this, nor is the cuda toolkit installed in a community location such as /usr/local/cuda. If you revert your PATH and LD_LIBRARY_PATH environment variables, you should restore the previous functionality of using the cuda toolkit installed in the community location.

这篇关于交叉编译到旧的CUDA工具包版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆