NVIDIA Nsight waring: OpenACC injection initialization failed. Is the PGI runtime version greater than 15.7? - nvidia

I am trying to venture into accelerating my Fortran 2003 programs with OpenACC directives on my Ubuntu 18.04. workstation with Nvidia GeForce RTX 2070 card. To that end, I have installed Nvidia HPC-SDK version 20.7 which should comes with compilers I need (Fortran 2003 from Portland Group and Nvidia (both are version 20.7-0)) as well as profilers (nvprof and Nvidia Nsight Sytems (2020.3.1)).
After a few post-installation glitches, and owing mostly to the help from Robert Cravella (https://stackoverflow.com/users/1695960/robert-crovella) and Mat Colgrove (https://stackoverflow.com/users/3204484/mat-colgrove) I managed to get things going which made me very happy.
My workflow looks like this:
Compile my program:
pgfortran -acc -Minfo=accel -o my_program ./my_program.f90
I run it through profiler:
nsys profile ./my_program
And then import into nsight-sys with File -> Open and chose report1.qdrep
I believe this to be a proper workflow. However, while opening the report file, nsight-sys gives me the warning: "OpenACC injection initialization failed. Is the PGI runtime version greater than 15.7?" That's quite unfortunate, because I use OpenACC to accelerate my programs.
I am not quite sure what PGI runtime is, nor would I know how to check it or change it? I assume it is something with Portland Group (compiler), but I use the suite compilers shipped with Nvidia's HPC-SDK, so I wouldn't expect incompatibilities with the profiler tools shipped in the same package.
Is it an option, or possible at all, to update the PGI runtime thing?
And advice, please?
Cheers

Same answer as your previous post. There's a know issue with Nsight-Systems version 2020.3 which may sometimes cause an injection error when profiling OpenACC. I've been told that this was fixed in version 2020.4, hence the work around would be download and install 2020.4 or use a prior release.
https://developer.nvidia.com/nsight-systems
Version 2020.3 is what we shipped with the NVHPC 20.7 SDK. I'm not sure we have enough time to update to 2020.4 in our upcoming 20.9 release, but if not, we'll bundle it in a later release.

Thanks Mat,
In the meanwhile I managed to have everything running. I did as follows:
First installed CUDA toolkit, which came with the latest driver for my Nvidia RTX 2070 card, 11.1 to be precise. It needed a reboot, but that's OK. For CUDA toolkit to work, I had to set LD_LIBRARY_PATH to its libraries.
Then I installed Nvidia HPC-SDK, which I needed for Fortran 2003 compiler.
HPC-SDK is built for CUDA version 11.0 and comes with its own libraries and LD_LIBRARY_PATH should point to its libraries different from CUDA toolkit.
But, I kept the LD_LIBRARY_PATH to point to CUDA toolkit ones, and then compilers and profilers work in perfect harmony :-)
Thanks again, you and Robert helped me big time to get things running.

Related

getCudaEnabledDeviceCount() returning -1 : OpenCV [cuda] built with vcpkg

Building an OpenCV CUDA app on win10 with MSVC 2017 using the opencv[cuda] package installed by vcpkg. To check for usable devices, I call getCudaEnabledDeviceCount() and it returns -1, which OCV documents as meaning cuda support is enabled but the CUDA driver is incompatible.
Re-installing opencv[cuda] with vcpkg did not help.
Can you suggest a way to diagnose or fix?
Answer: The machine is an old gaming laptop whose most recent recommended nVidia display driver is 425.31. I had recently installed CUDA toolkit 10.2, whose runtime is actually incompatible with that driver. Rolling back to toolkit 10.1 resolved the problem.

Is Clang as (or more) portable than gcc for C++?

