brokeDude2901 / dxgkrnl_ubuntu

Microsoft GPU-P (dxgkrnl) on Hyper-V Ubuntu VM
137 stars 25 forks source link

Blender Cycles does not recognize my GPUs on a Hyper-V / Ubuntu 20.04 VM with Microsoft GPU-P support and it can't render anything,but it can if the VM is Windows.. #12

Open Marietto2008 opened 1 year ago

Marietto2008 commented 1 year ago

Hello.

I'm trying to use Ubuntu VM on a Hyper-V with Microsoft GPU-P support. The tutorial that I have used to reach the goal is the one below :

https://github.com/brokeDude2901/dxgkrnl_ubuntu

The result that I have achieved has been to enable the nVidia driver and CUDA libraries within an Ubuntu 20.04 VM,but Blender Cycles does not recognize my GPUs :

2023-07-20 22_39_34-NVIDIA GeForce Overlay

Do you know the reason ? Instead,Blender Cycles recognizes at least one GPU (I have 2 GPUs,but it recognizes only one : but I have an idea about the reason : on the script I have declared 16 GB of memory instead of the default,32 GB) if the VM is Windows 11 :

2023-07-20 23_28_55-Windows-11-GNUP on MARIETTO-WINDOW - Virtual Machine Connection

Something is missing or it does not work well if the VM is Ubuntu 20.04. I don't know what it is. What I can do to allow Blender Cycles to recognize my GPU as a good GPU for rendering ?

akaikite commented 1 year ago

I am having the same problem. My ubuntu is also the same version and it recognizes the graphics as LLVMPIPE and does not recognize the driver from NVIDIA. did you ever solve this problem?

Marietto2008 commented 1 year ago

yes :

ln -s /usr/lib/wsl/lib/libd3d12core.so /usr/lib/wsl/lib/libD3D12Core.so

akaikite commented 1 year ago

yes :

ln -s /usr/lib/wsl/lib/libd3d12core.so /usr/lib/wsl/lib/libD3D12Core.so

Thank you very much. But unfortunately I failed to get rid of LLVMPIPE. Perhaps I'm destined to suffer more. I'm bothered by the error that /user/lib/wsl/lib/libcuda.so.1 is not a symlink.

Marietto2008 commented 1 year ago

its not an error. it should works even if there is that "error".

Il gio 27 lug 2023, 20:44 akaikite @.***> ha scritto:

yes :

ln -s /usr/lib/wsl/lib/libd3d12core.so /usr/lib/wsl/lib/libD3D12Core.so

Thank you very much. But unfortunately I failed to get rid of LLVMPIPE. Perhaps I'm destined to suffer more. I'm bothered by the error that /user/lib/wsl/lib/libcuda.so.1 is not a symlink.

— Reply to this email directly, view it on GitHub https://github.com/brokeDude2901/dxgkrnl_ubuntu/issues/12#issuecomment-1654230273, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFYNC6USQCTYWEKEO5JIRDXSKZKTANCNFSM6AAAAAA2SBCHUE . You are receiving this because you authored the thread.Message ID: @.***>

akaikite commented 1 year ago

오류가 아닙니다. "오류"가 있더라도 작동해야 합니다. Il gio 27 lug 2023, 20:44 akaikite @.> ha scritto: yes : ln -s /usr/lib/wsl/lib/libd3d12core.so /usr/lib/wsl/lib/libD3D12Core.so Thank you very much. But unfortunately I failed to get rid of LLVMPIPE. Perhaps I'm destined to suffer more. I'm bothered by the error that /user/lib/wsl/lib/libcuda.so.1 is not a symlink. — Reply to this email directly, view it on GitHub <#12 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFYNC6USQCTYWEKEO5JIRDXSKZKTANCNFSM6AAAAAA2SBCHUE . You are receiving this because you authored the thread.Message ID: @.>

its not an error. it should works even if there is that "error". Il gio 27 lug 2023, 20:44 akaikite @.> ha scritto: yes : ln -s /usr/lib/wsl/lib/libd3d12core.so /usr/lib/wsl/lib/libD3D12Core.so Thank you very much. But unfortunately I failed to get rid of LLVMPIPE. Perhaps I'm destined to suffer more. I'm bothered by the error that /user/lib/wsl/lib/libcuda.so.1 is not a symlink. — Reply to this email directly, view it on GitHub <#12 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFYNC6USQCTYWEKEO5JIRDXSKZKTANCNFSM6AAAAAA2SBCHUE . You are receiving this because you authored the thread.Message ID: @.>

Can you share the window options you used or the different options? I don't know the cause and would like to replicate your environment as much as possible.

Marietto2008 commented 1 year ago

man,I get the same error as you. On the tutorial that I've followed he says that to have that message is normal.

  1. Set up the system to be able to load libraries from /usr/lib/wsl/lib/:

