Not able to reserve memory with memmap kernel param in Ubuntu 22.04.01 - ubuntu-22.04

I had tried to reserve memory on ubuntu OS version 20.04.01 with below kernel grub cmd:
"memmap=1M\$0x100000000" (3 backslashes before $)
but it works and can see memory is reserved,
but when I used another linux machine which uses ubuntu OS version 22.04.01, then memory is not getting reserved.
Believe this should not be OS specific issue, but not sure what can affect this standard behavior. Any hint would be appreciated.

Related

Wrapper for rhel7 only

I have a wrapper script that runs different versions of programs based on what machine it is (32/64 bit). I want to add a line to it saying run this command only if on a rhel7 machine. Any ideas how to do this? What would be a rhel7 machine identifier the system would understand?
Thanks!

How is it that an arm-none-eabi-gcc code program runs on x86 machine?

Many questions in this forum start with "why does my code not run..." For a change, this one is "why does my code run..."
I develop on Ubuntu 18.04 running as a VM machine on a laptop (windows x86).
The following program compiled and linked with gcc runs fine and displays a 64 bit address.
char *s = "Hello\n"; printf ("Hello at address: %p\n", s);
My assumption is that arm-none-eabi targets a system bare metal. Of course I am not trying to run the above program on a bare metal. But I am trying to understand how cross compilation works.
The same program compiled and linked with arm-none-eabi-gcc (installed from Ubuntu) indicates a lot of missing references (_exit ...etc.) - normal. The code created is ARM assembly language, I verified with arm-none-eabi-objdump.
Adding the option --specs=nosys.specs at load time solves the missing references - as expected. When I run it on Ubuntu, QEMU is automatically called and has a segmentation fault. I am not surprised about the segmentation fault but the automatic launch of QEMU was unexpected.
Changing the option to --spec=rdimon.specs also solves the missing references - as expected. But despite the assembly code created is arm, it runs on Ubuntu (x86). The address displayed is 32 bits.
I know that rdimon.specs relates to semi-hosting, but I thought this was only activated when the program runs on the target (arm processor) and communicates with the host running gdb. Apparently I am wrong.
Sorry about this long preamble...simple question: how is it that my arm code runs on x86?
This is a result of the binfmt mechanism. When qemu is installed, it registers itself to run non-native executables, and is transparently invoked when a non-native ELF is executed. When semihosting is enabled using rdimon specs, it links a suitable set of libc stubs which cooperate with the host environment.

Memory error when kniting in R

I try to knit an Rdata file in R studio and get an error that cannot allocate vector 1,8mb.
I understand that I have memory issue so I tried to use memory.limit() as suggested on another post but I got an error
memory.size() is Windows-specific.
I also made extra RAM using a usb and changing swappiness but nothing happened. I'm using Ubuntu 14.04 32bit, R Version 3.3.0 32bit and also I have Windows O/S installed.
The problem is that you're on a 32-bit installation of R and you've used up the (very small) amount of memory it can handle. If you just switch to 64-bit you won't get this error.
The error message is because you invoked a Windows-specific command on Ubuntu, but that's really not relevant because with 32-bit R there's a hard limit on memory which you've already hit.
I know this is confusing because it's complaining about a very small size vector (1.8 MB) but that just means that the remaining amount of memory 32-bit R can handle is less than that.
If you were on Windows you might need to set the memory limit in addition to using 64-bit R, but if you're using Ubuntu then just using 64-bit R should solve the problem.
RStudio Instructions
I'm basing this on my version of RStudio, yours might be slightly different but it should be very close.
Click Tools
Click Global Options...
With the "General" (default) screen selected click Change where it says "R version:"
Select Use your machine's default version of R64 (64-bit)
Click OK
Allow RStudio to restart

Ubuntu keeps hanging

I recently started using ubuntu 14.04 (Dual booting with win 8.1).
It was working fine until I ran the following code on the terminal:
sudo apt-get install nautilus-open-terminal
I just wanted he "Open terminal here" option :P
Since then, its been hanging a lot. Every time this happens, I put my laptop to sleep and open it again, and its fine.
But it's really annoying (It must have hung like two times while typing this).
What should I do??
Thanks in advance
This problem is caused by nvidia drivers .. You can do two things. Either switch from nvidia drivers to nouview or bumblebee drivers. Or you can select the intel power saving mode in nvidia drivers.there might be some problem in selecting the powersaving mode. If there is problem you need to set update-alternatives. Or switch from nvidia drivers

