I have been attempting to install the gpuR package as it is a dependency for another package I want to use. However, simply running install.packages('gpuR') generates an error. For context, I am using a very new install of Linux. The error:
.onAttach failed in attachNamespace() for 'gpuR', details:
call: initContexts()
error: ViennaCL: FATAL ERROR: ViennaCL encountered an unknown OpenCL error. Most likely your OpenCL SDK or driver is not installed properly. In some cases, this error is due to an invalid global work size or several kernel compilation errors.
So it says the potential error clearly there. However, the question now lies on how to properly install OpenCL. Using an AskUbuntu post, I ran the following commands:
sudo apt update
sudo apt install ocl-icd-opencl-dev
Still, this gave the same error. I browsed the intel forums a bit, and installation seems to vary. What would be the correct steps to install OpenCL so that gpuR may be used on Ubuntu 18.04?
ocl-icd is only the loader library. You need to install an implementation (that can be loaded by ocl-icd). Where can you get the implementation, depends on what hardware (GPU) you have. I'll assume Intel since you mention their forums. If you have Haswell or older, google for "intel beignet". If you have Broadwell & newer, google "intel compute runtime".
Related
I am trying to load the rJava using the command:
library(rJava)
But I get the following error:
Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname)
error: JAVA_HOME cannot be determined from the Registry
Error: package or namespace load failed for ‘rJava’
I tried reinstalling both the Java and the R program with the latest versions
but still get these errors..
May I know how I can resolve this? Thank you very much!
This error is often resolved by installing a Java version (i.e. 64-bit Java or 32-bit Java) that fits to the type of R version that you are using (i.e. 64-bit R or 32-bit R). This problem can easily effect Windows 7 users, since they might have installed a version of Java that is different than the version of R they are using.
http://www.r-statistics.com/2012/08/how-to-load-the-rjava-package-after-the-error-java_home-cannot-be-determined-from-the-registry/
Install 64 bit Java from https://java.com/en/download/manual.jsp.
Then in windows cmd run
setx PATH "C:\Program Files\Java\jre1.8.0_211\bin\server;%PATH%"
(make sure your path is correct).
Then in RStudio run
Sys.setenv(JAVA_HOME="")
Now, you should be able to run rJava!!
I got the same error resolved by installing same version of R and Java i.e. 64 bits and manually updating the path i.e. ,
Sys.setenv(JAVA_HOME='C:/Program Files/Java/jre1.8.0_121') # for 64-bit version
R for Windows installer installs by default both 32-bit and 64-bit files. Reinstalling R and unticking 32-bit part solved the problem for me.
Under Windows 10, first check your (running) R-Version:
R.version
If you see something like x86_64, a 64-bit version of Java is needed.
Simply downloading and installing the matching Java version (https://java.com/en/download/manual.jsp) solved the problem for me. No reinstall of R needed (as suggested by other users here). There also was no need to set the path explicitly.
As mentioned in the r-statistics link cited above, you have to manually download the 64-bit version of Java. If not, then the 32-bit version will be installed.
So, if you have a 64-bit operating system, then ensure that both R and Java are using the 64-bit installs. Otherwise, this problem will persist.
This has been killing me and I have tried multiple methods above, it doesn't work. After, I mix all solution to try and below process works for me.
Install Java for 64 bit
Run below code in windows command
setx PATH "C:\Program Files\Java\jre1.8.0_171\bin\server;%PATH%"
(please change the address acorrding to your dvm.dll real address)
Run below in R studio
Sys.setenv(JAVA_HOME="")
Then I finally can run
library(rJava)
library(xlsx)
I faced the same issue and was feeling very down as I couldnt get my analysis done.
This worked for me :
check your operating system. 64 bit or 32 bit.
https://helpx.adobe.com/x-productkb/global/determine-whether-computer-running-32.html
uninstall previous versions of Java.
delete rJAVA library from Doc>R>win-library. If you have more than 1 versions of R, make sure you delete rJAVA package from all of them.
install Java based on system requirement (64 bit or 32 bit).
and finally restart R before and after installing rJava package.
If R is 64-bit version make sure to install Java 64-bit version!
If R is x86-bit version make sure to install Java x86-bit version!
You can add INSTALL_opts=c("--no-multiarch") to your install_github() call:
devtools::install_github("mne-tools/mne-r", INSTALL_opts=c("--no-multiarch"))
For more info: https://github.com/mne-tools/mne-r/issues/5#issuecomment-489588267
Create a new directory in C: drive as "library"
set your libPath this directory. you need to type
.libPath("C:/library")
reinstall packages which requires java (xlsx, rJava, RJDemetra)
it will give error message again but it will work.
I have installed ArrayFire 3.8.0 using the binary installer as per the instructions mentioned in the documentation. All dependencies were installed before installing it. NVIDIA CUDA Toolkit 11.3 is also installed. Installation was successful.
To test the installation, I have also build the examples as mentioned in the guide. There was no error during the build process. CPU & CUDA builds are running fine but OpenCL samples are not running. When I execute ./helloworld_opencl example, nothing happens on terminal. No process is shown in top & nvidia-smi.
Please guide me what could be the issue here. Clinfo command is running fine. I am on Ubuntu 20.04.
Thanks
I'm trying to install the latest sf package (version 0.9-4) using R 4.0 on an AWS EC2 instance with Ubuntu 18.04. I get this error:
testing if installed package can be loaded from temporary location
malloc_consolidate(): invalid chunk size
Aborted (core dumped)
ERROR: loading failed
I've tried downloading the package several ways, and I can download other packages just fine. There are 15G of ram available and 47G of available space on the hard drive. I can't figure out how this would be a memory problem or what my next steps might be.
I was eventually able to install it, although I'm not sure what exactly fixed it. It may have been updating various dependencies.
I am trying to install XLConnectJars to R and I keep getting the following error despite having Java DK and rJava installed?
Error: Package as namespace load failed for 'XLConnectJars'
.onLoad failed om LoadNamespace() for 'rJava', details:
call: library.dynam("rJava",pkgname,libname)
error: DLL 'rJava' not found: maybe not installed for this architecture?
Any help greatly appreciated!
XLConnectJars is a support package used by XLConnect, a platform-independent interface to Microsoft Excel. In order for XLConnectJars to install correctly, one must also install the rJava package.
The error noted in the OP indicates that rJava did not install correctly.
error: DLL 'rJava' not found: maybe not installed for this architecture?
Many people encounter problems installing rJava because it cannot access the Java Runtime from the operating system. Solutions to the "unable to access Java runtime" problem vary by operating system.
Windows
People often have 32-bit Java installed and then use 64-bit R. The 64-bit version of R requires the 64-bit version of Java.
Solution: Install the 64-bit version of the Java Runtime for Windows from the Java Download web page.
MacOS
Details to configure rJava on MacOS are covered in another SO answer I posted, Unable to load rJava in RStudio, which I am reposting here for convenience.
There is a very specific sequence of steps that must be taken to get rJava to work on a Macbook, as documented in rJava Issues #86.
Download and install Java from Oracle
Uninstall any previously installed version of rJava
Add JAVA_HOME to your .bashrc
Close & restart terminal, R and RStudio sessions so they pick up the updated JAVA_HOME
Use install.packages() to install rJava
See the URL link above for additional details on each step.
Ubuntu Linux
Use the Advanced Packaging Tool to install Java, then reconfigure Java support in R.
sudo apt-get install openjdk-8-jdk # openjdk-9-jdk has some installation issues
sudo R CMD javareconf
Once these steps are completed, install the XLConnectJars package with install.packages("XLConnectJars").
NOTE: some of this content is adapted from an article I previously posted on my Github site, Common Problems with Java and the xlsx Package.
I installed iplots and rjava packages. When I do this library(iplots), I get the following error. I do have JDK installed on my pc.
Loading required package: rJava
Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname)
error: JAVA_HOME cannot be determined from the Registry
Error: package ‘rJava’ could not be loaded
The error is telling you that there is no entry in your Registry that tells R where Java is located on your machine. Either your registry is corrupt, but more likely you haven't installed Java. You can install either the Java Runtime Environment or the Java Development Kit.
(You can download Java here.)
If you installed Java, try reinstalling it. This should put the entries back in your Registry.
If that doesn't work, you can start looking at exactly where R is looking for your Registry entries. The function that rJava uses to find Java is in the rJava:::.onLoad function. Within that function there is a subfunction called find.java. I copy the contents here:
find.java <- function() {
for (root in c("HLM", "HCU")) for (key in c("Software\\JavaSoft\\Java Runtime Environment",
"Software\\JavaSoft\\Java Development Kit")) {
hive <- try(utils::readRegistry(key, root, 2),
silent = TRUE)
if (!inherits(hive, "try-error"))
return(hive)
}
hive
}
Copy and paste this into your R window, and then run it find.java(). rJava is looking for an entry for JavaHome. If that isn't listed, then it is missing from your registry.
You could also manually set the directory of your Java location by setting it before loading the library:
Sys.setenv(JAVA_HOME='C:\\Your\\Java\\Directory')
library(rJava)
If like me you do not have admin rights to install 64-bit Java, just open 32-bit R and it should work ok on your 64 bit PC as part of the problem seems to be the rJava library function calls embedded Java functions/routines, which may only have being designed for 32-bit interface with Excel/Windows and possibly too large a task at the time to change everything.
Answer in link resolved my issue.
Before resolution, I tried by adding JAVA_HOME to windows environments. It resolved this error but created another issue. The solution in above link resolves this issue without creating additional issues.
Any Linux users here, run command:
sudo R CMD javareconf
That typically needs to be run after an update of the system Java installation,
as suggested here