Suppose I have a C++ project, and I compile it with gcc and with clang. You can assume that the gcc compiled version runs in another linux machine. Will this imply (in normal circumstances) that the clang version will also run on the other linux machine?
Clang binraries are as portable as gcc binaries are, as long as you are linking to the same libraries and you aren't passing flags like -march=native to the compiler.
Clang has one huge advantage over gcc, it can deal with alsmost all libstdc++ versions,
while gcc is bound to its bundled version and often can't parse any older versions.
So the following often happens in production environments:
Install an LTS distro (Ubuntu 12.04 for example)
Keep gcc, glibc and libstdc++ untouched
Install a recent clang version for C++11, etc
Build the release binaries with clang
So (in my specific example) those binaries will work on all
distros with libstdc++ >= 4.6 and glibc >= 2.15.
This may be an interesting read for you.
If the program is a simple Hello world, it should work on the other machine when compiled through Clang.
But when the program is a real program with a lot a lines and compilation units, and calls to many external libs everything is possible depending on the program itself and the compilation options :
hardware requirements (memory) being different (mainly depends on compilation options)
use of different (versions of) libraries between gcc and clang
UB giving expected results in one and not in the other
different usages for implementation defined rules
use of gcc extensions not accepted by clang
For all of the above except 2 first, it should run on other machines it it runs on one
linux programs depend on their build environment. If your glibc version or kernel is different there will be lots of possibilities that the executable will not be able to run. You could use the interpreter language of llvm though, it compiles into bytecode which can be interpreted on various operating systems.
The answer is, well, depends.
The first hard requirement is the same CPU architecture. 64 Bit is not enough of a qualifier. If you compile of x64 you won't have much success running it on 64-Bit ARM.
The next big one is libraries. If you use any libraries in the program, the target system needs to have those libraries. This includes the kernel headers. So if you compile for e.g. a current kernel version, using the most cutting-edge features, then you will have no joy running that program on a very old version of Linux.
The last one is hardware dependencies. If you create a program that e.g. requires 4 GB of RAM and then try to run it on a small embedded device with 256 MB RAM, that won't work either.
To fit better to your changed question: From my experience there shouldn't be much of a difference in portability between Clang and gcc. Also googling didn't turn up anything, so it should basically work. But better always test stuff like that before you publish some binary in production.

EmguCV - nvcuda.dll could not be found

