Aronld Manki
Aronld Manki

Reputation: 1

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

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!

Upvotes: 1

Views: 1039

Answers (1)

Mat Colgrove
Mat Colgrove

Reputation: 5646

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.

Upvotes: 3

Related Questions