Error -1001 in clGetPlatformIDs Call !

I am trying to start working with OpenCL. I have two NVidia graphics card, I installed "developer driver" as well as SDK from NVidia website. I compiled the demos but when I run
./oclDeviceQuery
I see:
OpenCL SW Info:
Error -1001 in clGetPlatformIDs Call
!!!
How can I fix it? Does it mean my nvidia cards cannot be detected? I am running Ubuntu 10.10 and X server works properly with nvidia driver.
I am pretty sure the problem is not related to file permissions as it doesn't work with sudo either.
In my case I have solved it by installing nvidia-modprobe package available in ubuntu (utopic/multiverse). And the driver itself (v346) was installed from https://launchpad.net/~mamarley/+archive/ubuntu/nvidia
Concretely, I have installed nvidia-opencl-icd-346, nvidia-libopencl1-346, nvidia-346-uvm, nvidia-346 and libcuda1-346. Not sure if they are all needed for OpenCL.
This is a result of not installing the ICD portion of Nvidia's openCL runtime. The ICD profile will instruct your application of the different openCL implementations installed on the system as multiple implementations from different vendors can coexist. Whe your application does not find the ICD information it gives the Error -1001.
Run your program as root. In case of success: you have trouble with cl_khr_icd- extension to load the vendor driver.
If you not running X11, you have to create device files manually or by (boot-)script:
ERROR: clGetPlatformIDs -1001 when running OpenCL code (Linux)
Same problem for me on a Linux system. Solution is to add the user to the video group:
# sudo usermod -aG video your-user-name
Since I just spend a couple of hours on this, I thought I would share:
I got the error because I was connected to the machine per remote desktop (mstsc). On the machine itself everything worked fine.
I have been told that it should work with TeamViewer by the way.
Dont know if you ever solved this problem, but I had the same issue and solved it in this post: ERROR: clGetPlatformIDs -1001 when running OpenCL code (Linux)
Hope it helps!
I have solved it in Ubuntu 13.10 saucy for intel opencl by created link:
sudo ln -s /opt/intel/opencl-1.2-3.2.1.16712/etc/intel64.icd /etc/OpenCL/vendors/nvidia.icd
I just ran into this problem on ubuntu 14.04 and I could not find ANY working answers anywhere online including this thread (though this was the first to show up on google). What ended up working for me was to remove ALL previous nvidia software and then to reinstall it using the .run file provided on the nvidia website. Installing the components through apt-get seems to fail for some reason.
1) Download CUDA .run file: https://developer.nvidia.com/cuda-downloads
2) Purge all previous nvidia packages
sudo apt-get purge nvidia-*
3) Install all run file components (you will likely have to stop X or restart in recovery mode to run this)
sudo sh cuda_X.X.XX_linux.run
This is because OpenCL has the same brain damaged one library per vendor setup that OpenGL has. A likely reason for the -1001 error is that you have compiled with a different library than the linker is trying to dynamically load.
So see if this is the problem run:
$ ldd oclDeviceQuery
...
libOpenCL.so.1 => important path here (0x00007fe2c17fb000)
...
Does the path point towards the NVidia-provided libOpenCL.so.1 file? If it doesn't, you should recompile the program with an -L parameter pointing towards the directory containing NVidia's libOpenCL.so.1. If you can't do that, you can override the linker's path like this:
$ LD_LIBRARY_PATH=/path/to/nvidias/lib ./oclDeviceQuery
For me, I was missing the CUDA OpenCL library, Running sudo apt install cuda-opencl-dev-12-0 solved it.
You should get number of platforms, allocate the memory for platforms, again get this platforms and then create context from this platform. There is good example:
http://developer.amd.com/support/KnowledgeBase/Lists/KnowledgeBase/DispForm.aspx?ID=71
This might be due to querying clGetPlatformIDs by multiple threads at the same time

Resources