vulkan is not avaible in lxc / lxd container but opengl is - gpu

I am using ubuntu 18:04 with an lxc / lxd steam container. It works great, I followed this tutorial and did some changes to the network stuff.
https://blog.simos.info/running-steam-in-a-lxd-system-container/
Steam works for opengl games but not for vulkan games. Same for lutris.
Host side:
===========
VULKAN INFO
===========
Vulkan Instance Version: 1.1.70
Instance Extensions:
====================
Instance Extensions count = 16
Container side:
ubuntu#steam:~$ vulkaninfo
===========
VULKAN INFO
===========
Vulkan Instance Version: 1.1.70
ERROR: setupLoaderTermPhysDevs: Failed to detect any valid GPUs in the current config
ERROR: setupLoaderTrampPhysDevs: Failed during dispatch call of 'vkEnumeratePhysicalDevices' to lower layers or loader to get count.
/build/vulkan-UL09PJ/vulkan-1.1.70+dfsg1/demos/vulkaninfo.c:2700: failed with VK_ERROR_INITIALIZATION_FAILED
OpenGL works just fine, games run fast, so it must find my only gpu in the system. Do I have to separately enable vulkan for the container?
The host has no problems with the vulkan smoketest either:
user#host:~$ vulkan-smoketest
7223 presents in 5.00039 seconds (FPS: 1444.49)

That guide adds manually the necessary OpenGL shared libraries in the LXD container, and by doing so, does not add the Vulkan shared libraries.
LXD now supports the NVidia container runtime (provided by NVidia), therefore you can use it instead. Follow the more recent guide at https://blog.simos.info/running-x11-software-in-lxd-containers/

