1

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!

paleonix
  • 2,293
  • 1
  • 13
  • 29
  • I would guess you have installed a display driver with WSL2. Don't do that. – talonmies Jun 01 '23 at 10:10
  • @talonmies I haven't done any additional thing I read that having cuda installed on my windows was enough – Aronld Manki Jun 01 '23 at 10:24
  • @talonmies are there any additional lib or bin directories that I should include in bashrc – Aronld Manki Jun 01 '23 at 10:43
  • 1
    No. If you didn't install a driver, I suspect you will find that the HPCtoolkit isn't supported on WSL – talonmies Jun 01 '23 at 12:02
  • @talonmies so what should do please tell me – Aronld Manki Jun 01 '23 at 12:52
  • There has been another recent question about problems with NVHPC on WSL: [Simpson's Integration code with Thrust outputs different results on two machines with NVC++](https://stackoverflow.com/a/76220209/10107454). Unlike in the CUDA Toolkit docs, the NVHPC Toolkit docs don't mention WSL at all, so there is no official support of it, I guess. – paleonix Jun 01 '23 at 17:57

1 Answers1

3

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.

paleonix
  • 2,293
  • 1
  • 13
  • 29
Mat Colgrove
  • 5,441
  • 1
  • 10
  • 11