File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -378,7 +378,23 @@ impl CudaBuilder {
378
378
. expect ( "Failed to run ptxas" ) ;
379
379
println ! ( "cargo:warning=PTXAS output: {:?}" , ptxas_output) ;
380
380
if !ptxas_output. status . success ( ) {
381
- panic ! ( "ptxas failed with exit code: {:?}" , ptxas_output. status. code( ) ) ;
381
+ match ptxas_output. status . code ( ) {
382
+ Some ( code) => panic ! ( "ptxas failed with exit code: {code}" ) ,
383
+ None => {
384
+ // Process was terminated by a signal
385
+ #[ cfg( unix) ]
386
+ {
387
+ use std:: os:: unix:: process:: ExitStatusExt ;
388
+ if let Some ( signal) = ptxas_output. status . signal ( ) {
389
+ panic ! ( "ptxas was killed by signal: {signal}" ) ;
390
+ } else {
391
+ panic ! ( "ptxas failed with unknown signal" ) ;
392
+ }
393
+ }
394
+ #[ cfg( not( unix) ) ]
395
+ panic ! ( "ptxas failed with signal" ) ;
396
+ } ,
397
+ }
382
398
}
383
399
384
400
if let Some ( copy_path) = & self . ptx_file_copy_path {
You can’t perform that action at this time.
0 commit comments