# could not initialize CUDA runtime, error code=100

**URL:** <https://forums.developer.nvidia.com/t/could-not-initialize-cuda-runtime-error-code-100/132749>\
**Category:** Legacy PGI Compilers (archived)\
**Created:** [February 4, 2012, 2:20am UTC](https://forums.developer.nvidia.com/t/could-not-initialize-cuda-runtime-error-code-100/132749 "2012-02-04T02:20:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![PeterDaivis92620](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@PeterDaivis92620](https://forums.developer.nvidia.com/u/PeterDaivis92620)\
**Post date:** [February 4, 2012, 2:20am UTC](https://forums.developer.nvidia.com/t/could-not-initialize-cuda-runtime-error-code-100/132749/1 "2012-02-04T02:20:36Z")

</div>

I have successfully installed and used pgfortran 11.10 on my MacPro, but can’t get it to see the GPU (Nvidia Quadro 4000).

Running pgaccelinfo -v gives

CUDA Driver Version: 4010  
could not initialize CUDA runtime, error code=100  
libamdcalcl.dylib not found  
No accelerators found.  
Check that you have installed the CUDA or CAL libraries properly  
Check that your LD\_LIBRARY\_PATH environment variable points to the CUDA or CAL runtime installation directory  
Check the permissions on your device

I have verified that the driver is loaded with: kextstat | grep -i cuda:

117 0 0xffffff7f81994000 0x2000 0x2000 com.nvidia.CUDA (1.1.0) \<4\>

and I have also added this line to my .bash\_profile  
export DYLD\_LIBRARY\_PATH=$PGI/opt/pgi/osx86/2011/cuda/4.0/lib:$DYLD\_LIBRARY\_PATH

Is there something else I should have done?

---

<div class="post-metadata">

**Author:** ![MatColgrove](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/matcolgrove/32/14047_2.png) [@MatColgrove](https://forums.developer.nvidia.com/u/MatColgrove)\
**Post date:** [February 6, 2012, 9:13pm UTC](https://forums.developer.nvidia.com/t/could-not-initialize-cuda-runtime-error-code-100/132749/2 "2012-02-06T21:13:01Z")

</div>

Hi Peter,

Let’s start by taking PGI out of the equation. Can you try compiling and running the CUDA SDK’s device query example using NVIDIA’s nvcc compiler?

Note that the CUDA components PGI ships are only necessary for compilation. All runtime libraries required by the NVIDIA CUDA Driver should be provided by NVIDIA. So if you’re able to run the SDK example, try removing your DYLD\_LIBRARY\_PATH setting since this should not be pointing to a PGI directory.

- Mat

---

<div class="post-metadata">

**Author:** ![PeterDaivis92620](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@PeterDaivis92620](https://forums.developer.nvidia.com/u/PeterDaivis92620)\
**Post date:** [February 6, 2012, 11:13pm UTC](https://forums.developer.nvidia.com/t/could-not-initialize-cuda-runtime-error-code-100/132749/3 "2012-02-06T23:13:41Z")

</div>

Thanks for your reply and advice, Mat.

I reinstalled the Quadro 4000 driver (256.02.25f1v1) and the CUDA driver (4.1.25) recommended by Nvidia for MacOSX 10.6.8 on my MacPro 5,1.

Then I repaired permissions.

Then I installed the Cuda SDK etc from Nvidia and pointed DYLD\_LIBRARY\_PATH to the /usr/local/cuda/lib for their installation. deviceQuery now works and so do pgaccelinfo -v and the pgi version of deviceQuery.

Just one suggestion - there are some small differences between MacOSX and Linux that are not mentioned in the PGI documentation and make it slightly misleading and confusing, such as the difference between LD\_LIBRARY\_PATH and DYLD\_LIBRARY\_PATH. Clarifying these would make the process much easier for Mac users.  
  
  
Thanks,

Peter
