无法在WSL2上的Ubuntu上使用OpenACC访问CUDA设备:错误代码=34。

huangapple go评论47阅读模式
英文:

Unable to access CUDA device with OpenACC on WSL2 Ubuntu: Error code=34

问题

我是新手,正在使用在WSL2上的Ubuntu上使用OpenACC时遇到了一个问题。我按照官方网站上的说明成功安装了HPC SDK,而没有单独安装CUDA,因为最新的CUDA版本已经包含在HPC SDK中。然而,当我运行nvaccelinfo命令时,它返回以下信息:

未找到加速器。尝试使用nvaccelinfo -v以获取更多信息。

类似地,运行pgaccelinfo也会显示以下结果:

未找到加速器。尝试使用pgaccelinfo -v以获取更多信息。

我已经设置了必要的路径,但似乎无法访问CUDA设备。可能是什么原因导致了这个问题?

最近,我在WSL2上设置了Ubuntu以满足我的编程需求,并使用OpenACC。按照官方网站上提供的说明,我成功安装了HPC SDK,这应该包括必要的CUDA运行时和其他组件。我确保正确设置了相关路径,以允许访问已安装的组件。

我尝试通过运行nvaccelinfo -vpgaccelinfo -v来获取更多详细信息,但这两个命令都导致以下错误消息:

无法初始化CUDA运行时,错误代码=34。未找到加速器。请检查CUDA设备的权限。

作为这项技术的新手,我不确定是什么原因导致了这个问题。似乎CUDA设备未被识别或无法访问。我已经多次检查了我的安装步骤,并确保了必要的路径正确设置,但我无法自行解决这个问题。

我恳请社区的帮助,以帮助排除这个问题。如果有人遇到类似的问题或了解如何在WSL2上的Ubuntu上使用OpenACC,我将非常感谢任何有关克服此错误的见解或建议。此外,关于正确配置或可能需要的其他步骤以在WSL2上成功使用OpenACC的任何指导将非常有帮助。提前感谢您的时间和帮助!

英文:

I am new to using OpenACC on WSL2 with Ubuntu and have encountered an issue. I successfully installed the HPC SDK as instructed on the website, without installing CUDA separately, as the latest CUDA version was included with the HPC SDK. However, when I run the nvaccelinfo command, it returns

> No accelerators found. Try nvaccelinfo -v for more information.

Similarly, running pgaccelinfo also results in

> No accelerators found. Try pgaccelinfo -v for more information.

I have set the necessary paths, but I cannot seem to access the CUDA device. What could be causing this issue?

I have recently set up Ubuntu on WSL2 to utilize OpenACC for my programming needs. Following the instructions provided on the official website, I successfully installed the HPC SDK, which was supposed to include the necessary CUDA runtime and other components. I ensured that the relevant paths were correctly set to allow access to the installed components.

I attempted to obtain additional details by running nvaccelinfo -v and pgaccelinfo -v, but both commands resulted in the error message

> could not initialize CUDA runtime, error code=34. No accelerators found. Check the permissions on your CUDA device.

As a newcomer to this technology, I am unsure of what could be causing this problem. It seems that the CUDA device is not being recognized or accessible. I have double-checked my installation steps and ensured that the necessary paths are correctly set, but I am unable to resolve this issue on my own.

I kindly request assistance from the community to help troubleshoot this problem. If anyone has encountered a similar issue or has knowledge about utilizing OpenACC on WSL2 with Ubuntu, I would greatly appreciate any insights or suggestions to overcome this error. Additionally, any guidance regarding the proper configuration or any additional steps that may be required to utilize OpenACC successfully on WSL2 would be extremely helpful. Thank you in advance for your time and assistance!

答案1

得分: 3

这意味着OpenACC运行时无法找到CUDA驱动程序,因为它未安装在默认系统库目录下。

尝试设置您的环境中的LD_LIBRARY_PATH,包括/usr/lib/wsl/liblibcuda.so所安装的位置。

参见:Windows 10 WSL Ubuntu 20.04: Fortran MPI+OpenACC+DC GPU code not running 在Nvidia开发者论坛中。

英文:

This means that the OpenACC runtime can't find the CUDA driver since it's not installed under default system library directory.

Try setting the LD_LIBRARY_PATH in your environment to include /usr/lib/wsl/lib or where ever libcuda.so was installed.

See: Windows 10 WSL Ubuntu 20.04: Fortran MPI+OpenACC+DC GPU code not running in the Nvidia Developer Forum.

huangapple
  • 本文由 发表于 2023年6月1日 18:04:08
  • 转载请务必保留本文链接:https://go.coder-hub.com/76380786.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定