§2024-12-10
-
sudo /usr/bin/clinfo -l
- In case the number of platforms is equal to 0 you need to install OpenCL drivers.
sudo apt update &&
udo apt install intel-opencl-icd
I got a Jetson Orin Nano installed with Nvidia SDK manager running Ubuntu 22.04, and would like to use R with these GPU. And I have R 4.4.2 installed, how to verify my Jetson devloment boad is setup correctly and I could usW R to do some work?
- Verify Jetson Orin Nano Setup
alexlai@jetsonOrinNano:~$ cat /etc/nv_tegra_release
# R36 (release), REVISION: 4.0, GCID: 37537400, BOARD: generic, EABI: aarch64, DATE: Fri Sep 13 04:36:44 UTC 2024
# KERNEL_VARIANT: oot
TARGET_USERSPACE_LIB_DIR=nvidia
TARGET_USERSPACE_LIB_DIR_PATH=usr/lib/aarch64-linux-gnu/nvidia
alexlai@jetsonOrinNano:~$ nvidia-smi
Tue Dec 10 10:37:51 2024
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 540.4.0 Driver Version: 540.4.0 CUDA Version: 12.6 |
|-----------------------------------------+----------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+======================+======================|
| 0 Orin (nvgpu) N/A | N/A N/A | N/A |
| N/A N/A N/A N/A / N/A | Not Supported | N/A N/A |
| | 25-R_LIBS_USER | N/A |
+-----------------------------------------+----------------------+----------------------+
+---------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=======================================================================================|
| No running processes found |
+---------------------------------------------------------------------------------------+
- Check CUDA Installation
alexlai@jetsonOrinNano:~$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Thu_Nov_18_09:45:25_PST_2021
Cuda compilation tools, release 11.5, V11.5.119
Build cuda_11.5.r11.5/compiler.30672275_0
alexlai@jetsonOrinNano:~$ ls /usr/local/cuda
alexlai@jetsonOrinNano:~$ ls -l /usr/local/cuda/bin/
total 0
lrwxrwxrwx 1 root root 13 十二 10 09:36 nvcc -> /usr/bin/nvcc
- Install R and GPU-Compatible Libraries
alexlai@jetsonOrinNano:~$ R
R version 4.4.2 (2024-10-31) -- "Pile of Leaves"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: aarch64-unknown-linux-gnu
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors.25-R_LIBS_USER
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> install.packages("gpuR")
Installing package into ‘/home/alexlai/R/aarch64-unknown-linux-gnu-library/4.4’
....
Creating a generic function for ‘colnames<-’ from package ‘base’ in package ‘gpuR’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘gpuR’:
.onAttach failed in attachNamespace() for 'gpuR', details:
call: NULL
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.
If you think that this is a bug in ViennaCL, please report it at viennacl-support@lists.sourceforge.net and supply at least the following information:
* Operating System
* Which OpenCL implementation (AMD, NVIDIA, etc.)
* ViennaCL version
Many thanks in advance!
Error: loading failed
Execution halted25-R_LIBS_USER
ERROR: loading failed
* removing ‘/home/alexlai/R/aarch64-unknown-linux-gnu-library/4.4/gpuR’
The downloaded source packages are in
‘/tmp/RtmpIzzfTG/downloaded_packages’
Warning message:
In install.packages("gpuR") :
installation of package ‘gpuR’ had non-zero exit status
^@nstall.packages("gpuR")
Save workspace image? [y/n/c]: n
alexlai@jetsonOrinNano:~$ clinfo
Number of platforms 0 <--
The output Number of platforms: 0 indicates that OpenCL is not correctly installed or configured on your Jetson Orin Nano.
¶OpenCV
- try to fix clinfo returns 0
alexlai@jetsonOrinNano:~$ clinfo
Number of platforms 0 <--
The output Number of platforms: 0
- check /etc/nv_tegra_release
alexlai@jetsonOrinNano:~$ cat /etc/nv_tegra_release
# R36 (release), REVISION: 4.0, GCID: 37537400, BOARD: generic, EABI: aarch64, DATE: Fri Sep 13 04:36:44 UTC 2024
# KERNEL_VARIANT: oot
TARGET_USERSPACE_LIB_DIR=nvidia
TARGET_USERSPACE_LIB_DIR_PATH=usr/lib/aarch64-linux-gnu/nvidia
- nvcc --version
alexlai@jetsonOrinNano:~$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Thu_Nov_18_09:45:25_PST_2021
Cuda compilation tools, release 11.5, V11.5.119
Build cuda_11.5.r11.5/compiler.30672275_0
- Reinstall OpenCL Libraries
alexlai@jetsonOrinNano:~$ sudo apt-get update && sudo apt-get install nvidia-opencl-dev
[sudo] password for alexlai:
Hit:1 https://repo.download.nvidia.com/jetson/common r36.4 InRelease
Hit:2 https://repo.download.nvidia.com/jetson/t234 r36.4 InRelease
Get:3 http://rig.r-pkg.org/deb rig InRelease
Hit:4 https://repo.download.nvidia.com/jetson/ffmpeg r36.4 InRelease
Hit:5 http://ports.ubuntu.com/ubuntu-ports jammy InRelease
Get:6 http://ports.ubuntu.com/ubuntu-ports jammy-updates InRelease [128 kB]
Hit:7 http://ports.ubuntu.com/ubuntu-ports jammy-backports InRelease
Get:8 http://ports.ubuntu.com/ubuntu-ports jammy-security InRelease [129 kB]
Fetched 260 kB in 3s (92.4 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
nvidia-opencl-dev is already the newest version (11.5.1-1ubuntu1).
nvidia-opencl-dev set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
- reinstall nvidia-cuda-toolkit
alexlai@jetsonOrinNano:~$ sudo apt-get install nvidia-cuda-toolkit
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
nvidia-cuda-toolkit is already the newest version (11.5.1-1ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
- sudo reboot
$ sudo reboot now
- clinfo is still zero
alexlai@jetsonOrinNano:~$ clinfo
Number of platforms 0
alexlai@jetsonOrinNano:~$ sudo apt-get install nvidia-opencl-icd
[sudo] password for alexlai:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package nvidia-opencl-icd is a virtual package provided by:
libnvidia-compute-565-server 565.57.01-0ubuntu0.22.04.4
libnvidia-compute-550-server 550.127.08-0ubuntu0.22.04.1
libnvidia-compute-550 550.120-0ubuntu0.22.04.1
libnvidia-compute-545 545.29.06-0ubuntu0.22.04.2
libnvidia-compute-535-server 535.216.03-0ubuntu0.22.04.1
libnvidia-compute-535 535.183.01-0ubuntu0.22.04.1
You should explicitly select one to install.
E: Package 'nvidia-opencl-icd' has no installation candidate