A reddit user named zakk wrote a solution in the comments of https://blog.simos.info/running-steam-in-a-lxd-system-container/.
After doing some traces, I noticed it is failing to open files in
/dev/dri The container has the wrong permissions; on the host those
files have an ACL set that lets the current user access them, the
container does not. So to fix: in the container run
sudo setfacl -m "u:ubuntu:rw-" /dev/dri/*
You have to execute the setfacl command every time you start lxc.

Related

How to enable usb gadget mode from menuconfig

I am trying to enable a usb0 interface in my kernel using the rndis module. This resides under the gadget driver category in menuconfig. I am unable to figure out the correct and complete set of configurations in menuconfig to enable the rndis support. Since the gadget driver config is incomplete, I am currently facing an error when I try to modprobe g_ether on my target (linux 4.19.55 armv7l):
udc-core: couldn't find an available UDC - added [g_ether] to list of pending drivers
How to fix this error so that usb0 comes up on my target
The UDC device issue was resolved by changing the mode of musb controller to dual from kernel menuconfig. After this the g_ether gets loaded successfully asn usb0 shows up on the target. Basically a UDC device like below needs to show up on the target before g-ether can be loaded.
root#:/sys/class/udc# ls
musb-hdrc.0.auto

DSE Can't Install Graph From LCM

I've installed fresh version of DSE 6.8 for dev purposes, after installing a cluster with one node (Cassandra + Solr) I want to allow Graph, the job keeps failing with error:
Graph is enabled and should have native-transport-address set to 0.0.0.0. name="node1" ssh-management-address="IP" rack="rack1"
Changed the cassandra.yaml from:
native_transport_address: IP
to:
native_transport_address: localhost
The job keeps failing, any ideas?
As it says, you need to configure setting native_transport_address in the node definition dialog to 0.0.0.0, and native_transport_broadcast_address to actual IP address.
This change should be done in the LCM UI as described in documentation, and then you can say reconfigure, or reinstall - you shouldn't change cassandra.yaml directly - it's generated by LCM.

troubles caused by tensorflow image's LD_LIBRARY_PATH

I'v installed DC/OS v1.8.4, the destination node has gpu resources and nvidia driver has also been installed, I tried to deploy tensorflow in mesos container, but it failed, there is only one error message in mesos's stderr:
mesos-containerizer: error while loading shared libraries: libmesos-1.0.1.so: cannot open shared object file: No such file or directory
But I can deploy other services successfuly, such as nginx, wordpress (also in mesos container)
The problem may be caused by tensorflow image, in its parent image CUDA, it reset LD_LIBRARY_PATH :
ENV PATH /usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH} ENV LD_LIBRARY_PATH /usr/local/nvidia/lib:/usr/local/nvidia/lib64
In OpenDCOS, before mesos-agent startup, it sets its executor's environment variable LD_LIBRARY_PATH to "/opt/mesosphere/lib", so that executor can locate necessary so files, but in above case, LD_LIBRARY_PATH is reset by tensorflow, so it failed to startup!
Anyone knows how OpenDCOS handle this problem ? Modify these public CUDA images?
GPUs are only officially supported in DC/OS 1.9+
For (unsupported) instructions on getting GPUs to work in 1.8, please see my answer to this question on the DC/OS mailing list:
https://groups.google.com/a/dcos.io/d/msg/users/HEgcUfRRqzk/inIBmapMCQAJ
Additionally, there is also a know issue with setting LD_LIBRARY_PATH in your container image for pre 1.9 clusters (though it usually manifests as a missing libssl.so library).
In your case, the CUDA container is setting LD_LIBRARY_PATH, which is overriding the LD_LIBRARY_PATH setting that DC/OS relies on to find it's library files. This is obviously a bug in DC/OS and has since been fixed in 1.9. The best (unsupported) workaround for this is to run
sudo ldconfig /opt/mesosphere/lib
on all of your nodes to put /opt/mesosphere/lib into the default library path. You will have to redo this on every reboot (or alternatively) add /opt/mesosphere/lib to a file under /etc/ld.so.conf.d/ to make it durable (maybe /etc/ld.so.conf.d/dcos.conf?).
This JIRA addressing the underlying issue can be found here:
https://issues.apache.org/jira/browse/MESOS-7027

How to load Magritte Seaside?

I've loaded Magritte and Seaside from the configuration browser into Pharo 4, but I don't see that the package Magritte-Seaside was loaded.
How do I load this package?
I highly recommend you loading the Stephan's QCMagritte package which includes the correct directives to load Seaside 3 with a Zinc adaptor so you can start a web server without loading anything else:
From MinGW command line:
$ wget -O- http://get.pharo.org/40+vm | bash
$ ./pharo-vm/Pharo.exe Pharo.image config \
"http://smalltalkhub.com/mc/Pharo/MetaRepoForPharo40" \
"ConfigurationOfQCMagritte" --printVersion --install=stable --group=All
Create an adaptor, start a web server with the Seaside Control Panel on port 8080, and then point your browser to http://localhost:8080/browse to see applications
The configuration browser only loads default groups for the configurations it loads. In the ConfigurationOfSeaside and ConfigurationOfMagritte you'll find many more groups.
In the ConfigurationOfQCMagritte I use 'Seaside' from Magritte and #('JQueryUI' 'JQuery-JSON') from Seaside. If you don't mind the extra packages, you could just load QCMagritte from the configuration browser.
To just add the missing packages, you could load the latest Magritte-Seaside and Magritte-Pharo-Seaside packages from the Magritte3 smalltalkhub repository with the Monticello Browser.
A pre-loaded QCMagritte image is available from http:ci.inria.fr/pharo-contribution/job/QCMagritte
I saw the group Seaside defined as a Metacello group in the configuration's baseline for 3.3 (which is used by 3.5, the current version). So I was able to load the package by evaluating:
(ConfigurationOfMagritte3 project version: #stable) load: 'Seaside'.

Kinect / Primesense (Xtion) ROS Ubuntu through Virtual Machine (VMware)

Since it took me quite some time to figure out how to get Xtion (Primesense) to work on VMware I thought to share it here with you. (with Kinect I have a problem to let ROS see the device even though VMware has successfully connected it).
roslaunch openni2_launch openni2.launch
Running the above command gave me the error:
Warning: USB events thread - failed to set priority. This might cause loss of data...
I either got a single frame or no frame when running "rviz" and Add --> Image --> Image topic --> /camera/rgb/image_raw
So how do I get video frames in Ubuntu from a Primesense device while using a Virtual Machine (VMware)?
My specs
Windows 7 running VMware 10.0.4 build-2249910
Ubuntu 12.04.5 Precise in VMware
ROS Hydro
The following question pointed me in the right direction: http://answers.ros.org/question/77651/asus-xtion-on-usb-30-ros-hydro-ubuntu-1210/?answer=143206#post-id-143206
In the answer of blizzardroi (not selected answer) he/she mentions that USBInterface should be 0. I reasoned that since my main Machine is Windows, I should set UsbInterface to 1, which indeed solved it.
Solution
Go to /etc/openni2/ (from system folder, not Home) and open PS1080.ini with administrator rights (e.g. sudo gedit PS1080.ini). Search for UsbInterface, remove the ; and change the value to 1. It should look like below:
; USB interface to be used. 0 - FW Default, 1 - ISO endpoints (default on Windows), 2 - BULK endpoints (default on Linux/Mac/Android machines)
UsbInterface=1
Additional
From previous experience it may also be related that your Windows system may need the kinect drivers as well. If the above not works, try to install the following:
(Kinect SDK) https://www.microsoft.com/en-us/download/details.aspx?id=34808
(OpenNI2 Windows) http://structure.io/openni
p.s. Don't forget your drivers for Ubuntu (replace hydro with your ROS version)
sudo apt-get install ros-hydro-openni*
Important
It doesn't solve the error below, but rviz returns video, which means that we can read the data the Primesense device publishes!
Warning: USB events thread - failed to set priority. This might cause loss of data...
Got the same warning from opennni (issued at start by a binary located at Tools/PSLinkConsole) with another sensor.
Solved by starting process as sudo - my guess: to set priority to USB event threads you need root access. :)