I've been asked to build a real-time face recognition application, and after some looking around I've decided to try EmguCV and OpenCV as the facial recognition library.
The issue I'm having at the moment is trying to get the SDK installed and working. I've followed the instructions found here to try and get it running, but I still can't run the samples. Whenever I try and run them, I get the error
The program can't start because nvcuda.dll is missing from your computer.
Try reinstalling the program to fix this problem.
I've tried most of the usual fixes, such as adding the bin folder to my environment path and copying the dll's into my system32 folder, but none of it seems to work.
EmguCV version 2.4.2.1777-windows-x64-gpu
Windows 8
AMD Radeon HD 6700 series graphics card.
I'm assuming this is an issue with the fact that I dont have an nVidia graphics card, but I'm not sure what I can do about it. For now, I'm going to try recompiling the source rather than using the downloaded .exe, and seeing if that helps.
Any suggestions?
Had the same problem, EmguCV 2.4.2 (no matter if x86 or x64) is compiled with GPU and you have to had nvidia GPU with CUDA support. So, if you want for eg. Fisherfaces from 2.4 in C# - wait for non-GPU release or buy/borrow CUDA card ;)
I happen to have the exact same problem as you. Everything is working fine on my computer (WinXP 32-bit) but not on Win7 64-bit computers.
This was because on my computer I already have OpenCV 2.4.2 installed and when I execute my program the path to the OpenCV dll points to the OpenCV folder and not to the dlls in the EmguCV folder. The original OpenCV dll don't have this dependency on NVidia's driver.
I used Dependency Walker to help me find out what was happening, as suggested here.
This link says that only the -gpu packages have gpu processing enabled but as you say the latest version (2.4.2) only a gpu package and no no-gpu package...
I read here that all I needed was to download the latest NVidia drivers to get the nvcuda.dll file but I downloaded many packages and never found this file: gpu computing sdk, cuda toolkit, display drivers, device drivers...
My workaround, instead of using an older version of EmguCV/OpenCV is to use the original dll from OpenCV 2.4.2.
I just used nvcuda.dll from dll-files.com.
It seems the issue is that the latest version on the site does not contain a non-GPU enhanced download, and that the GPU enhanced download requires an nVidia graphics card for CUDA integration.
I successfully downloaded and run the previous version which does not have GPU enhancements.
I had similar problem.
When I compile and run my application on computer with NVIDIA gpu it works fine.
Problem was when I moved app to another computer.
This second computer has no NVIDIA gpu and it threw 'Emgu.CV.CvInvoke' exception.
After many attempts I fortunately solved this problem.
As you mentioned before for now there is only gpu package for version 2.4.2.
I didn't notice this before.
For me solution was:
Copy files: 'cudart64_42_9.dll' and 'npp_42_9.dll' into Debug (application) folder
Copy file 'nvcuda.dll' into System32 folder.
After this steps aplication works on all computers even without NVIDIA gpu/ CUDA.
Other solution might be using opencv universal gpu version (for now is alpha 2.4.9) link: http://sourceforge.net/projects/emgucv/files/emgucv/2.4.9-alpha/
You can download source EmguCV from GIT and compile it, i have done this and works :
http://www.emgu.com/wiki/index.php/Download_And_Installation#Building_from_Git
It generates a non-GPU version of dlls
Regards.
here's also another copy of the dll's:
http://www.kimchiandchips.com/files/vvvv/nvcuda/
so 2 solutions:
Get NVidia CUDA DLL's from the above link. Ideally rename the 64 or 32bit version to nvcuda.dll based on your required platform. Put next to your opencv dll's
Upgrade to 2.4.9 which has universal GPU support
I also had some problems when doing my dissertation using EmguCV for face recognition.
Try to use the stablest version libemgucv-windows-x86-2.4.0.1717.exe
Try not to use the gpu download, this version has the least bugs and the 32-bit is better than the x64.
when compiling for the first time use visual studio 2012.
With this version you wont need to install all the above mentioned. You can see this example to know it really works : http://sourceforge.net/projects/emgufacerecog/

Linux Version of Z3: Dependency On Old libgmp.so.3

Z3's dependency on libgmp.so.3 is unresolved in the linux package, leaving the user to provide this library. However, this library is very old and is not readily available.
Does anyone know a method for getting around this issue? I am currently running x86_64 and cannot get around this missing dependency without a great deal of hassle.
Is it possible the linux packages could be fixed such they include the expected library in the distribution?
You can get GMP3 by executing sudo apt install libgmp3-dev.
I'm not a Linux expert, but this is the command I used to install GMP before I compiled Z3.
When I installed the virtual machine for running Linux 64, I think I didn't find a package for the more recent versions of GMP.
I will try again. If it doesn't work, I will download the most recent GMP tar ball and build it from scratch.
BTW, the Z3 for Linux 32 comes with two .so files. One of them has GMP statically linked.
The trick I used for building this .so file didn't work for the 64 bit version.
As I said, I'm not a Linux expert, any suggestions on how to build a better Z3 library for Linux x86_64 users are welcome.

CUDA x64 + openCV 2.1

the previous tutorials have not shown anybody else having this problem: compiling openCV and CUDA projects in vs2008 in windows 7 x64. but i have been stuck on it for over a week.
Zero problems building openCV samples and my own code and CUDA within their own projects. I cannot get them to build in a single project together no matter what i try to do in VS.
Here's a good guide, i'm sure it will help you: How to Build OpenCV 2.2 with GPU (CUDA) on Windows 7
self solve
this is NOT possible in windows, don't bother trying... i have since changed to ubuntu with no problems
It is possible when compiling OpenCV in x64 mode with checking "With Cuda" in CMAKE. Also you need to have the x64 Cuda Toolkit with Nvidia Performance Primitives and GPU Computing SDK.

Resources