echo "/usr/lib/wsl/lib" > /etc/ld.so.conf.d/ld.wsl.conf ldconfig # (if you get 'libcuda.so.1 is not a symbolic link', just ignore it)

  1. If you've done everything correctly, glxinfo | grep "OpenGL renderer string" should display D3D12 (Your GPU Name). If it does not, here are some useful commands for debugging:

sudo lspci -v # should list the vGPU and the dxgkrnl driver ls -l /dev/dxg # should exist if the dxgkrnl /usr/lib/wsl/lib/nvidia-smi # should be able to not fail :P

source : https://gist.github.com/krzys-h/e2def49966aa42bbd3316dfb794f4d6a

Can you tell me what's the output of your "glxinfo | grep "OpenGL renderer string" ? and can you install blender ? can you tell me if cycles detect your real physical gpu ? thanks.

akaikite commented 1 year ago

man,I get the same error as you. on the tutorial that I've followed he says that to have that message is normal.

  1. Set up the system to be able to load libraries from /usr/lib/wsl/lib/:

echo "/usr/lib/wsl/lib" > /etc/ld.so.conf.d/ld.wsl.conf ldconfig # (if you get 'libcuda.so.1 is not a symbolic link', just ignore it)

  1. If you've done everything correctly, glxinfo | grep "OpenGL renderer string" should display D3D12 (Your GPU Name). If it does not, here are some useful commands for debugging:

sudo lspci -v # should list the vGPU and the dxgkrnl driver ls -l /dev/dxg # should exist if the dxgkrnl /usr/lib/wsl/lib/nvidia-smi # should be able to not fail :P

source : https://gist.github.com/krzys-h/e2def49966aa42bbd3316dfb794f4d6a

I have tried all the methods you suggested. But uninstalling llvmpipe was unsuccessful. There must be some underlying problem. I doubt if it's something with the rtx a6000 or the windows bios or windows settings. I've fallen down a rabbit hole. haha Anyway, thanks bro.

Marietto2008 commented 1 year ago

windows settings ?

Il ven 28 lug 2023, 15:53 akaikite @.***> ha scritto:

man,I get the same error as you. on the tutorial that I've followed he says that to have that message is normal.

  1. Set up the system to be able to load libraries from /usr/lib/wsl/lib/:

echo "/usr/lib/wsl/lib" > /etc/ld.so.conf.d/ld.wsl.conf ldconfig # (if you get 'libcuda.so.1 is not a symbolic link', just ignore it)

  1. If you've done everything correctly, glxinfo | grep "OpenGL renderer string" should display D3D12 (Your GPU Name). If it does not, here are some useful commands for debugging:

sudo lspci -v # should list the vGPU and the dxgkrnl driver ls -l /dev/dxg

should exist if the dxgkrnl /usr/lib/wsl/lib/nvidia-smi # should be able

to not fail :P

source : https://gist.github.com/krzys-h/e2def49966aa42bbd3316dfb794f4d6a

I have tried all the methods you suggested. But uninstalling llvmpipe was unsuccessful. There must be some underlying problem. I doubt if it's something with the rtx a6000 or the windows bios or windows settings. I've fallen down a rabbit hole. haha Anyway, thanks bro.

— Reply to this email directly, view it on GitHub https://github.com/brokeDude2901/dxgkrnl_ubuntu/issues/12#issuecomment-1655729833, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFYNC3CJY4S6K4J6G2JSRDXSO76HANCNFSM6AAAAAA2SBCHUE . You are receiving this because you authored the thread.Message ID: @.***>

akaikite commented 1 year ago

windows settings ? Il ven 28 lug 2023, 15:53 akaikite @.> ha scritto: man,I get the same error as you. on the tutorial that I've followed he says that to have that message is normal. 1. Set up the system to be able to load libraries from /usr/lib/wsl/lib/: echo "/usr/lib/wsl/lib" > /etc/ld.so.conf.d/ld.wsl.conf ldconfig # (if you get 'libcuda.so.1 is not a symbolic link', just ignore it) 1. If you've done everything correctly, glxinfo | grep "OpenGL renderer string" should display D3D12 (Your GPU Name). If it does not, here are some useful commands for debugging: sudo lspci -v # should list the vGPU and the dxgkrnl driver ls -l /dev/dxg # should exist if the dxgkrnl /usr/lib/wsl/lib/nvidia-smi # should be able to not fail :P source : https://gist.github.com/krzys-h/e2def49966aa42bbd3316dfb794f4d6a I have tried all the methods you suggested. But uninstalling llvmpipe was unsuccessful. There must be some underlying problem. I doubt if it's something with the rtx a6000 or the windows bios or windows settings. I've fallen down a rabbit hole. haha Anyway, thanks bro. — Reply to this email directly, view it on GitHub <#12 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFYNC3CJY4S6K4J6G2JSRDXSO76HANCNFSM6AAAAAA2SBCHUE . You are receiving this because you authored the thread.Message ID: @.>

I've been thinking about downgrading from Windows 11 22h2 to 21h2.

Marietto2008 commented 1 year ago

Aren't you trying to configure Ubuntu virtualized with GPU-P with the hyper-V ? You could try this more recent tutorial :

https://gist.github.com/krzys-h/e2def49966aa42bbd3316dfb794f4d6a

and I think you could try Windows Server 2022 Insider Preview Build 25246 or later. That's because it is slightly different than Windows 11 and from differences can come more interesting informations than from similarities.

akaikite commented 1 year ago

Aren't you trying to configure Ubuntu virtualized with GPU-P with the hyper-V ? You could try this more recent tutorial :

https://gist.github.com/krzys-h/e2def49966aa42bbd3316dfb794f4d6a

and I think you could try Windows Server 2022 Insider Preview Build 25246 or later. That's because it is slightly different than Windows 11 and from differences can come more interesting informations than from similarities.

I'm a regular guy, so I hope I don't end up upgrading to Windows for Server. lol Thank you very much for the link. I will try to run it now.

Marietto2008 commented 1 year ago

nope. You don't have to run Windows server. But you can learn which kind of errors it gives and which final result you get. If it works on server and not on workstation it may means that server has some features that 11 does not have or that in 11 aren't enabled. At least you know where you can look. Maybe I can try myself with windows server.

Marietto2008 commented 1 year ago

Don't forget to do this if you use WIndows server :

Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\HyperV" -Name "RequireSecureDeviceAssignment" -Type DWORD -Value 0 -Force

Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\HyperV" -Name "RequireSupportedDeviceAssignment" -Type DWORD -Value 0 -Force
akaikite commented 1 year ago

Don't forget to do this if you use WIndows server :

Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\HyperV" -Name "RequireSecureDeviceAssignment" -Type DWORD -Value 0 -Force

Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\HyperV" -Name "RequireSupportedDeviceAssignment" -Type DWORD -Value 0 -Force

Thanks for your help so far. I've decided to give up on the idea of using AI models to make inferences.

Marietto2008 commented 1 year ago

why ? today there are a lot of virtualization solutions. Usually I use :

1) on FreeBSD : a bhyve / linux VM + nvidia driver and / or with windows 11 as guest os with an AMD gpu

2) On FreeBSD : the FreeBSD emulation layer configured /by me/ to support the CUDA libraries and the nvidia drivers. I've been able to run Maya 2023 on top of it ; even the gpu is detected.

3) on Windows 11 : you can use windows 11 + WSL2,where it is enough to install the CUDA libraries to detect the GPU. It works infact blender cycles is able to recognize it like a charm

4) on Windows 11 or Linux: a qemu-kvm Linux guest on top of Windows 11 as host os or Linux as host and Windows or Linux as guest with the GPU passed through.

akaikite commented 1 year ago

왜 ? 오늘날 많은 가상화 솔루션이 있습니다. 보통 나는 다음을 사용합니다.

  1. FreeBSD에서: bhyve / linux VM + nvidia 드라이버 및/또는 Windows 11을 게스트 OS로 AMD GPU 사용
  2. FreeBSD에서: FreeBSD 에뮬레이션 계층은 CUDA 라이브러리와 nvidia 드라이버를 지원하도록 /나에 의해/ 구성되었습니다. 그 위에 Maya 2023을 실행할 수 있었습니다. 심지어 gpu도 감지됩니다.
  3. Windows 11에서: Windows 11 + WSL2를 사용할 수 있습니다. GPU를 감지하기 위해 CUDA 라이브러리를 설치하는 것으로 충분합니다. 사실 블렌더 사이클이 매력처럼 인식할 수 있습니다.
  4. Windows 11 또는 Linux에서: Windows 11 위에 있는 qemu-kvm Linux 게스트는 호스트 OS로, Linux는 호스트로, Windows 또는 Linux는 GPU가 통과된 게스트로 사용됩니다.

why ? today there are a lot of virtualization solutions. Usually I use :

  1. on FreeBSD : a bhyve / linux VM + nvidia driver and / or with windows 11 as guest os with an AMD gpu
  2. On FreeBSD : the FreeBSD emulation layer configured /by me/ to support the CUDA libraries and the nvidia drivers. I've been able to run Maya 2023 on top of it ; even the gpu is detected.
  3. on Windows 11 : you can use windows 11 + WSL2,where it is enough to install the CUDA libraries to detect the GPU. It works infact blender cycles is able to recognize it like a charm
  4. on Windows 11 or Linux: a qemu-kvm Linux guest on top of Windows 11 as host os or Linux as host and Windows or Linux as guest with the GPU passed through.

I'll leave the host on Windows 11 as I'm just a cowardly newbie. I've left WSL2 out of the options as I'll be using it for my own space. I'll look into qemu-kvm. Thanks.

Marietto2008 commented 1 year ago

you should understand that if you start to leave something thinking that the next thing will be easier than the previous one,you will leave also the second one,and then the third one and so on.

ngokhang66 commented 1 year ago

hey, did u solve this problem? I had some problem like you

akaikite commented 1 year ago

야, 너 이 문제 해결했어? 나도 너처럼 문제가 좀 있었어

nope