Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🔨 compilation issue] Compilation on WSL2 fails with cuda linker error #582

Open
JamesGlare opened this issue Mar 27, 2022 · 3 comments

Comments

@JamesGlare
Copy link

JamesGlare commented Mar 27, 2022

Summary

Compilation stops on WSL2 with /usr/bin/ld: cannot find -lcuda

System configuration

  • Platform: Windows 11/WSL2 (Ubuntu 20.04.4 LTS) + CUDA 11.4
  • Compiler: GCC9.4
  • Python version: 3.9.7 (anaconda)
  • Mitsuba 2 version: (last commit sha) 858509e
  • Compiled variants:
    • scalar_rgb
    • gpu_autodiff_mono

Description

I am trying to figure out if mitsuba2 builds on WSL2 with CUDA11 support. Compilation stops with this error:
[ 35%] Linking CXX shared library libmitsuba-core.so /usr/bin/ld: cannot find -lcuda collect2: error: ld returned 1 exit status

I am not 100% sure what the issue is, but it might be because libcuda is in /usr/lib/wsl/lib in WSL. I tried adding that path to $LD_LIBRARY_FLAGS without success.

I supplied nvcc path via CMAKE flag or CUDACXX env variable.

Steps to reproduce

On WSL2, CUDA-11.4, do
mkdir build && cd build
cmake -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc ..
cmake --build .

@Speierers
Copy link
Member

Hi @JamesGlare,

We haven't experimented much with WSL2 on our side. If IIRC @bathal1 did give this a shot at some point, maybe he will be able to help you with this.

@Arcanous98
Copy link

Hi, getting it to compile is possible if you link the CUDA libs correctly but you won't be able to use the GPU variants anyway, since the NVIDIA driver that enables CUDA applications to run in WSL2 is lacking OptiX support as of now. Cheers.

@jmoraispk
Copy link

Hi, in case anyone bumps into this -> NVIDIA still doesn't support OptiX.
Here's the thread that might be updated once they do: Optix for WSL Thread

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants