MonaiLabel and Slicer Issues

Hello,
I am running into some issues with MonaiLabel.

I tried installing monailabel via docker. The image was created but I get several issues:
-In docker:

WARNING: The NVIDIA Driver was not detected. GPU functionality will not be available.

Use the NVIDIA Container Toolkit to start this container with GPU support; see
NVIDIA Cloud Native Technologies - NVIDIA Docs

-How do I install the Container toolkit on windows?

-do I need to install the cuda drivers on my system? or is this in the docker image?
I assume it is still good to install on the system so that I can also use them for Slicer?

-Finally, I tried downloading slicer but it does not open. I am not sure if in the process of trying to install MonaiLabel I made a mistake.

Thank you!
Eva

I also checked this and found no .dll error: Get Help — 3D Slicer documentation

and running in admin mode did not work

Try this link. I believe the best way of running docker on windows is through the WSL2 (windows subsystem for linux). CUDA on WSL (nvidia.com)

Thank you Murat!
Or do you recommend just installing without docker (either directly or with a conda venv)?

Regarding the Slicer bug, I just reinstalled windows since the computer was new and this seemed the best way to reset any issues I created with dependencies.
Slicer works now (have not yet reinstalled monai and cuda and pytorch)

I never tried that. Don’t have any info to share. Others may have.

1 Like

Hi @evaherbst,

Thanks for sharing your experience.

  • I tried installing monailabel via docker. The image was created but I get several issues:

You don’t need to install monailabel via docker. Just download the MONAI Label Docker container and use MONAI Label.

docker pull projectmonai/monailabel

https://hub.docker.com/r/projectmonai/monailabel

Otherwise, you can also use this command to start the bash within the MONAI Label Docker container:

docker run --gpus all --rm -ti --ipc=host --net=host projectmonai/monailabel:latest bash

  • How do I install the Container toolkit on windows?

Did you make sure you have Docker on your computer? This is the first step to using the MONAI Label Docker container.

-do I need to install the cuda drivers on my system? or is this in the docker image?
I assume it is still good to install on the system so that I can also use them for Slicer?

Yes, this is a requirement to use your GPU. Do you know which GPU you have on your PC?

-Finally, I tried downloading slicer but it does not open. I am not sure if in the process of trying to install MonaiLabel I made a mistake.

Sorry, I’m not sure what didn’t open - MONAI Label? Slicer?
If MONAI Label, the first part of the process is to start the MONAI Label server. From what I understood, you haven’t managed to start the server.

Hope this helps,

Thank you so much @muratmaga and @diazandr3s

Sorry for being unclear. I am still learning all of the terminology around docker.
I did not install monailabel - I installed docker and then used:

docker pull projectmonai/monailabel:latest

docker run -it --rm --gpus all --ipc=host --net=host -v ~:/workspace/ projectmonai/monailabel:latest bash

I read that I need to also install the Nvidia Container Toolkit for the monailabel docker container, is this true? In docker in the container I got the warning: “WARNING: The NVIDIA Driver was not detected. GPU functionality will not be available.”

Yes, this is a requirement to use your GPU. Do you know which GPU you have on your PC?

I have the following GPU: NVIDIA GeForce RTX 4090 24GB
I use Windows 11.

I had CUDA 12.1 installed on my system before installing docker etc. Is this the right version of CUDA to install? I saw there is also 12.4.

Sorry, I’m not sure what didn’t open - MONAI Label? Slicer?

Slicer just started loading and then crashed before fully opening. I had no error logs. In the end I reinstalled windows (I was worried I had messed up some dependencies, and since it was a new machine this seemed the simplest solution).

So now I want to make sure I install everything correctly to not cause any issues with Slicer again.

Thank you very much!
Eva

Hi @evaherbst,

I read that I need to also install the Nvidia Container Toolkit for the monailabel docker container, is this true?

No, you don’t need that for the MONAI Label Docker container to work.

In docker in the container I got the warning: “WARNING: The NVIDIA Driver was not detected. GPU functionality will not be available.”

Once you are in the MONAI Label Docker bash terminal, can you run nvidia-smi to check whether the GPU is visible?

Have you tried starting the MONAI Label server?

Thank you so much @diazandr3s for the quick reply!

That is really helpful.

This is for our computer at the clinic, and I am not there today, but I will try it tomorrow.
Just to clarify, which CUDA version should I install? Does it amtter?

Thanks!
Eva

1 Like

Dear @diazandr3s ,

I was able to start the server:

