How to configure arrayfire-rust to use CUDA? - rust

I've installed the latest official CUDA (7.5) and ArrayFire (Linux v3.3.1 64-bit) on Ubuntu 15.10. I am using the default configuration following the official documentation.
When I build the arrayfire-rust library and run the "unified" example in the ./examples folder, it shows me I only have CPU and OpenCL backends. The CUDA backend can not be found.
How do I configure the wrapper to support CUDA?
The official C++ examples can be built successfully using CUDA.
Another question
How to modify the build.conf file to build the arrayfire submodule available in the Rust wrapper? When I git clone the source from GitHub.
How can I config these options:
"glew_static": "OFF",
"freeimage_type": "DYNAMIC",
"cpu_fft_type": "FFTW",
"cpu_blas_type": "LAPACKE",
"cpu_lapack_type": "LAPACKE",
"freeimage_dir": "E:\\Libraries\\FreeImage\\Dist",
"fftw_dir": "E:\\Libraries\\fftw-3.3.4",
"acml_dir": "",
"mkl_dir": "",
"lapacke_dir": "E:\\Libraries\\lapack",
"glew_dir": "E:\\Libraries\\GLEW",
"glfw_dir": "E:\\Libraries\\glfw3",
"boost_dir": "E:\\Libraries\\boost_1_56_0",
"cuda_sdk": "/usr/local/cuda",
"opencl_sdk": "/usr"
I checked the path of CUDA libs and the cuda_sdk option seems correct. In addition, $AF_PATH and $LD_LIBRARY_PATH have been set. What's the problem with my config?

Related

#tensorflow/tfjs-node: sudden craving for aws-sdk, nock, mock-aws-s3

System information
OS Platform and Distribution (e.g., Linux Ubuntu 16.04): macOS Ventura 13.2.1
TensorFlow.js installed from (npm or script link): npm
TensorFlow.js version: 4.2.0
Describe the problem
I had previously used the #tensorflow/tfjs-node library successfully with no issues. Now, however, I have changed environments and unfortunately I am running into issues. I don't have the original source code any more to compare to see what the difference is.
I am running under node v18.4.0, although I have tried v16.16.0 and v14.21.2 (using nvm on macOS).
The problem is now it seems the library wants all sorts of supporting modules, which are not installed:
aws-sdk
nock
mock-aws-s3
It will not build without these, so I npm i them and then it builds happily.
So first question: why might my environment now be needing these where it didn't need them before? What might be different? As I say, sadly I don't have the last environment around any more.
Having built this, I now receive the error:
Error: #package/learn package.json is not node-pre-gyp ready:
package.json must declare these properties:
binary
Although I could configure all this, I think it is the wrong thing to do, since I had it up and running previously without any of this. Is where are these issues now coming from?
Can I run the #tensorflow/tfjs-node without installing or needing those three dependencies? I can provide the other config if it is not apparent to someone who has had the same issue.

Executing VLC for unity

I am facing similar issue like this mentioned in the post:
Triying to run VLC for unity plugin demo
Build platform is WIN 10 x64 (build 2004).
I am using LibVLC from the nightly build: https://artifacts.videolan.org/vlc/nightly-win64-llvm/20200914-0434/
LibVLCSharp gets built successfully (https://code.videolan.org/videolan/LibVLCSharp/-/tree/master/).
I was trying to build "VLCUnityPlugin.dll" but failing (have installed https://github.com/mstorsjo/llvm-mingw/tree/20200325 (LLVM MinGW)), using MSYS64 to run ./build.sh and it was coming up with this error:
MSYS error while building VLCUnity plugin dll
I thought maybe since "VLCUnityPlugin.dll" is NOT present, Unity x64 (v 2019.4.8f1) keeps on complaining with the following errors:
UNITY errors
But after, I hacked "common" make file as shown below:
make file changes to build VLCUnityPlugin.dll
I successfully built VLCUnityPlugin.dll and my plugin file structure looks like this now:
Plugin directory structure
Still, I do see UNITY Errors:
"Assets\VLCUnity\Demos\Scripts\MinimalPlayback.cs(99,39): error CS1061: 'MediaPlayer' does not contain a definition for 'GetTexture' and no accessible extension method 'GetTexture' accepting a first argument of type 'MediaPlayer' could be found (are you missing a using directive or an assembly reference?)"
The free trial version is available for download here https://videolabs.io/vlc-unity/vlc-unity-windows-trial.unitypackage.
That being said, if you want to build it yourself, you should follow what the CI does https://code.videolan.org/videolan/vlc-unity/-/blob/master/.gitlab-ci.yml
The libvlcsharp build is a special one, you need to define UNITY when you build it. It has the added GetTexture method.
For VLCPlugin.dll, you should crosscompile from Linux, where you install llvm-mingw and run it from bash (for example). MSYS not needed.

How can I link a Rust Wasm application with libpq via wasm-pack?

I'm trying to create a NodeJS application with a Wasm database layer. I use Rust, Diesel as a database driver and wasm-pack as a WebAssembly compiler.
When I try to build my service with wasm-pack, it fails trying to link the libpq library. The PQ_LIB_DIR environment variable is set, and the diesel-cli works without any issue, but when I try to compile my service it fails with the following error:
error: linking with `rust-lld` failed: exit code: 1
= note: rust-lld: error: unable to find library -llibpq
How can I fix it?
My system:
OS: Windows 10
Rust: 1.38.0
wasm-pack: 0.8.1
diesel: 1.4.0
PostgreSQL: 12
It's not possible to link to a system library from WebAssembly. You have to use an implementation written in pure Rust code to make it work. You also could use a JavaScript library. But it always has to be inside of the JavaScript runtime environment.
libpq is available inside the postgreSQL installation binary
For example, PosgreSQL Binary Download Site if open the zip distribution postgresql-12.0-1-windows-x64-binaries.zip you can see these 2 files:
pgsql\lib\libpq.dll
pgsql\lib\libpq.lib
You need to specify the LD_LIBRARY_PATH or you can specify the -L in the compiler arguments to tell the folder path which will auto pick those files
If you have used the installer the same file should be there inside the installation folder
You can also refer this stackoverflow link How to I tell Rust where to look for a static library?
--EDIT--
To combine a C library inside a web assemble distribution, we can use this guide - Compiling an Existing C Module to WebAssembly

Artifactory Unable to find module with librarian-puppet

I'm trying to use the librarian-puppet to fetch forge modules from an Artifactory repository.
In my Puppetfile I have something like:
forge "https://<artifactory_host>/artifactory/api/puppet/<repo_key>" #From artifactory docs
# PuppetLabs Modules
mod 'puppetlabs/stdlib', '4.24.0'
The command that I'm using is /usr/local/bin/pdk bundle -- exec librarian-puppet install --no-use-v1-api --verbose
The error that I get is:
[Librarian] Resolving puppetlabs-stdlib (= 4.24.0) <https://<artifactory_host>/artifactory/api/puppet/<repo_key>>
[Librarian] Checking manifests Unable to find module 'puppetlabs-stdlib' on https://<artifactory_host>/artifactory/api/puppet/<repo_key>
/tmp/tmp.BXyhBoNRiR/.pdk/cache/ruby/2.1.0/gems/librarian-puppet-3.0.0/lib/librarian/puppet/source/forge/repo_v3.rb:44:in `rescue in get_module'
/tmp/tmp.BXyhBoNRiR/.pdk/cache/ruby/2.1.0/gems/librarian-puppet-3.0.0/lib/librarian/puppet/source/forge/repo_v3.rb:41:in `get_module'
Versions:
puppet 3.8.7
pdk 1.5.0
ruby 2.1.9
According to the documentation at https://www.jfrog.com/confluence/display/RTF/Puppet+Repositories#PuppetRepositories-Usinglibrarian-puppet, it seems I'm trying to get the modules correctly using the librarian-puppet, but something most be missing.
Thanks for any help.
I think Artifacotry does not support Puppet 3.8.7 its documented in Wiki.
Puppet version support
Puppet does not support a context path up to version 4.9.1, we recommend using Artifactory with Puppet version 4.9.2 and above. Please see below if you are using Puppet 4.9.1 and below.
The official Artifactory documentation (not a wiki) recommends using Puppet 4.9.2 or later with Artifactory:
Puppet version support
Puppet does not support a context path up to version 4.9.1, we
recommend using Artifactory with Puppet version 4.9.2 and above.
Please see below if you are using Puppet 4.9.1 and below.
(Emphasis in the original.)
As that comment indicates, however, the docs do also suggest a workaround for use with earlier Puppet:
If you need to use Puppet 4.9.1 and below you can use a workaround
which uses NGINX or Apache to rewrite all requests from /v3/* to
/artifactory/api/puppet/<repo-name>/v3/*.
The docs go on to present some example configurations, which I will not repeat here.

Vagrant + chef-solo + berkshelf: node.js last version cookbook

Basically, i need a working machine with node.js & npm installed.
I've configured a vagrant + berkshelf + chef enviroment, but i can't find a lastest version (>= 4.0.0) nodejs cookbook as source for my berksfile.
I've tried with this:
https://supermarket.chef.io/cookbooks/nodejs
from chef supermarket but install a old version of node + npm.
I am experiencing for the first time vagrant and chef so i can't understand how find it.
Can someone help me?
In your role or node settings you can specify default attributes for any cookbook you use. Cookbook nodejs allows you to set NodeJS version with the attribute version (check its attributes/default.rb file). But this attribute is taken into account only when NodeJS is installed from precompiled binaries or sources. So you need to specify install_method as well (default is package, i.e. installation via system package manager).
One more thing: you need to manually specify binary package checksum, which you can find in every release folder here: https://nodejs.org/download/release/
So, to install the latest version from official binaries use the following settings in role or node:
"nodejs": {
"install_method": "binary",
"binary": {
"checksum": "75b029b30d4a4147d67cf75bf6e034291fb5919c6935ec23f8365cee2d463f12"
},
"version": "5.3.0"
}

Resources