Docker containers cannot work with Nvidia nsight systems - docker

I am recently learning to use cuda programming and want to use nvidia's tool Nvidia nsight systems to visualize the programs I have written. I have done profile analysis on my personal laptop remotely to the server. Now I have installed cuda on my own laptop with nsight systems software. When I remotely go to the server, he can work. And will display the running timeline. But my program is written in the docker container, when I use nsight systems to link docker, it will fail. Why is this? I mapped my docker to 5222 on the host port. And ensure that the docker container can be directly connected through ssh.
The operating system of the notebook is ubuntu16.04
The operating system of the server is ubuntu16.04
The docker image I use is: nvcr.io/nvidia/tensorrt:20.03-py3
it show that: tool library installation failed!

OK, i solve the problem by nvidia doc,if we want to use nvidia nsight remote to docker, we should Open ports 22 and 45555 by mapping the 22 port of the container to any port of the host, and mapping any port of the container to 45555 of the host.

Related

Docker Windows container running DLL's

I work at a lab and we have some devices that use DLL’s to connect to our computers and exchange data, I’m building a docker container from which we will run experiments and communicate with many different devices, most of them use python libraries or a DAQ (that can also be used from python), but some use DLL’s.
My questions are:
Can I have Linux running on my machine and have Windows as the container’s OS?
Will I be able to connect using the DLL’s with this setup?
Will I be able to use the DLL’s if my machine does not run Windows 10 PRO (we use
win8 home and plan to upgrade to win10 home)?
Can I use these DLL’s from inside the container? Do they need to be in the container?
1.- Docker has two host container types, windows and linux, only windows host type (windows machine) can run windows containers and linux containers, because you can run net framework in windows containers, and linux host only run linux containers.
2.- If you dll use cross platform net core, you can run in both docker hosts linux and windows, but you has libraries that use net framework , you can use windows host container, you can migrate to net core via nuget ,i made in c#
3.- Even you has enable in bios processor option and your machine has hardware requirements, you can use docker, find more here
4.- I recommend use a existent official image, only you need add your code , you can find here and check samples

How can a linux container work on windows without a linux virtual machine (ie: native support)

From what I understand, the container includes all dependencies to run, but all containers running on the same platform whether it's a VM, or bare-metal will share the underlying kernel.
I believe I read somewhere that in order to run linux containers on windows, the Docker client spins up a linux based VM, and runs the container in that.
But now I see that docker for windows runs linux containers natively (ie, without hyper-v).
My question is: How can an image that was built to run on linux run on a system that has a windows kernel?
This is the original source that my question arose from:
https://www.hanselman.com/blog/DockerAndLinuxContainersOnWindowsWithOrWithoutHyperVVirtualMachines.aspx
With the latest version of Windows 10 (or 10 Server) and the beta of
Docker for Windows, there's native Linux Container support on Windows.
That means there's no Virtual Machine or Hyper-V involved (unless you
want), so Linux Containers run on Windows itself using Windows 10's
built in container support.
I saw some similar questions, but they explained how a linux container runs on a windows platform by utilising a vm/hyper-v
How docker desktop runs linux containers on Windows machine
Does "Docker On Windows" launch a linux virtual machine?
Perhaps I didn't understand their answers, but from what I understood, it still seems like the linux container is sitting on-top of the windows kernel.
this is the magic of LCOW (https://github.com/linuxkit/lcow)
you are right to run a container the base KERNEL should be same , since container is just an abstraction , so to run a linux container on windows there are two options
either use moby linux on hyperv and run containers there
use lcow to run light weight linux vm for each container. (lcow)
https://learn.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/linux-containers
with WSL in windows in future we might be able to get a third method don't know if already someone is working on it .

docker in windows need Hyper-V enabled?

Does Docker require Hyper-V enabled in windows? If yes, why?
What is the role of Hyper-V in this case?
I m using Windows 10 home. What is the alternative for hyper-V to install Docker pls?
If you use windows10 professional & your bios supports hardware virtualization, suggest you to enable Hyper-V.
When run linux container in windows10, in fact, it still needs a linux system as a docker host, because linux container cannot share kernel with windows.
If enable hyper-v, docker-windows will auto setup a MobyLinuxVm in hyper-v as a virtual machine which act as the host machine of docker. Compared to traditional solution, I mean install a linux in virtualbox. Hyper-v has much better performance, because it does not depend on windows os, it something like setup based on hardware just like vmware-esx.
Finally, if you use home version of windows10, you had to install a virtualbox as the host machine of docker and use docker toolbox, details refers to https://docs.docker.com/toolbox/overview/ for legacy desktop solution.
Update some additional points you may want to know:
a) linux container:
Docker container had to share kernel with host, there are no linux kernel on windows, so for all situations, you had to have a virtual machine with linux as docker host, either hyper-v or virtualbox if no hyper-v support.
b) windows container:
In theory, windows container could share the kernel of windows, so no virtual machine needed.
But microsoft support container too late compared to linux, so for different host, it use different solutions, see next chapter from microsoft web site:
Windows Containers include two different container types, or runtimes.
Windows Server Containers – provide application isolation through process and namespace isolation technology. A Windows Server Container shares a kernel with the container host and all containers running on the host. These containers do not provide a hostile security boundary and should not be used to isolate untrusted code. Because of the shared kernel space, these containers require the same kernel version and configuration.
Hyper-V Isolation – expands on the isolation provided by Windows Server Containers by running each container in a highly optimized virtual machine. In this configuration, the kernel of the container host is not shared with other containers on the same host. These containers are designed for hostile multitenant hosting with the same security assurances of a virtual machine. Since these containers do not share the kernel with the host or other containers on the host, they can run kernels with different versions and configurations (with in supported versions) - for example all Windows containers on Windows 10 use Hyper-V isolation to utilize the Windows Server kernel version and configuration.

