[R] Install OpenCL

Quirin Stier Qu|r|n_St|er @end|ng |rom gmx@de
Wed Jun 15 08:54:43 CEST 2022


Thanks a lot for your help again.

Installing the package with INSTALL_opts = '--no-test-load' enables
package installation. Doing that plus analyzing the OpenCL.dll with the
dependency walker software for both the original OpenCL.dll (which
RStudio apparently found while installing) and a second OpenCl.dll from
the www yields following output (which is the same for both OpenCl.dll
attempts):

Error: At least one required implicit or forwarded dependency was not found.
Error: At least one module has an unresolved import due to a missing
export function in an implicitly dependent module.
Error: A circular dependency was detected.
Warning: At least one delay-load dependency module was not found.
Warning: At least one module has an unresolved import due to a missing
export function in a delay-load dependent module.

Nota: NVIDIA GPU Computing Toolkit does not contain any OpenCL.dll, only
the OpenCL.h (required for the includes) and a OpenCL.lib (maybe not
important)

Output from the package installation

* installing *source* package 'OpenCL' ...
** Paket 'OpenCL' erfolgreich entpackt und MD5 Summen überprüft
** using staged installation

  === configurig OpenCL for /x64 ==

  OCL=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.7

OCL64LIB not set, assuming C:/Program Files/NVIDIA GPU Computing
Toolkit/CUDA/v11.7/lib/x64/OpenCL.lib
OCL32LIB not set, assuming C:/Program Files/NVIDIA GPU Computing
Toolkit/CUDA/v11.7/lib/x86/OpenCL.lib
OCLINC not set, assuming -IC:/Program Files/NVIDIA GPU Computing
Toolkit/CUDA/v11.7/include

  --- Compiling 64-bit ---
OCL=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.7
PKG_CPPFLAGS=-IC:/Program Files/NVIDIA GPU Computing
Toolkit/CUDA/v11.7/include
PKG_LIBS=C:/Program Files/NVIDIA GPU Computing
Toolkit/CUDA/v11.7/lib/x64/OpenCL.lib

NOTE: make sure the run-time DLLs are on PATH!

** libs
Warnung: this package has a non-empty 'configure.win' file,
so building only the main architecture

gcc  -I"C:/PROGRA~1/R/R-42~1.0/include" -DNDEBUG '-IC:/Program
Files/NVIDIA GPU Computing Toolkit/CUDA/v11.7/include'
-I"C:/rtools42/x86_64-w64-mingw32.static.posix/include"     -O2 -Wall 
-std=gnu99 -mfpmath=sse -msse2 -mstackrealign  -c buffer.c -o buffer.o
gcc  -I"C:/PROGRA~1/R/R-42~1.0/include" -DNDEBUG '-IC:/Program
Files/NVIDIA GPU Computing Toolkit/CUDA/v11.7/include'
-I"C:/rtools42/x86_64-w64-mingw32.static.posix/include"     -O2 -Wall 
-std=gnu99 -mfpmath=sse -msse2 -mstackrealign  -c ocl.c -o ocl.o
gcc  -I"C:/PROGRA~1/R/R-42~1.0/include" -DNDEBUG '-IC:/Program
Files/NVIDIA GPU Computing Toolkit/CUDA/v11.7/include'
-I"C:/rtools42/x86_64-w64-mingw32.static.posix/include"     -O2 -Wall 
-std=gnu99 -mfpmath=sse -msse2 -mstackrealign  -c reg.c -o reg.o
gcc  -I"C:/PROGRA~1/R/R-42~1.0/include" -DNDEBUG '-IC:/Program
Files/NVIDIA GPU Computing Toolkit/CUDA/v11.7/include'
-I"C:/rtools42/x86_64-w64-mingw32.static.posix/include"     -O2 -Wall 
-std=gnu99 -mfpmath=sse -msse2 -mstackrealign  -c wrap.c -o wrap.o
gcc -shared -s -static-libgcc -o OpenCL.dll tmp.def buffer.o ocl.o reg.o
wrap.o C:/Program Files/NVIDIA GPU Computing
Toolkit/CUDA/v11.7/lib/x64/OpenCL.lib
-LC:/rtools42/x86_64-w64-mingw32.static.posix/lib/x64
-LC:/rtools42/x86_64-w64-mingw32.static.posix/lib
-LC:/PROGRA~1/R/R-42~1.0/bin/x64 -lR
installing to
C:/Users/quiri/AppData/Local/R/win-library/4.2/00LOCK-OpenCL/00new/OpenCL/libs/x64
** R
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
* DONE (OpenCL)


Am 14.06.2022 um 16:37 schrieb Ivan Krylov:
> On Tue, 14 Jun 2022 16:14:09 +0200
> Quirin Stier <Quirin_Stier using gmx.de> wrote:
>
>> Sys.setenv(OCL="C:/Program Files/NVIDIA GPU Computing
>> Toolkit/CUDA/v11.7")
>>
>> is working
> Okay, sorry for the misleading follow-up message. I see now that the
> configure.win script performs appropriate quoting by itself, with no
> need to add extra quotes manually.
>
>> ** testing if installed package can be loaded from temporary location
>> Error: Laden von Paket oder Namensraum für 'OpenCL' in inDL(x,
>> as.logical(local), as.logical(now), ...): fehlgeschlagen
>>    kann shared object
>> 'C:/Users/quiri/AppData/Local/R/win-library/4.2/00LOCK-OpenCL/00new/OpenCL/libs/x64/OpenCL.dll'
>> nicht laden:
>>     LoadLibrary failure:  Die angegebene Prozedur wurde nicht gefunden.
> This might need the help of someone else from the R-help list who has
> more experience solving Windows-related problems than me. It's probably
> a good idea to keep the Cc: r-help using R-project.org header in our messages.
>
> If you pass the INSTALL_opts = '--no-test-load' argument to
> install.packages(), installation will "succeed", but it will be
> impossible to use the package. Can you use Dependency Walker
> <https://dependencywalker.com/> to see which function is
> C:/Users/quiri/AppData/Local/R/win-library/4.2/OpenCL/libs/x64/OpenCL.dll
> trying to load from C:/Windows/system32/OpenCL.dll and failing? Could
> it be that C:/Windows/system32/OpenCL.dll is the wrong dll file? If you
> know that the right dll file is somewhere under C:/Program Files/NVIDIA
> GPU Computing Toolkit/CUDA/v11.7, it should be possible to copy it to
> C:/Users/quiri/AppData/Local/R/win-library/4.2/OpenCL/libs/x64 to make
> the installed package work correctly.
>



More information about the R-help mailing list