9292 runs-on : ${{ matrix.os }}
9393
9494 steps :
95+ - name : Install Linux dependencies
96+ if : runner.os == 'Linux'
97+ run : |
98+ sudo apt-get update
99+ sudo apt-get install -y build-essential libsparsehash-dev
100+
95101 - name : Checkout repository
96102 uses : actions/checkout@v4
97103
@@ -101,24 +107,31 @@ jobs:
101107 python-version : ${{ matrix.python-version }}
102108
103109 - name : Install CUDA Toolkit ${{ matrix.cuda-version }}
110+ if : runner.os == 'Windows' # Only install CUDA Toolkit on Windows; Linux uses PyTorch wheels with CUDA runtime
104111 uses : Jimver/cuda-toolkit@v0.2.23
105112 with :
106113 cuda : ${{ matrix.cuda-version }}.0
107114 method : ' network'
108115 sub-packages : ' ["nvcc", "cudart", "cublas", "curand", "cufft", "cusparse", "cusolver"]'
109116
117+ - name : Install sparsehash (Windows)
118+ if : runner.os == 'Windows'
119+ shell : pwsh
120+ run : |
121+ # Download and extract sparsehash
122+ Invoke-WebRequest -Uri "https://github.com/sparsehash/sparsehash/archive/refs/tags/sparsehash-2.0.4.zip" -OutFile "sparsehash.zip"
123+ Expand-Archive -Path "sparsehash.zip" -DestinationPath "C:\"
124+ Rename-Item "C:\sparsehash-sparsehash-2.0.4" "C:\sparsehash"
125+
126+ # Set environment variable for subsequent steps
127+ echo "INCLUDE=$env:INCLUDE;C:\sparsehash\src" >> $env:GITHUB_ENV
128+
110129 - name : Setup Visual Studio environment (Windows)
111130 if : runner.os == 'Windows'
112131 uses : ilammy/msvc-dev-cmd@v1
113132 with :
114133 arch : x64
115134
116- - name : Install Linux dependencies
117- if : runner.os == 'Linux'
118- run : |
119- sudo apt-get update
120- sudo apt-get install -y build-essential libsparsehash-dev
121-
122135 - name : Install sparsehash (Windows)
123136 if : runner.os == 'Windows'
124137 shell : pwsh
@@ -131,6 +144,12 @@ jobs:
131144 # Set environment variable for subsequent steps
132145 echo "INCLUDE=$env:INCLUDE;C:\sparsehash\src" >> $env:GITHUB_ENV
133146
147+ - name : Install Linux dependencies
148+ if : runner.os == 'Linux'
149+ run : |
150+ sudo apt-get update
151+ sudo apt-get install -y build-essential libsparsehash-dev
152+
134153 - name : Install Python dependencies
135154 run : |
136155 python -m pip install --upgrade pip
@@ -549,4 +568,4 @@ jobs:
549568 sparse_tensor = torchsparse.SparseTensor(coords=coords, feats=feats)
550569 print(f'Sparse tensor shape: {sparse_tensor.shape}')
551570 print('✅ All tests passed!')
552- "
571+ '
0 commit comments