Can I run Docker in a Virtual Machine?

I tried to run Docker on a virtual machine.
Host : MacBook
VM : Parallels Windows 7
And error occurs:
Is it possible?
If the VM is a Linux, you can do this without any problem - on Linux, the Docker is essentially a well-worked chroot. Thus, the Linux docker is not virtualization.
In the case of Windows, it is not so easy. Windows Docker internally uses Hyper-V to emulate the containers. Which means that you can only run, if you can use nested virtualization:
On your host machine runs a Windows VM
Inside your Windows VM, runs a HyperV
HyperV is managed by the docker installed on your virtual Windows.
I tried qemu/kvm, virtualbox and vmware player. I configured them deeply and strongly, I've hacked them, I did every possible to do. Only the last worked (VMWare).
There are significant speed costs, but it may be useful for development on Linux, and then trial-test on Windows configurations.
You will need a lot of ram. At least 16G. 32G is better. A relative useful configuration would be:
32GB physical RAM for the physical host
12GB virtual RAM for the Windows VM running on it
8GB virtual RAM inside the Windows VM for the HyperV Linux host.
Sometimes it will be a little bit buggy, but only your HyperV will crash out, your virtual Win, or your host machine won't. It is okay for testing a docker container on a Windows machine, what you've developed on a Linux. Don't create mission critical servers on this way. :-)
You're using Docker Machine in your Windows VM, which is actually going to create a Linux VM inside the Windows VM on your Mac. You can do that, but you need to enable nested virtualization - which I'm not sure you can do in Parallels 7.
Instead you can run Docker Machine on the Mac directly and use Parallels to create the Linux VM - which means Docker is running in a Linux VM on your Mac, and you don't need nested virtualization.
Or preferably use Docker for Mac if your OS supports it, it's the latest product and has much better host integration than Docker Machine.
If you would be using Windows 10/11 Pro or Enterprise and Hyper-V, then all you must do is to enable nested virtualization. On your host, just run (with your guest off):
> Set-VMProcessor -VMName <VMName> -ExposeVirtualizationExtensions $true
Now you can start your guest and run Docker Desktop as normal.
According to Docker's terms I don't think it's allowed. Section 4.1(b)(vii) says you shall not "use the Service on virtual machines." For clarification, "'Service' refers to the applications, software (including any Open Source Software), products and services provided by Docker, including any beta or trial versions."
If I am reading this right, that means it's illegal to run Docker on any VM.
Worked perfectly fine. Base OS win 10 pro with VirtualBox Version: 6.1 and vagrant with ubuntu 20.04. Using vagrant box follow docker instructions. With vagrant public network no need for port forwarding all apps were accessible.
Previous persons comment is very concerning considering on Windows and Mac you run docker inside a virtual machine lul. Windows uses WSL2 and Mac uses an arm linux machine to manage its docker.
Also, you can run docker in a vm, but it must be linuxOS vm as windows 7 does not support docker.

Linux based docker images on Windows Server 2016 TP5

Can anyone tell me whether or not it is possible to host Linux-based docker containers on Windows Server 2016 TP5?
I realize that it would have to be through virtualization, but is it possible using the 'standard' Microsoft installation (MSDN Docs) to host linux images? I know it supports Hyper-V isolation, but is that solely for isolation and not for cross platform compatibility?
Given only a single server, what is the best way to be able to host both Windows-based and Linux-based docker containers?
Do I need to install docker twice?
Should I run a Ubuntu server in a VM through Hyper-V?
Should I use the Docker Toolbox (Docker for Windows doesn't support Server 2016 yet)
This is all just for toying around at home, not an actual production environment.
It appears that there is no way of virtualizing Linux Docker containers on Windows other than installing the Docker Toolbox or running it in a VM.
Personally, I installed Hyper-V and an Ubuntu Server VM in that.
Hyper-V containers in Docker for Windows are only for isolation, not cross platform functionality.

Resources