[2024-04-03 13:44:13,200] [657] [MainThread] [INFO] (timeloop:63) - Timeloop now started. Jobs will run based on the interval set
[2024-04-03 13:44:13,200] [657] [MainThread] [INFO] (uvicorn.error:62) - Application startup complete.
[2024-04-03 13:44:13,200] [657] [MainThread] [INFO] (uvicorn.error:217) - Uvicorn running on http://0.0.0.0:8000

I then tried the tutorial here, I downloaded the models and tried to connect to the server in Slicer but am getting the following error:

Failed to fetch models from remote server. Make sure server address is correct and <server_uri>/info/ is accessible in browser.

I tried using hosts:
http://0.0.0.0:8000 or
http://127.0.0.1:8000 or
http://localhost:8000 or leaving it blank

details:

Traceback (most recent call last):
File "C:/Users/Eva/AppData/Local/slicer.org/Slicer 5.6.1/slicer.org/Extensions-32438/MONAILabel/lib/Slicer-5.6/qt-scripted-modules/MONAILabel.py", line 1085, in fetchInfo
info = self.logic.info()
File "C:/Users/Eva/AppData/Local/slicer.org/Slicer 5.6.1/slicer.org/Extensions-32438/MONAILabel/lib/Slicer-5.6/qt-scripted-modules/MONAILabel.py", line 2288, in info
return self._client().info()
File "C:/Users/Eva/AppData/Local/slicer.org/Slicer 5.6.1/slicer.org/Extensions-32438/MONAILabel/lib/Slicer-5.6/qt-scripted-modules/MONAILabel.py", line 2264, in _client
if mc.auth_enabled():
File "C:\Users\Eva\AppData\Local\slicer.org\Slicer 5.6.1\slicer.org\Extensions-32438\MONAILabel\lib\Slicer-5.6\qt-scripted-modules\MONAILabelLib\client.py", line 83, in auth_enabled
status, response, _, _ = MONAILabelUtils.http_method("GET", self._server_url, selector)
File "C:\Users\Eva\AppData\Local\slicer.org\Slicer 5.6.1\slicer.org\Extensions-32438\MONAILabel\lib\Slicer-5.6\qt-scripted-modules\MONAILabelLib\client.py", line 521, in http_method
conn.request(method, selector, body=body, headers=headers)
File "C:\Users\Eva\AppData\Local\slicer.org\Slicer 5.6.1\lib\Python\Lib\http\client.py", line 1285, in request
self._send_request(method, url, body, headers, encode_chunked)
File "C:\Users\Eva\AppData\Local\slicer.org\Slicer 5.6.1\lib\Python\Lib\http\client.py", line 1331, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "C:\Users\Eva\AppData\Local\slicer.org\Slicer 5.6.1\lib\Python\Lib\http\client.py", line 1280, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "C:\Users\Eva\AppData\Local\slicer.org\Slicer 5.6.1\lib\Python\Lib\http\client.py", line 1040, in _send_output
self.send(msg)
File "C:\Users\Eva\AppData\Local\slicer.org\Slicer 5.6.1\lib\Python\Lib\http\client.py", line 980, in send
self.connect()
File "C:\Users\Eva\AppData\Local\slicer.org\Slicer 5.6.1\lib\Python\Lib\http\client.py", line 946, in connect
self.sock = self._create_connection(
File "C:\Users\Eva\AppData\Local\slicer.org\Slicer 5.6.1\lib\Python\Lib\socket.py", line 844, in create_connection
raise err
File "C:\Users\Eva\AppData\Local\slicer.org\Slicer 5.6.1\lib\Python\Lib\socket.py", line 832, in create_connection
sock.connect(sa)
ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it

I am using Slicer 5.6 - I tried installing 5.7 but it does not open, similar to the behaviour I had a while back

Please let me know if this should be posted on the Monai Forum instead

maybe it is a problem with the university proxy server I am using

Those addresses are local to your computer, so proxy shouldn’t be an issue. However, if this is a company managed device, there might be policies blocking what you can do on the computer.

After you start monaiLabel server, launch web browser and type those addresses, and see it connects (again on the same computer you launched monaiLabel). If it they do not connect, there is a problem with the server.

Thank you Murat. I was waiting for IT to check out if it is an issue with the proxy server, but they had no solutions.

maybe I am doing something wrong with docker - it did look like the server started but I cannot view those addresses in a web browser nor access them with slicer.

I also attempted to install via an anaconda venv and also just directly in my system.

I checked “nvcc-version” and cuda 11.8 is installed so I used:
pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu118

however, when I run “python -c “import torch; print(torch.cuda.is_available())”” it just stalls.

It is strange because this worked before.

Thanks,
Eva