Re: [R] Install OpenCL

2022-06-14 Thread Ivan Krylov
On Tue, 14 Jun 2022 16:14:09 +0200
Quirin Stier  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@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
 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.

-- 
Best regards,
Ivan

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Install OpenCL

2022-06-14 Thread Ivan Krylov
В Tue, 14 Jun 2022 10:58:59 +0200
Quirin Stier  пишет:

> Sys.env(OCL="C:/Program Files/NVIDIA GPU Computing
> Toolkit/CUDA/v11.7/include/CL")

> In file included from buffer.c:2:
> ocl.h:7:10: fatal error: CL/opencl.h: No such file or directory
>      7 | #include 
>    |  ^

Almost there. If you download the package and read the configure.win
file, or take a look at the GitHub mirror [1], you can see that the
path it uses by default for the include files is equivalent to the
following R expression: file.path(Sys.getenv('OCL'), 'include'). On the
other hand, the code assumes that the include files are available under
file.path(include_path, 'CL', 'opencl.h').

You can probably find the file C:/Program Files/NVIDIA GPU Computing
Toolkit/CUDA/v11.7/include/CL/opencl.h, so the proper path to set the
OCL variable to is "C:/Program Files/NVIDIA GPU Computing
Toolkit/CUDA/v11.7", without the "include/CL" at the end.

The configure script also assumes that there are library files under
file.path(Sys.getenv('OCL'), 'lib', architecture, 'OpenCL.lib'). If
that's not correct, you have to find them and set the OCL32LIB or
OCL64LIB environment variable to the correct path.

> How can I make sure, that the OpenCL DLLs are available via the
> %PATH%?

The expression strsplit(Sys.getenv('PATH'), ';')[[1]] will return a
vector containing paths to directories. One of them must contain the
OpenCL.dll file in order for everything to work.

-- 
Best regards,
Ivan

[1] https://github.com/cran/OpenCL/blob/master/configure.win

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Install OpenCL

2022-06-02 Thread Rasmus Liland
Dear Quirin,

To be able to install OpenCL on 
ArchLinux, I needed to install 
opencl-headers first, because my system 
complained about CL/opencl.h ...  Maybe 
there is something like that on Windows 
... 

Best,
Rasmus

[1] https://archlinux.org/packages/extra/any/opencl-headers/

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Install OpenCL

2022-06-02 Thread Quirin Stier

Hi everyone,

the installation of OpenCL on windows with CUDA 11.7 failed. I can set
up tensorflow in python and communicate with the GPU, so I assume CUDA
is set up correctly. OpenCL headers are also available through the CUDA
toolkit.

However, the package installation of OpenCL in R fails. There is not
much documentation available. Can anyone help with that please?

> install.packages("OpenCL")
Installiere Paket nach ‘C:/Users/quiri/AppData/Local/R/win-library/4.2’
(da ‘lib’ nicht spezifiziert)
Paket, das nur als Quelltext vorliegt und eventuell Übersetzung von
C/C++/Fortran benötigt.: ‘OpenCL’
installiere Quellpaket ‘OpenCL’

trying URL 'https://cran.rstudio.com/src/contrib/OpenCL_0.2-2.tar.gz'
Content type 'application/x-gzip' length 20881 bytes (20 KB)
downloaded 20 KB

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

ERROR: OCL not set!

You will need a working OpenCL SDK with headers
and libraries for both i386 and x64

Set OCL to the root of the SDK

You can also set individial variables OCLINC,
OCL32LIB and OCL64LIB. If they are not set,
the default layout will be assumed.

ERROR: configuration failed for package 'OpenCL'
* removing 'C:/Users/quiri/AppData/Local/R/win-library/4.2/OpenCL'
Warning in install.packages :
  Installation des Pakets ‘OpenCL’ hatte Exit-Status ungleich 0

Die heruntergeladenen Quellpakete sind in
 ‘C:\Users\quiri\AppData\Local\Temp\RtmpeepQng\downloaded_packages’


Best regards,

Quirin

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.